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: --strong-mode | 5 // Flags: --strong-mode |
6 | 6 |
7 'use strong'; | 7 'use strong'; |
8 | 8 |
9 function f() {} | 9 function f() {} |
10 function* g() {} | 10 function* g() {} |
(...skipping 29 matching lines...) Expand all Loading... |
40 (function NoCallee() { | 40 (function NoCallee() { |
41 assertFalse("callee" in f); | 41 assertFalse("callee" in f); |
42 assertFalse("callee" in g); | 42 assertFalse("callee" in g); |
43 assertThrows(function(){ f.callee = 0 }, TypeError); | 43 assertThrows(function(){ f.callee = 0 }, TypeError); |
44 assertThrows(function(){ g.callee = 0 }, TypeError); | 44 assertThrows(function(){ g.callee = 0 }, TypeError); |
45 })(); | 45 })(); |
46 | 46 |
47 (function LexicalBindings(global) { | 47 (function LexicalBindings(global) { |
48 assertEquals('function', typeof f); | 48 assertEquals('function', typeof f); |
49 assertEquals('function', typeof g); | 49 assertEquals('function', typeof g); |
50 assertEquals(undefined, global.f); | 50 assertFalse(global.hasOwnProperty("f")); |
51 assertEquals(undefined, global.g); | 51 assertFalse(global.hasOwnProperty("g")); |
52 })(this); | 52 })(this); |
53 | 53 |
54 (function ImmutableBindings() { | 54 (function ImmutableBindings() { |
55 function f2() {} | 55 function f2() {} |
56 function* g2() {} | 56 function* g2() {} |
57 assertThrows(function(){ f = 0 }, TypeError); | 57 assertThrows(function(){ f = 0 }, TypeError); |
58 assertThrows(function(){ g = 0 }, TypeError); | 58 assertThrows(function(){ g = 0 }, TypeError); |
59 assertThrows(function(){ f2 = 0 }, TypeError); | 59 assertThrows(function(){ f2 = 0 }, TypeError); |
60 assertThrows(function(){ g2 = 0 }, TypeError); | 60 assertThrows(function(){ g2 = 0 }, TypeError); |
61 assertEquals('function', typeof f); | 61 assertEquals('function', typeof f); |
(...skipping 16 matching lines...) Expand all Loading... |
78 assertFalse(g.hasOwnProperty("prototype")); | 78 assertFalse(g.hasOwnProperty("prototype")); |
79 assertThrows(function(){ f.prototype = 0 }, TypeError); | 79 assertThrows(function(){ f.prototype = 0 }, TypeError); |
80 assertThrows(function(){ g.prototype = 0 }, TypeError); | 80 assertThrows(function(){ g.prototype = 0 }, TypeError); |
81 assertThrows(function(){ f.prototype.a = 0 }, TypeError); | 81 assertThrows(function(){ f.prototype.a = 0 }, TypeError); |
82 })(); | 82 })(); |
83 | 83 |
84 (function NonConstructor() { | 84 (function NonConstructor() { |
85 assertThrows(function(){ new f }, TypeError); | 85 assertThrows(function(){ new f }, TypeError); |
86 assertThrows(function(){ new g }, TypeError); | 86 assertThrows(function(){ new g }, TypeError); |
87 })(); | 87 })(); |
OLD | NEW |