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