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..6b84c3a6b4fe6ea20d8b6da633c69ba296ca45c2 100644 |
--- a/test/mjsunit/harmony/arrow-functions.js |
+++ b/test/mjsunit/harmony/arrow-functions.js |
@@ -47,3 +47,26 @@ var fives = []; |
if (v % 5 === 0) fives.push(v); |
}); |
assertEquals([5, 10], fives); |
+ |
+(function testRestrictedFunctionPropertiesStrict() { |
+ var arrowFn = () => { "use strict"; }; |
+ assertFalse(arrowFn.hasOwnProperty("arguments")); |
+ assertThrows(function() { return arrowFn.arguments; }, TypeError); |
+ assertThrows(function() { arrowFn.arguments = {}; }, TypeError); |
+ |
+ assertFalse(arrowFn.hasOwnProperty("caller")); |
+ assertThrows(function() { return arrowFn.caller; }, TypeError); |
+ assertThrows(function() { arrowFn.caller = {}; }, TypeError); |
+})(); |
+ |
+ |
+(function testRestrictedFunctionPropertiesSloppy() { |
+ var arrowFn = () => {}; |
+ assertFalse(arrowFn.hasOwnProperty("arguments")); |
+ assertThrows(function() { return arrowFn.arguments; }, TypeError); |
+ assertThrows(function() { arrowFn.arguments = {}; }, TypeError); |
+ |
+ assertFalse(arrowFn.hasOwnProperty("caller")); |
+ assertThrows(function() { return arrowFn.caller; }, TypeError); |
+ assertThrows(function() { arrowFn.caller = {}; }, TypeError); |
+})(); |