Classes: Expand test to cover strict runtime behavior
authorarv <arv@chromium.org>
Tue, 18 Nov 2014 19:00:08 +0000 (11:00 -0800)
committerCommit bot <commit-bot@chromium.org>
Tue, 18 Nov 2014 19:00:15 +0000 (19:00 +0000)
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}

test/mjsunit/harmony/classes.js

index 4efdaa1..c8c25ff 100644 (file)
   assertThrows('class C extends function B() { with ({}); return B; }() {}',
                SyntaxError);
 
+  var D = class extends function() {
+    arguments.caller;
+  } {};
+  assertThrows(function() {
+    Object.getPrototypeOf(D).arguments;
+  }, TypeError);
+  assertThrows(function() {
+    new D;
+  }, TypeError);
 })();