Commit Graph

319 Commits

Author SHA1 Message Date
kozyatinskiy
aca928b7ad Reland [V8] Removed SourceLocationRestrict
This method uses in messages.js in GetSourceLine and GetPositionInLine. This methods uses in v8::Message API methods and there is no documentation about it.
Method looks obsolete.
One of the strange side effect is shown by attached issue.

BUG=chromium:468781
TBR=yangguo@chromium.org
LOG=Y

Review URL: https://codereview.chromium.org/1033973002

Cr-Commit-Position: refs/heads/master@{#27458}
2015-03-25 23:11:12 +00:00
marja
cb7279da81 [strong] Check strong mode free variables against the global object.
Gather references to unbound variables where the reference (VariableProxy) is
inside strong mode. Check them against the global object when a script is bound
to a context (during compilation).

This CL only checks unbound variables which are not inside lazy functions - TBD
how do we solve that; alternatives: add developer mode which disables laziness /
do the check whenever lazy functions are really compiled.

BUG=v8:3956
LOG=N

Review URL: https://codereview.chromium.org/1005063002

Cr-Commit-Position: refs/heads/master@{#27422}
2015-03-24 16:46:59 +00:00
machenbach
310d75218e Revert of [V8] Removed SourceLocationRestrict (patchset #3 id:40001 of https://codereview.chromium.org/1022333004/)
Reason for revert:
[Sheriff] This seems to change layout test expectations of some tests, e.g.:
http://build.chromium.org/p/client.v8/builders/V8-Blink%20Linux%2064%20%28dbg%29/builds/2317

Expectation example:
https://storage.googleapis.com/chromium-layout-test-archives/V8-Blink_Linux_64__dbg_/2317/layout-test-results/fast/events/window-onerror-11-pretty-diff.html

Please add a needsmanualrebaseline expectation to the tests affected by this change on the blink side first before relanding.

Original issue's description:
> [V8] Removed SourceLocationRestrict
>
> This method uses in messages.js in GetSourceLine and GetPositionInLine. This methods uses in v8::Message API methods and there is no documentation about it.
> Method looks obsolete.
> One of the strange side effect is shown by attached issue.
>
> BUG=chromium:468781
> R=yangguo@chromium.org
> LOG=Y
>
> Committed: https://crrev.com/b563ceac0f95551a128a1403cdbacc7aefcdabaf
> Cr-Commit-Position: refs/heads/master@{#27374}

TBR=yangguo@chromium.org,kozyatinskiy@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=chromium:468781

Review URL: https://codereview.chromium.org/1028413002

Cr-Commit-Position: refs/heads/master@{#27398}
2015-03-24 12:04:43 +00:00
kozyatinskiy
b563ceac0f [V8] Removed SourceLocationRestrict
This method uses in messages.js in GetSourceLine and GetPositionInLine. This methods uses in v8::Message API methods and there is no documentation about it.
Method looks obsolete.
One of the strange side effect is shown by attached issue.

BUG=chromium:468781
R=yangguo@chromium.org
LOG=Y

Review URL: https://codereview.chromium.org/1022333004

Cr-Commit-Position: refs/heads/master@{#27374}
2015-03-23 16:33:19 +00:00
rossberg
490378ba15 [strong] Less pleading error messages
R=dslomov@chromium.org
BUG=v8:3956
LOG=N

Review URL: https://codereview.chromium.org/1021213002

Cr-Commit-Position: refs/heads/master@{#27338}
2015-03-20 10:50:24 +00:00
rossberg
74cf8e0122 [strong] Check constructor returns
R=dslomov@chromium.org
BUG=v8:3956
LOG=N

Review URL: https://codereview.chromium.org/1019283002

Cr-Commit-Position: refs/heads/master@{#27320}
2015-03-19 19:40:04 +00:00
caitpotter88
d21fd15467 [es6] implement Reflect.apply() & Reflect.construct()
BUG=v8:3900
LOG=N
R=dslomov@chromium.org

Review URL: https://codereview.chromium.org/913073003

Cr-Commit-Position: refs/heads/master@{#27316}
2015-03-19 14:47:27 +00:00
yurys
cb50b0dfe7 Beautify syntax error for unterminated argument list
BUG=chromium:339474
LOG=Y

Review URL: https://codereview.chromium.org/1002263004

Cr-Commit-Position: refs/heads/master@{#27205}
2015-03-16 09:16:26 +00:00
rossberg
3fcb38f772 [strong] Check super constructor calls
R=marja@chromium.org
BUG=v8:3956
LOG=N

Review URL: https://codereview.chromium.org/1002253002

Cr-Commit-Position: refs/heads/master@{#27188}
2015-03-13 16:26:52 +00:00
dslomov
92138c73a7 Remove --harmony-scoping flag.
We have been shipping harmony scoping for 2 Chrome releases now (M41
and M42). Time to remove the flag.

R=rossberg@chromium.org
LOG=Y

Review URL: https://codereview.chromium.org/1007783002

Cr-Commit-Position: refs/heads/master@{#27187}
2015-03-13 15:15:57 +00:00
kozyatinskiy
ec73e08860 [V8] Use Function.name in Error.stack
Error.stack contains function.name if its type is string.
Otherwise if function have inferred name then .stack contains it.
For functions from eval .stack property contains "eval".

LOG=N
BUG=chromium:17356
R=yurys@chromium.org

Review URL: https://codereview.chromium.org/919653002

Cr-Commit-Position: refs/heads/master@{#27186}
2015-03-13 15:11:57 +00:00
yangguo
c67521794a Hide Symbol implementation in a closure.
R=jkummerow@chromium.org

Review URL: https://codereview.chromium.org/1009443002

Cr-Commit-Position: refs/heads/master@{#27185}
2015-03-13 15:08:28 +00:00
adamk
0c305e0b1b Fix error message for Object.observe accept argument
BUG=chromium:464695
LOG=n

Review URL: https://codereview.chromium.org/1005553003

Cr-Commit-Position: refs/heads/master@{#27171}
2015-03-12 19:04:38 +00:00
yangguo
4e9daf4e3d Hide RegExp and String initialization in a closure.
R=jkummerow@chromium.org

Review URL: https://codereview.chromium.org/1000063002

Cr-Commit-Position: refs/heads/master@{#27161}
2015-03-12 14:47:49 +00:00
caitpotter88
9e482baf81 [parser] better error message for generator constructors
BUG=
LOG=N
R=arv@chromium.org

Review URL: https://codereview.chromium.org/982153003

Cr-Commit-Position: refs/heads/master@{#27051}
2015-03-06 16:54:39 +00:00
rossberg
2ecdf736cf Fix exception for assignment to uninitialised const
R=dslomov@chromium.org, mstarzinger@chromium.org
BUG=

Review URL: https://codereview.chromium.org/976053002

Cr-Commit-Position: refs/heads/master@{#27014}
2015-03-05 12:44:01 +00:00
dslomov
290ee378ea Disallow subclassing Arrays.
R=rossberg@chromium.org,arv@chromium.org
BUG=v8:3930
LOG=Y

Committed: https://crrev.com/87f3e08e72510ee5544e82bb7ad39b2b5f001ad3
Cr-Commit-Position: refs/heads/master@{#26925}

Review URL: https://codereview.chromium.org/962263002

Cr-Commit-Position: refs/heads/master@{#26931}
2015-02-28 00:28:35 +00:00
dslomov
47b6e27317 Revert of Disallow subclassing Arrays. (patchset #3 id:40001 of https://codereview.chromium.org/962263002/)
Reason for revert:
Fails on nosnap build

Original issue's description:
> Disallow subclassing Arrays.
>
> R=rossberg@chromium.org,arv@chromium.org
> BUG=v8:3930
> LOG=Y
>
> Committed: https://crrev.com/87f3e08e72510ee5544e82bb7ad39b2b5f001ad3
> Cr-Commit-Position: refs/heads/master@{#26925}

TBR=arv@chromium.org,rossberg@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=v8:3930

Review URL: https://codereview.chromium.org/965053002

Cr-Commit-Position: refs/heads/master@{#26930}
2015-02-27 22:26:36 +00:00
dslomov
87f3e08e72 Disallow subclassing Arrays.
R=rossberg@chromium.org,arv@chromium.org
BUG=v8:3930
LOG=Y

Review URL: https://codereview.chromium.org/962263002

Cr-Commit-Position: refs/heads/master@{#26925}
2015-02-27 20:18:07 +00:00
marja
1eddcf5b71 [strong] Declaration-after-use errors.
We cannot yet detect use-before-declaration in general, because for that we'd
need to analyze the context when compiling. But we can detect an error case
where we first see a use, then a declaration.

For this, I also added end position tracking (needed for error messages) to
VariableProxy.

Note: the position naming is completely inconsistent: start_position &
end_position, position & end_position, pos & end_pos, beg_pos & end_pos, to name
a few. This doesn't fix all of it, but tries to unify towards start_position &
end_position whenever possible w/ minimal changes.

BUG=

Review URL: https://codereview.chromium.org/943543002

Cr-Commit-Position: refs/heads/master@{#26880}
2015-02-26 13:48:19 +00:00
rossberg
943dc63126 [strong] Deprecate ellisions
R=marja@chromium.org
BUG=

Review URL: https://codereview.chromium.org/950303002

Cr-Commit-Position: refs/heads/master@{#26820}
2015-02-24 12:51:08 +00:00
adamk
a538d945e3 Teach ModuleDescriptor about basic local exports
Add() becomes AddLocalExport, which takes an export_name and a local_name.
New parsing tests exercise this.

Also start generating exports for default exports (though this doesn't yet
handle anonymous default exports).

BUG=v8:1569
LOG=n

Review URL: https://codereview.chromium.org/934323004

Cr-Commit-Position: refs/heads/master@{#26758}
2015-02-19 20:15:13 +00:00
rossberg
0ebd870f72 [strong] Deprecate arguments
R=marja@chromium.org
BUG=

Review URL: https://codereview.chromium.org/932333004

Cr-Commit-Position: refs/heads/master@{#26753}
2015-02-19 14:58:42 +00:00
rossberg
7d089a5929 [strong] Deprecate for-in
R=marja@chromium.org
BUG=

Review URL: https://codereview.chromium.org/939063002

Cr-Commit-Position: refs/heads/master@{#26751}
2015-02-19 13:50:41 +00:00
adamk
522937cb49 Strip Interface class of most of its logic, make it all about Module exports
This gets Variable and VariableProxy out of the business of worrying about
Interfaces.

At the same time, get rid of the notion of "module variables". In ES6, variables
that refer to modules will be simply be CONST bindings to module namespace
objects.

The only change in logic here is one more early error:
duplicate export names are now rejected.

BUG=v8:1569
LOG=n

Review URL: https://codereview.chromium.org/918373002

Cr-Commit-Position: refs/heads/master@{#26708}
2015-02-17 20:51:35 +00:00
Andreas Rossberg
c503241945 [strong] deprecate empty sub-statements
R=marja@chromium.org
BUG=

Review URL: https://codereview.chromium.org/931223002

Cr-Commit-Position: refs/heads/master@{#26701}
2015-02-17 16:26:06 +00:00
Andreas Rossberg
f55242948e [strong] Deprecate delete
R=marja@chromium.org
BUG=

Review URL: https://codereview.chromium.org/932833002

Cr-Commit-Position: refs/heads/master@{#26698}
2015-02-17 16:08:11 +00:00
marja
34281c8322 [strong] Forbid var.
R=rossberg@chromium.org
BUG=

Review URL: https://codereview.chromium.org/927953003

Cr-Commit-Position: refs/heads/master@{#26697}
2015-02-17 15:41:25 +00:00
rossberg
dff690ec07 [strong] no sloppy equality
R=marja@chromium.org
BUG=

Review URL: https://codereview.chromium.org/917703003

Cr-Commit-Position: refs/heads/master@{#26619}
2015-02-12 15:10:04 +00:00
arv
68e4897586 Remove Function.prototype.toMethod
Function.prototype.toMethod was removed from ES6.

This removes the function and updates the tests to either
use %ToMethod or a dedicated syntax (using concise method
or a class).

BUG=v8:3330
LOG=N
R=dslomov@chromium.org, adamk

Review URL: https://codereview.chromium.org/914713002

Cr-Commit-Position: refs/heads/master@{#26559}
2015-02-10 22:13:43 +00:00
dslomov
158a87659f new classes: assert that constructors are not callable and rewrite 'return;'
R=arv@chromium.org
BUG=v8:3834
LOG=N

Review URL: https://codereview.chromium.org/885643004

Cr-Commit-Position: refs/heads/master@{#26483}
2015-02-06 10:35:13 +00:00
caitpotter88
f6f56de8e3 Add param_after_rest error message after r26362
BUG=v8:2159
LOG=N
R=marja@chromium.org, arv@chromium.org

Review URL: https://codereview.chromium.org/888713003

Cr-Commit-Position: refs/heads/master@{#26366}
2015-01-30 17:18:57 +00:00
arv
13616615fd Lexical declarations should not be allowed in Statement
For example let and class should only be allowed inside function/block/script.

We have to continue to support const in statements in sloppy mode for backwards compatibility.

BUG=3831
LOG=Y
R=dslomov@chromium.org, adamk

Review URL: https://codereview.chromium.org/869293002

Cr-Commit-Position: refs/heads/master@{#26337}
2015-01-30 03:10:13 +00:00
arv
b004b1d821 Move object literal checking into checker classes
This removes the duplicate property check from object literals.

Instead we repurpose the ObjectLiteralChecker into two cases, implemented
by two subclasses to ObjectLiteralCheckerBase called ObjectLiteralChecker
and ClassLiteralChecker.

The object literal checker now only checks for duplicate __proto__ fields in
object literals.

The class literal checker checks for duplicate constructors, non constructor
fields named constructor as well as static properties named prototype.

BUG=v8:3819
LOG=Y
R=adamk, dslomov@chromium.org

Review URL: https://codereview.chromium.org/873823003

Cr-Commit-Position: refs/heads/master@{#26336}
2015-01-29 23:12:43 +00:00
caitpotter88
233f2d2bf1 Simplify scanner and generate better error message for legacy octals in templates
LOG=N
BUG=
R=arv@chromium.org, dslomov@chromium.org

Review URL: https://codereview.chromium.org/812163003

Cr-Commit-Position: refs/heads/master@{#25895}
2014-12-18 22:01:41 +00:00
mathiasb
33f0cf5acd Implement the RegExp.prototype.flags getter
TEST=mjsunit/harmony
BUG=v8:3751
LOG=N

Review URL: https://codereview.chromium.org/770333005

Cr-Commit-Position: refs/heads/master@{#25762}
2014-12-10 20:41:10 +00:00
arv
c8c7395644 Optimize GetPrototype
This introduces Hydrogen for %_GetPrototype. The code falls back on
runtime if the object needs access checks or if its prototype is a
hidden prototype.

BUG=None
LOG=Y
R=dslomov@chromium.org

Review URL: https://codereview.chromium.org/756423006

Cr-Commit-Position: refs/heads/master@{#25694}
2014-12-05 20:36:50 +00:00
Dmitry Lomov
16d9146ac4 Fix nosnap build
TBR=rossberg@chromium.org

Review URL: https://codereview.chromium.org/762083002

Cr-Commit-Position: refs/heads/master@{#25557}
2014-11-28 06:22:57 +00:00
dslomov
65aa17b9c3 harmony-classes: Implement 'super(...)' call syntactic restriction.
R=rossberg@chromium.org,arv@chromium.org
BUG=v8:3330
LOG=N

Review URL: https://codereview.chromium.org/766663003

Cr-Commit-Position: refs/heads/master@{#25555}
2014-11-28 04:08:58 +00:00
Andreas Rossberg
1808badc2d Disable classes in sloppy mode unless --harmony-sloppy is set
Also clean up flag names a little.

Baseline: https://codereview.chromium.org/713413003/

R=arv@chromium.org, dslomov@chromium.org
BUG=

Review URL: https://codereview.chromium.org/722203006

Cr-Commit-Position: refs/heads/master@{#25435}
2014-11-20 10:52:03 +00:00
dslomov
ca8eaef638 harmony-scoping: better error messages for let declarations in sloppy mode.
R=rossberg@chromium.org
BUG=v8:2198
LOG=N

Review URL: https://codereview.chromium.org/713413003

Cr-Commit-Position: refs/heads/master@{#25406}
2014-11-18 18:51:26 +00:00
caitpotter88
353b696467 Implement ES6 Template Literals
BUG=v8:3230

Review URL: https://codereview.chromium.org/663683006

Cr-Commit-Position: refs/heads/master@{#25362}
2014-11-14 18:53:52 +00:00
wingo@igalia.com
757f400246 Leaving a generator via an exception causes it to close
R=rossberg@chromium.org
BUG=v8:3096
LOG=Y

Review URL: https://codereview.chromium.org/717123002

Cr-Commit-Position: refs/heads/master@{#25297}
git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@25297 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-11-12 14:29:22 +00:00
yangguo@chromium.org
1dbd6369b1 Correctly compute line numbers in functions from the function constructor.
R=aandrey@chromium.org
BUG=chromium:109362
LOG=Y

Review URL: https://codereview.chromium.org/701093003

Cr-Commit-Position: refs/heads/master@{#25289}
git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@25289 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-11-12 10:06:47 +00:00
yangguo@chromium.org
ebbcbf1646 Reorder Error properties.
R=jkummerow@chromium.org

Review URL: https://codereview.chromium.org/717573006

Cr-Commit-Position: refs/heads/master@{#25282}
git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@25282 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-11-12 09:28:44 +00:00
jkummerow@chromium.org
3b3929fdc7 Reland "Avoid some unnecessary fast-properties map creations."
This relands commit ea74f0f85a.

The revert was due to failures in cctest/test-heap/ReleaseOverReservedPages,
caused by apparent changes to memory layout and fragmentation of the
first page. Eliminating a situation in messages.js where this CL has had
an effect on map transitions seems to solve the issue.

R=verwaest@chromium.org

Review URL: https://codereview.chromium.org/714883003

Cr-Commit-Position: refs/heads/master@{#25266}
git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@25266 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-11-11 15:41:30 +00:00
marja@chromium.org
1bb79539f3 Scanner: remove PushBack calls when we're going to return ILLEGAL.
This simplifies escape handling and makes it easier to extend escapes for ES6.

PushBack just before detecting ILLEGAL is unnecessary, since we will abort the
scanning / parsing anyway at that point, and it doesn't matter where the cursor
exactly is. The error messages w/ PushBack are not any better or more correct
than without.

In addition: remove a comment about handling invalid escapes gracefully when we
no longer do. (*)

This CL includes a behavioral change: For input "var r = /foobar/g\urrrr;" we
used to report "unexpected_token: ILLEGAL" for "\u", but now we report
malformed_regexp_flags which is a more correct error message. (Note that the
code for reporting invalid_regexp_flags was dead, and invalid_regexp_flags is
not the right error message.)

Note that the V8 is more relaxed about unicode escapes in regexp flags than ES6
(see
http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regular-expressions )
and this CL doesn't change it. (V8 accepts any \uxxxx, ES6 spec says only a
certain value range is acceptable.)

(*) Code archaeology:

Originally, doing PushBack in ScanHexEscape made sense (see e.g., here
https://codereview.chromium.org/5063003/diff/6001/src/prescanner.h ), since we
wouldn't return ILLEGAL but treat an invalid escape sequence "\uxxxx" as
"uxxxx".

(The repo at that point contains another instance of the same function, from the
initial commit. The logic is the same.)

This behavior was changed in a "renaming" commit
https://codereview.chromium.org/7739020.

BUG=
R=rossberg@chromium.org

Review URL: https://codereview.chromium.org/684873002

Cr-Commit-Position: refs/heads/master@{#25031}
git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@25031 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-10-31 13:03:45 +00:00
yangguo@chromium.org
0e830ad0bb Do not embed array objects in unoptimized code.
R=verwaest@chromium.org

Review URL: https://codereview.chromium.org/685393002

Cr-Commit-Position: refs/heads/master@{#25019}
git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@25019 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-10-30 14:21:43 +00:00
arv@chromium.org
a13e2298e2 Allow duplicate property names in classes
ES6 no longer makes duplicate properties an error. However, we
continue to treat duplicate properties in strict mode object
literals as errors. With this change we allow duplicate properties
in class bodies. We continue to flag duplicate constructors as an
error as required by ES6.

BUG=v8:3570
LOG=Y
R=marja@chromium.org

Review URL: https://codereview.chromium.org/677953004

Cr-Commit-Position: refs/heads/master@{#24933}
git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24933 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-10-28 12:23:40 +00:00
dslomov@chromium.org
37bd114925 Update ObjectToString to Harmony-draft algorithm
Updates Object.prototype.toString() to use algorithm described in harmony drafts.

Currently, the behaviour is essentially the same as ES262's version, however this changes when internal structures
such as Promise make use of symbolToStringTag (as they are supposed to, see v8:3241), and changes further once
Symbol.toStringTag is exposed publicly.

BUG=v8:3241, v8:3502
LOG=N
R=dslomov@chromium.org

Review URL: https://codereview.chromium.org/546803003

Patch from Caitlin Potter <caitpotter88@gmail.com>.

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24783 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-10-21 17:21:32 +00:00