OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 throwing(); | 257 throwing(); |
258 reached = true; | 258 reached = true; |
259 } catch (e) { | 259 } catch (e) { |
260 assertTrue(e.stack.indexOf(omitted) < 0, omitted); | 260 assertTrue(e.stack.indexOf(omitted) < 0, omitted); |
261 } finally { | 261 } finally { |
262 assertFalse(reached); | 262 assertFalse(reached); |
263 } | 263 } |
264 } | 264 } |
265 | 265 |
266 | 266 |
267 testTrace("testArrayNative", testArrayNative, ["Array.map (native)"]); | 267 testTrace("testArrayNative", testArrayNative, ["Array.map"]); |
268 testTrace("testNested", testNested, ["at one", "at two", "at three"]); | 268 testTrace("testNested", testNested, ["at one", "at two", "at three"]); |
269 testTrace("testMethodNameInference", testMethodNameInference, ["at Foo.bar"]); | 269 testTrace("testMethodNameInference", testMethodNameInference, ["at Foo.bar"]); |
270 testTrace("testImplicitConversion", testImplicitConversion, ["at Nirk.valueOf"])
; | 270 testTrace("testImplicitConversion", testImplicitConversion, ["at Nirk.valueOf"])
; |
271 testTrace("testEval", testEval, ["at Doo (eval at testEval"]); | 271 testTrace("testEval", testEval, ["at Doo (eval at testEval"]); |
272 testTrace("testNestedEval", testNestedEval, ["eval at Inner (eval at Outer"]); | 272 testTrace("testNestedEval", testNestedEval, ["eval at Inner (eval at Outer"]); |
273 testTrace("testEvalWithSourceURL", testEvalWithSourceURL, | 273 testTrace("testEvalWithSourceURL", testEvalWithSourceURL, |
274 [ "at Doo (res://name:1:18)" ]); | 274 [ "at Doo (res://name:1:18)" ]); |
275 testTrace("testNestedEvalWithSourceURL", testNestedEvalWithSourceURL, | 275 testTrace("testNestedEvalWithSourceURL", testNestedEvalWithSourceURL, |
276 [" at Inner (res://inner-eval:1:20)", | 276 [" at Inner (res://inner-eval:1:20)", |
277 " at Outer (res://outer-eval:1:37)"]); | 277 " at Outer (res://outer-eval:1:37)"]); |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
430 assertTrue(err.stack.indexOf("prepareStackTrace") != -1); | 430 assertTrue(err.stack.indexOf("prepareStackTrace") != -1); |
431 | 431 |
432 // Check that the callsite constructor throws. | 432 // Check that the callsite constructor throws. |
433 | 433 |
434 Error.prepareStackTrace = (e,s) => s; | 434 Error.prepareStackTrace = (e,s) => s; |
435 var constructor = new Error().stack[0].constructor; | 435 var constructor = new Error().stack[0].constructor; |
436 | 436 |
437 assertThrows(() => constructor.call()); | 437 assertThrows(() => constructor.call()); |
438 assertThrows(() => constructor.call( | 438 assertThrows(() => constructor.call( |
439 null, {}, () => undefined, {valueOf() { return 0 }}, false)); | 439 null, {}, () => undefined, {valueOf() { return 0 }}, false)); |
OLD | NEW |