OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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: --ignition-generators |
| 6 |
5 (function testRestrictedPropertiesStrict() { | 7 (function testRestrictedPropertiesStrict() { |
6 function* generator() { "use strict"; } | 8 function* generator() { "use strict"; } |
7 assertFalse(generator.hasOwnProperty("arguments")); | 9 assertFalse(generator.hasOwnProperty("arguments")); |
8 assertThrows(function() { return generator.arguments; }, TypeError); | 10 assertThrows(function() { return generator.arguments; }, TypeError); |
9 assertThrows(function() { return generator.arguments = {}; }, TypeError); | 11 assertThrows(function() { return generator.arguments = {}; }, TypeError); |
10 | 12 |
11 assertFalse(generator.hasOwnProperty("caller")); | 13 assertFalse(generator.hasOwnProperty("caller")); |
12 assertThrows(function() { return generator.caller; }, TypeError); | 14 assertThrows(function() { return generator.caller; }, TypeError); |
13 assertThrows(function() { return generator.caller = {}; }, TypeError); | 15 assertThrows(function() { return generator.caller = {}; }, TypeError); |
14 })(); | 16 })(); |
(...skipping 18 matching lines...) Expand all Loading... |
33 (function testIteratorResultStrict() { | 35 (function testIteratorResultStrict() { |
34 function* generator() { "use strict"; } | 36 function* generator() { "use strict"; } |
35 assertIteratorResult(undefined, true, generator().next()); | 37 assertIteratorResult(undefined, true, generator().next()); |
36 })(); | 38 })(); |
37 | 39 |
38 | 40 |
39 (function testIteratorResultSloppy() { | 41 (function testIteratorResultSloppy() { |
40 function* generator() {} | 42 function* generator() {} |
41 assertIteratorResult(undefined, true, generator().next()); | 43 assertIteratorResult(undefined, true, generator().next()); |
42 })(); | 44 })(); |
OLD | NEW |