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

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: Rebase 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
« no previous file with comments | « test/mjsunit/harmony/computed-property-names-classes.js ('k') | test/mjsunit/strict-mode.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..535231ea62f3bf642074eba74c516d48ea2626aa 100644
--- a/test/mjsunit/harmony/object-literals-method.js
+++ b/test/mjsunit/harmony/object-literals-method.js
@@ -104,6 +104,34 @@
})();
+(function TestNoRestrictedPropertiesStrict() {
+ var obj = {
+ method() { "use strict"; }
+ };
+ assertFalse(obj.method.hasOwnProperty("arguments"));
+ assertThrows(function() { return obj.method.arguments; }, TypeError);
+ assertThrows(function() { obj.method.arguments = {}; }, TypeError);
+
+ assertFalse(obj.method.hasOwnProperty("caller"));
+ assertThrows(function() { return obj.method.caller; }, TypeError);
+ assertThrows(function() { obj.method.caller = {}; }, TypeError);
+})();
+
+
+(function TestNoRestrictedPropertiesSloppy() {
+ var obj = {
+ method() {}
+ };
+ assertFalse(obj.method.hasOwnProperty("arguments"));
+ assertThrows(function() { return obj.method.arguments; }, TypeError);
+ assertThrows(function() { obj.method.arguments = {}; }, TypeError);
+
+ assertFalse(obj.method.hasOwnProperty("caller"));
+ assertThrows(function() { return obj.method.caller; }, TypeError);
+ assertThrows(function() { obj.method.caller = {}; }, TypeError);
+})();
+
+
(function TestToString() {
var object = {
method() { 42; }
« no previous file with comments | « test/mjsunit/harmony/computed-property-names-classes.js ('k') | test/mjsunit/strict-mode.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698