OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 // Flags: --harmony-object-literals |
| 6 |
| 7 (function TestSloppyMode() { |
| 8 var o = { |
| 9 eval() { |
| 10 return 1; |
| 11 }, |
| 12 arguments() { |
| 13 return 2; |
| 14 }, |
| 15 }; |
| 16 |
| 17 assertEquals(1, o.eval()); |
| 18 assertEquals(2, o.arguments()); |
| 19 })(); |
| 20 |
| 21 (function TestStrictMode() { |
| 22 'use strict'; |
| 23 |
| 24 var o = { |
| 25 eval() { |
| 26 return 1; |
| 27 }, |
| 28 arguments() { |
| 29 return 2; |
| 30 }, |
| 31 }; |
| 32 |
| 33 assertEquals(1, o.eval()); |
| 34 assertEquals(2, o.arguments()); |
| 35 })(); |
OLD | NEW |