Bug 1359653: Part 4 - Fallback to the default JS version when decoding regexps off-thread. r=shu

When decoding off-thread, we can't safely access the JS runtime to get the
current JS version, and doing so causes failed assertions.

MozReview-Commit-ID: Lra437aa8SM

--HG--
extra : source : 16259c1af36e138881d18a3f8b0a803f5d4fc3ec
This commit is contained in:
Kris Maglione 2017-04-28 11:55:52 -07:00
parent 7d8720d597
commit d33959634b

View File

@ -1449,6 +1449,9 @@ JSContext::findVersion()
if (compartment() && compartment()->behaviors().version() != JSVERSION_UNKNOWN)
return compartment()->behaviors().version();
if (!CurrentThreadCanAccessRuntime(runtime()))
return JSVERSION_DEFAULT;
return runtime()->defaultVersion();
}