OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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: --allow-natives-syntax --harmony-tailcalls --harmony-proxies | 5 // Flags: --allow-natives-syntax --harmony-tailcalls |
6 "use strict"; | 6 "use strict"; |
7 | 7 |
8 Error.prepareStackTrace = (e,s) => s; | 8 Error.prepareStackTrace = (e,s) => s; |
9 | 9 |
10 function CheckStackTrace(expected) { | 10 function CheckStackTrace(expected) { |
11 var stack = (new Error()).stack; | 11 var stack = (new Error()).stack; |
12 assertEquals("CheckStackTrace", stack[0].getFunctionName()); | 12 assertEquals("CheckStackTrace", stack[0].getFunctionName()); |
13 for (var i = 0; i < expected.length; i++) { | 13 for (var i = 0; i < expected.length; i++) { |
14 assertEquals(expected[i].name, stack[i + 1].getFunctionName()); | 14 assertEquals(expected[i].name, stack[i + 1].getFunctionName()); |
15 } | 15 } |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 | 88 |
89 // Callee has arguments adaptor frame. | 89 // Callee has arguments adaptor frame. |
90 function f4(a, b, c) { | 90 function f4(a, b, c) { |
91 CheckStackTrace([f4, test]); | 91 CheckStackTrace([f4, test]); |
92 return 10 + a; | 92 return 10 + a; |
93 } | 93 } |
94 var p4 = new Proxy(f4, {}); | 94 var p4 = new Proxy(f4, {}); |
95 function g4(a) { return p4(2); } | 95 function g4(a) { return p4(2); } |
96 assertEquals(12, g4()); | 96 assertEquals(12, g4()); |
97 })(); | 97 })(); |
OLD | NEW |