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

Unified Diff: test/mjsunit/harmony/arrow-functions.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: Remove unneeded bits Created 5 years, 9 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/mjsunit/harmony/arrow-functions.js
diff --git a/test/mjsunit/harmony/arrow-functions.js b/test/mjsunit/harmony/arrow-functions.js
index 0ffa9369919aa8b83bd88ebf6cbb57eea373eea3..dc9424b070625f45f52d222e2edc5b2a7a1580a3 100644
--- a/test/mjsunit/harmony/arrow-functions.js
+++ b/test/mjsunit/harmony/arrow-functions.js
@@ -47,3 +47,21 @@ var fives = [];
if (v % 5 === 0) fives.push(v);
});
assertEquals([5, 10], fives);
+
+(function testRestrictedFunctionPropertiesStrict() {
+ "use strict";
+ assertEquals(false, (() => {}).hasOwnProperty("arguments"));
+ assertEquals(null, (() => {}).arguments);
+
+ assertEquals(false, (() => {}).hasOwnProperty("caller"));
+ assertEquals(null, (() => {}).caller);
+})();
+
+
+(function testRestrictedFunctionPropertiesSloppy() {
+ assertEquals(false, (() => {}).hasOwnProperty("arguments"));
+ assertEquals(null, (() => {}).arguments);
+
+ assertEquals(false, (() => {}).hasOwnProperty("caller"));
+ assertEquals(null, (() => {}).caller);
+})();

Powered by Google App Engine
This is Rietveld 408576698