Index: test/mjsunit/regress/regress-4815.js |
diff --git a/test/mjsunit/regress/regress-4815.js b/test/mjsunit/regress/regress-4815.js |
index cc0e7555edcde32985ef90b379656154ece267c9..00e61cb70a078f71e8fba7788ed702492f70095d 100644 |
--- a/test/mjsunit/regress/regress-4815.js |
+++ b/test/mjsunit/regress/regress-4815.js |
@@ -18,3 +18,21 @@ function testTraceNativeConversion(nativeFunc) { |
testTraceNativeConversion(Math.max); |
testTraceNativeConversion(Math.min); |
+ |
+function testBuiltinInStackTrace(script, nativeFuncName) { |
+ try { |
+ eval(script); |
+ assertUnreachable(nativeFuncName); |
+ } catch (e) { |
+ assertTrue(e.stack.indexOf(nativeFuncName) >= 0, nativeFuncName); |
+ } |
+} |
+ |
+// Use the full name ('String.getDate') in order to avoid false pass |
+// results when the method name is mentioned in the error message itself. |
+// This occurs, e.g., for Date.prototype.getYear, which uses a different code |
+// path and never hits the Generate_DatePrototype_GetField builtin. |
+testBuiltinInStackTrace("Date.prototype.getDate.call('')", "String.getDate"); |
+testBuiltinInStackTrace("Date.prototype.getUTCDate.call('')", |
+ "String.getUTCDate"); |
+testBuiltinInStackTrace("Date.prototype.getTime.call('')", "String.getTime"); |