Bug 1254105 - Avoid passing magic values to the error reporter machinery in the ShortestPaths testing function; r=jimb

The error reporting machinery will try and stringify any value you pass it, and
stringifying asserts that we don't pass magic values. Easiest solution is to
just hard code the error message, since this is a testing-only function.

--HG--
extra : rebase_source : d096a2cd2f697533279c5b33cbe5de3c5a2513a9
This commit is contained in:
Nick Fitzgerald 2016-03-08 16:33:00 +01:00
parent f179579502
commit 8cdfc57103
2 changed files with 4 additions and 3 deletions

View File

@ -2628,9 +2628,7 @@ ShortestPaths(JSContext* cx, unsigned argc, Value* vp)
for (size_t i = 0; i < length; i++) {
RootedValue el(cx, objs->getDenseElement(i));
if (!el.isObject() && !el.isString() && !el.isSymbol()) {
ReportValueErrorFlags(cx, JSREPORT_ERROR, JSMSG_UNEXPECTED_TYPE,
JSDVG_SEARCH_STACK, el, nullptr,
"not an object, string, or symbol", nullptr);
JS_ReportError(cx, "Each target must be an object, string, or symbol");
return false;
}
}

View File

@ -0,0 +1,3 @@
// |jit-test| error:Error: Each target must be an object, string, or symbol
shortestPaths(this, [, , , undefined], 5)