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

Unified Diff: test/mjsunit/harmony/object-literals-method.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/object-literals-method.js
diff --git a/test/mjsunit/harmony/object-literals-method.js b/test/mjsunit/harmony/object-literals-method.js
index 605e269fcb08f4f72d08e732200c2192a1ca508f..3a3673b365b9c10bbc7e6c8ceaf211bce89ec7b7 100644
--- a/test/mjsunit/harmony/object-literals-method.js
+++ b/test/mjsunit/harmony/object-literals-method.js
@@ -104,6 +104,30 @@
})();
+(function TestNoRestrictedPropertiesStrict() {
+ var obj = {
+ method() { "use strict"; }
+ };
+ assertEquals(false, obj.method.hasOwnProperty("arguments"));
+ assertEquals(null, obj.method.arguments);
+
+ assertEquals(false, obj.method.hasOwnProperty("caller"));
+ assertEquals(null, obj.method.caller);
+})();
+
+
+(function TestNoRestrictedPropertiesSloppy() {
+ var obj = {
+ method() {}
+ };
+ assertEquals(false, obj.method.hasOwnProperty("arguments"));
+ assertEquals(null, obj.method.arguments);
+
+ assertEquals(false, obj.method.hasOwnProperty("caller"));
+ assertEquals(null, obj.method.caller);
+})();
+
+
(function TestToString() {
var object = {
method() { 42; }
« test/mjsunit/harmony/classes.js ('K') | « test/mjsunit/harmony/computed-property-names-classes.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698