OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 var err_str_1 = "apply was called on , which is a object and not a function"; |
| 6 var err_str_2 = |
| 7 "apply was called on Error, which is a object and not a function"; |
| 8 |
| 9 var reached = false; |
| 10 var error = new Error(); |
| 11 error.name = error; |
| 12 try { |
| 13 Reflect.apply(error); |
| 14 reached = true; |
| 15 } catch (e) { |
| 16 assertTrue(e.stack.indexOf(err_str_1) != -1); |
| 17 } finally { |
| 18 assertFalse(reached); |
| 19 } |
| 20 |
| 21 reached = false; |
| 22 error = new Error(); |
| 23 error.msg = error; |
| 24 try { |
| 25 Reflect.apply(error); |
| 26 reached = true; |
| 27 } catch (e) { |
| 28 assertTrue(e.stack.indexOf(err_str_2) != -1); |
| 29 } finally { |
| 30 assertFalse(reached); |
| 31 } |
| 32 |
| 33 reached = false; |
| 34 error = new Error(); |
| 35 error.name = error; |
| 36 error.msg = error; |
| 37 try { |
| 38 Reflect.apply(error); |
| 39 reached = true; |
| 40 } catch (e) { |
| 41 assertTrue(e.stack.indexOf(err_str_1) != -1); |
| 42 } finally { |
| 43 assertFalse(reached); |
| 44 } |
OLD | NEW |