printStackTrace in doassert in JS land
This commit is contained in:
@@ -21,11 +21,20 @@ const StringData _jscode_raw_utils =
|
||||
"return false;\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
"printStackTrace = function(){\n"
|
||||
"try{\n"
|
||||
"throw new Error(\"Printing Stack Trace (lines are 0-based in spidermonkey)\");\n"
|
||||
"} catch (e) {\n"
|
||||
"print(e.stack);\n"
|
||||
"}\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
"doassert = function (msg) {\n"
|
||||
"if (msg.indexOf(\"assert\") == 0)\n"
|
||||
"print(msg);\n"
|
||||
"else\n"
|
||||
"print(\"assert: \" + msg);\n"
|
||||
"printStackTrace();\n"
|
||||
"throw msg;\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
|
||||
Reference in New Issue
Block a user