Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(121)

Unified Diff: test/webkit/fast/js/basic-strict-mode.js

Issue 1027283004: [es6] do not add caller/arguments to ES6 function definitions (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase + test262 exceptions Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: test/webkit/fast/js/basic-strict-mode.js
diff --git a/test/webkit/fast/js/basic-strict-mode.js b/test/webkit/fast/js/basic-strict-mode.js
index f34b14e7ae4d66cf7a00d9c4e920775190a7713c..1687b2e5e7830094bfd0b21f96b8f35c993bf833 100644
--- a/test/webkit/fast/js/basic-strict-mode.js
+++ b/test/webkit/fast/js/basic-strict-mode.js
@@ -109,11 +109,13 @@ shouldThrow("(function f(arg){'use strict'; f.caller; })()");
shouldThrow("(function f(arg){'use strict'; f.arguments=5; })()");
shouldThrow("(function f(arg){'use strict'; f.caller=5; })()");
-// arguments/caller poisoning should be visible but not throw with 'in' & 'hasOwnProperty'.
+// arguments/caller poisoning should be visible on the intrinsic %FunctionPrototype%, but not throw with 'in' & 'hasOwnProperty'.
shouldBeTrue('"caller" in function(){"use strict"}');
-shouldBeTrue('(function(){"use strict";}).hasOwnProperty("caller")');
+shouldBeFalse('(function(){"use strict";}).hasOwnProperty("caller")');
+shouldBeTrue('(function(){"use strict";}).__proto__.hasOwnProperty("caller")');
shouldBeTrue('"arguments" in function(){"use strict"}');
-shouldBeTrue('(function(){"use strict";}).hasOwnProperty("arguments")');
+shouldBeFalse('(function(){"use strict";}).hasOwnProperty("arguments")');
+shouldBeTrue('(function(){"use strict";}).__proto__.hasOwnProperty("arguments")');
shouldBeSyntaxError("'use strict'; (function (){with(1){};})");
shouldBeSyntaxError("'use strict'; (function (){var a; delete a;})");
@@ -194,14 +196,14 @@ shouldBeTrue("(function (){'use strict'; var local; (function (){local;})(); ar
shouldBeTrue("'use strict'; (function (){var a = true; eval('var a = false'); return a; })()");
shouldBeTrue("(function (){var a = true; eval('\"use strict\"; var a = false'); return a; })()");
-shouldBeUndefined("(function f(arg){'use strict'; return Object.getOwnPropertyDescriptor(f, 'arguments').value; })()");
-shouldBeUndefined("(function f(arg){'use strict'; return Object.getOwnPropertyDescriptor(f, 'caller').value; })()");
+shouldBeUndefined("(function f(arg){'use strict'; return Object.getOwnPropertyDescriptor(f.__proto__, 'arguments').value; })()");
+shouldBeUndefined("(function f(arg){'use strict'; return Object.getOwnPropertyDescriptor(f.__proto__, 'caller').value; })()");
shouldBeUndefined("(function f(arg){'use strict'; return Object.getOwnPropertyDescriptor(arguments, 'callee').value; })()");
shouldBeUndefined("(function f(arg){'use strict'; return Object.getOwnPropertyDescriptor(arguments, 'caller').value; })()");
shouldBeTrue("(function f(arg){'use strict'; var descriptor = Object.getOwnPropertyDescriptor(arguments, 'caller'); return descriptor.get === descriptor.set; })()");
shouldBeTrue("(function f(arg){'use strict'; var descriptor = Object.getOwnPropertyDescriptor(arguments, 'callee'); return descriptor.get === descriptor.set; })()");
-shouldBeTrue("(function f(arg){'use strict'; var descriptor = Object.getOwnPropertyDescriptor(f, 'caller'); return descriptor.get === descriptor.set; })()");
-shouldBeTrue("(function f(arg){'use strict'; var descriptor = Object.getOwnPropertyDescriptor(f, 'arguments'); return descriptor.get === descriptor.set; })()");
+shouldBeTrue("(function f(arg){'use strict'; var descriptor = Object.getOwnPropertyDescriptor(f.__proto__, 'caller'); return descriptor.get === descriptor.set; })()");
+shouldBeTrue("(function f(arg){'use strict'; var descriptor = Object.getOwnPropertyDescriptor(f.__proto__, 'arguments'); return descriptor.get === descriptor.set; })()");
shouldBeTrue("'use strict'; (function f() { for(var i in this); })(); true;")
shouldBeSyntaxError("'use strict'\u033b");
@@ -228,4 +230,4 @@ aGlobal = false;
shouldBeTrue("(function () {try { throw 1; } catch (e) { aGlobal = true; }})(); aGlobal;");
// Make sure this doesn't crash!
-shouldBe('String(Object.getOwnPropertyDescriptor(function() { "use strict"; }, "caller").get)', "'function () {\\n [native code]\\n}'");
+shouldBe('String(Object.getOwnPropertyDescriptor((function() { "use strict"; }).__proto__, "caller").get)', "'function () {\\n [native code]\\n}'");

Powered by Google App Engine
This is Rietveld 408576698