| 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; }
|
|
|