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