| 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-proxies --harmony-reflect | |
| 6 | |
| 7 // Tests the interaction of Function.prototype.bind with proxies. | 5 // Tests the interaction of Function.prototype.bind with proxies. |
| 8 | 6 |
| 9 | 7 |
| 10 // (Helper) | 8 // (Helper) |
| 11 | 9 |
| 12 var log = []; | 10 var log = []; |
| 13 var logger = {}; | 11 var logger = {}; |
| 14 var handler = new Proxy({}, logger); | 12 var handler = new Proxy({}, logger); |
| 15 | 13 |
| 16 logger.get = function(t, trap, r) { | 14 logger.get = function(t, trap, r) { |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 | 126 |
| 129 assertThrows(() => Function.prototype.bind.call(new Proxy({}, {})), TypeError); | 127 assertThrows(() => Function.prototype.bind.call(new Proxy({}, {})), TypeError); |
| 130 assertThrows(() => Function.prototype.bind.call(new Proxy([], {})), TypeError); | 128 assertThrows(() => Function.prototype.bind.call(new Proxy([], {})), TypeError); |
| 131 | 129 |
| 132 | 130 |
| 133 // Non-constructable | 131 // Non-constructable |
| 134 | 132 |
| 135 result = Function.prototype.bind.call(() => 42, this_value, "foo"); | 133 result = Function.prototype.bind.call(() => 42, this_value, "foo"); |
| 136 assertEquals(42, result()); | 134 assertEquals(42, result()); |
| 137 assertThrows(() => new result()); | 135 assertThrows(() => new result()); |
| OLD | NEW |