OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 assertSame(isStrict ? null : global_object, receiver) | 113 assertSame(isStrict ? null : global_object, receiver) |
114 receiver = 333 | 114 receiver = 333 |
115 assertEquals(42, %Apply(f, o, [11, 31], 0, 2)) | 115 assertEquals(42, %Apply(f, o, [11, 31], 0, 2)) |
116 assertSame(o, receiver) | 116 assertSame(o, receiver) |
117 receiver = 333 | 117 receiver = 333 |
118 assertEquals(42, %Apply(f, null, [11, 31], 0, 2)) | 118 assertEquals(42, %Apply(f, null, [11, 31], 0, 2)) |
119 assertSame(isStrict ? null : global_object, receiver) | 119 assertSame(isStrict ? null : global_object, receiver) |
120 receiver = 333 | 120 receiver = 333 |
121 assertEquals(42, %_CallFunction(o, 11, 31, f)) | 121 assertEquals(42, %_CallFunction(o, 11, 31, f)) |
122 assertSame(o, receiver) | 122 assertSame(o, receiver) |
123 receiver = 333 | |
124 assertEquals(42, %_CallFunction(null, 11, 31, f)) | |
125 assertSame(isStrict ? null : global_object, receiver) | |
126 | 123 |
127 var ff = Function.prototype.bind.call(f, o, 12) | 124 var ff = Function.prototype.bind.call(f, o, 12) |
128 assertTrue(ff.length <= 1) // TODO(rossberg): Not spec'ed yet, be lax. | 125 assertTrue(ff.length <= 1) // TODO(rossberg): Not spec'ed yet, be lax. |
129 receiver = 333 | 126 receiver = 333 |
130 assertEquals(42, ff(30)) | 127 assertEquals(42, ff(30)) |
131 assertSame(o, receiver) | 128 assertSame(o, receiver) |
132 receiver = 333 | 129 receiver = 333 |
133 assertEquals(33, Function.prototype.call.call(ff, {}, 21)) | 130 assertEquals(33, Function.prototype.call.call(ff, {}, 21)) |
134 assertSame(o, receiver) | 131 assertSame(o, receiver) |
135 receiver = 333 | 132 receiver = 333 |
(...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
765 with (this) { | 762 with (this) { |
766 assertEquals(this, fp()); | 763 assertEquals(this, fp()); |
767 assertEquals(this, gp()); | 764 assertEquals(this, gp()); |
768 } | 765 } |
769 | 766 |
770 with ({}) { | 767 with ({}) { |
771 assertEquals(Realm.shared.fg, fp()); | 768 assertEquals(Realm.shared.fg, fp()); |
772 assertEquals(Realm.shared.gg, gp()); | 769 assertEquals(Realm.shared.gg, gp()); |
773 } | 770 } |
774 } | 771 } |
OLD | NEW |