Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: test/mjsunit/regress/regress-5173.js

Issue 2125163004: Correctly format builtin constructors in stack traces (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@20160704-string-number-builtins
Patch Set: Rebase Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/runtime/runtime-function.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 var thrower = { [Symbol.toPrimitive]: () => FAIL }; 5 var thrower = { [Symbol.toPrimitive]: () => FAIL };
6 6
7 // Tests that a native conversion function is included in the 7 // Tests that a native conversion function is included in the
8 // stack trace. 8 // stack trace.
9 function testTraceNativeConversion(nativeFunc) { 9 function testTraceNativeConversion(nativeFunc) {
10 var nativeFuncName = nativeFunc.name; 10 var nativeFuncName = nativeFunc.name;
(...skipping 15 matching lines...) Expand all
26 } catch (e) { 26 } catch (e) {
27 assertTrue(e.stack.indexOf(expectedString) >= 0, expectedString); 27 assertTrue(e.stack.indexOf(expectedString) >= 0, expectedString);
28 } 28 }
29 } 29 }
30 30
31 testBuiltinInStackTrace("Date.prototype.getDate.call('')", "at String.getDate"); 31 testBuiltinInStackTrace("Date.prototype.getDate.call('')", "at String.getDate");
32 testBuiltinInStackTrace("Date.prototype.getUTCDate.call('')", 32 testBuiltinInStackTrace("Date.prototype.getUTCDate.call('')",
33 "at String.getUTCDate"); 33 "at String.getUTCDate");
34 testBuiltinInStackTrace("Date.prototype.getTime.call('')", "at String.getTime"); 34 testBuiltinInStackTrace("Date.prototype.getTime.call('')", "at String.getTime");
35 35
36 // TODO(jgruber): These use a more generic expected string until detection of 36 testBuiltinInStackTrace("Number(thrower);", "at Number");
37 // assembly builtin constructors is fixed. 37 testBuiltinInStackTrace("new Number(thrower);", "at new Number");
38 testBuiltinInStackTrace("Number(thrower);", "Number"); 38 testBuiltinInStackTrace("String(thrower);", "at String");
39 testBuiltinInStackTrace("new Number(thrower);", "Number"); 39 testBuiltinInStackTrace("new String(thrower);", "at new String");
40 testBuiltinInStackTrace("String(thrower);", "String");
41 testBuiltinInStackTrace("new String(thrower);", "String");
42 40
43 // Ensure we correctly pick up the receiver's string tag. 41 // Ensure we correctly pick up the receiver's string tag.
44 testBuiltinInStackTrace("Math.acos(thrower);", "at Math.acos"); 42 testBuiltinInStackTrace("Math.acos(thrower);", "at Math.acos");
45 testBuiltinInStackTrace("Math.asin(thrower);", "at Math.asin"); 43 testBuiltinInStackTrace("Math.asin(thrower);", "at Math.asin");
46 testBuiltinInStackTrace("Math.fround(thrower);", "at Math.fround"); 44 testBuiltinInStackTrace("Math.fround(thrower);", "at Math.fround");
47 testBuiltinInStackTrace("Math.imul(thrower);", "at Math.imul"); 45 testBuiltinInStackTrace("Math.imul(thrower);", "at Math.imul");
48 46
49 // As above, but function passed as an argument and then called. 47 // As above, but function passed as an argument and then called.
50 testBuiltinInStackTrace("((f, x) => f(x))(Math.acos, thrower);", "at acos"); 48 testBuiltinInStackTrace("((f, x) => f(x))(Math.acos, thrower);", "at acos");
51 testBuiltinInStackTrace("((f, x) => f(x))(Math.asin, thrower);", "at asin"); 49 testBuiltinInStackTrace("((f, x) => f(x))(Math.asin, thrower);", "at asin");
52 testBuiltinInStackTrace("((f, x) => f(x))(Math.fround, thrower);", "at fround"); 50 testBuiltinInStackTrace("((f, x) => f(x))(Math.fround, thrower);", "at fround");
53 testBuiltinInStackTrace("((f, x) => f(x))(Math.imul, thrower);", "at imul"); 51 testBuiltinInStackTrace("((f, x) => f(x))(Math.imul, thrower);", "at imul");
OLDNEW
« no previous file with comments | « src/runtime/runtime-function.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698