Commit Graph

17 Commits

Author SHA1 Message Date
dslomov
573401a422 harmony-classes: Fix some issues with syntactic restriction on super(...).
R=arv@chromium.org
BUG=v8:3330
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#25589}
2014-12-01 20:13:54 +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
dslomov
6ac4de87a8 harmony-scoping: make assignment to 'const' a late error.
Per TC39 Nov 2014 decision.

This patch also changes behavior for "legacy const": assignments to sloppy const in strict mode is now also a type error. This fixes v8:2243 and also brings us in compliance with other engines re assignment to function names (see updated webkit test), but might have bigger implications.
That change can easily be reverted by changing Variable::IsSignallingAssignmentToConst.

BUG=v8:3713,v8:2243
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#25516}
2014-11-26 11:21:23 +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
arv
d5d15253b8 Classes: Expand test to cover strict runtime behavior
This tests that the extends expression is treated as strict at
runtime and not just at parse time.

BUG=v8:3330
LOG=Y
R=dslomov@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#25407}
2014-11-18 19:00:15 +00:00
arv
f3d5b13e04 Classes: Implement correct name binding
Named class declarations and class expression have a const binding for
the name that is in TDZ for the extends expression.

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

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

Cr-Commit-Position: refs/heads/master@{#25360}
2014-11-14 15:05:20 +00:00
arv@chromium.org
aa6815c79a Classes: Add support for arguments in default constructor
This is currently done by generating a default constructor that looks
like this:

  constructor() {
    %DefaultConstructorSuperCall();
  }

The a runtime function implements the logic which is pretty similar to
Runtime_Apply except that it uses the [[Prototype]] of the current
function.

This is the second try. The first failed because the test was using a
array that was too large for Function.prototype.apply.

Revert "Revert "Classes: Add support for arguments in default constructor""

This reverts commit 43aa7e541df56a132608b8b4217e9da84575e4f8.

BUG=v8:3672
LOG=Y
TBR=dslomov@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#25272}
git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@25272 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-11-11 21:36:16 +00:00
arv@chromium.org
6a5cd94676 Revert "Classes: Add support for arguments in default constructor"
This reverts commit 3f4ea6c91a962a04407c79f08e5c86ce9ff2911a.

Broke tests on Mac64

http://build.chromium.org/p/client.v8/builders/V8%20Mac64/builds/923/steps/Check/logs/classes

BUG=v8:3672
TBR=dslomov@chromium.org
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#25269}
git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@25269 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-11-11 16:22:47 +00:00
arv@chromium.org
3a91adaec8 Classes: Add support for arguments in default constructor
This is currently done by generating a default constructor that looks
like this:

  constructor() {
    %DefaultConstructorSuperCall();
  }

The a runtime function implements the logic which is pretty similar to
Runtime_Apply except that it uses the [[Prototype]] of the current
function.

BUG=v8:3672
LOG=Y
R=dslomov@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#25268}
git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@25268 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-11-11 15:55:30 +00:00
arv@chromium.org
b86c30a2b3 Classes: Partial fix for constructor not calling super
Introduce two new function kind, one for default constructor and one
for default constructor call super. Then when we are about to pares
these we just generate the correct AST in source.

BUG=v8:3661, v8:3672
LOG=Y
R=dslomov@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#25222}
git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@25222 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-11-07 16:39:27 +00:00
rossberg@chromium.org
0b9a70ade3 Remove --harmony implications for incomplete features
This is in preparation for making --harmony and --es-staging synonyms.
The only remaining difference currently is block-scoping, which is still
implied by --harmony, to avoid regressing on a long-available feature.

Also removes the special-casing of --harmony-proxies.

R=adamk@chromium.org
BUG=

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

Cr-Commit-Position: refs/heads/master@{#25115}
git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@25115 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-11-04 16:05:44 +00:00
arv@chromium.org
5b3f9ec76d Classes: Add super support in methods and accessors
This is done by installing the [[HomeObject]] on the method and the
accessor functions.

BUG=v8:3330
LOG=Y
R=dslomov@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#24976}
git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24976 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-10-29 11:46:18 +00:00
arv@chromium.org
013a29a2bc Classes: Add more tests for prototype edge cases
BUG=3655
LOG=Y
R=dslomov@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#24943}
git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24943 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-10-28 14:12:44 +00:00
arv@chromium.org
5c2dffc380 Classes: Add test for method prototype
Methods should not have a prototype property

BUG=v8:3330
LOG=y
R=dslomov@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#24939}
git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24939 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-10-28 13:40:14 +00:00
arv@chromium.org
1881cee691 Classes: Add basic support for properties
This adds the properties to the prototype and the constructor.

BUG=v8:3330
LOG=Y
R=dslomov@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#24934}
git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24934 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-10-28 12:43:49 +00:00
arv@chromium.org
c8b1c3e784 Classes: Add support for toString
BUG=v8:3330
LOG=Y
R=dslomov@chromium.org

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

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24472 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-10-08 14:48:48 +00:00
arv@chromium.org
583868288a This uses a runtime function to set up the the constructor and its
prototype.

This does not add the methods/accessors to the prototype or the
constructor.

BUG=v8:3330
LOG=Y
R=dslomov@chromium.org

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

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24442 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-10-07 16:24:59 +00:00