[INFER] Don't analyze types in compileAndGo scripts with a cleared global, bug 619433.

This commit is contained in:
Brian Hackett
2011-05-12 17:59:28 -07:00
parent 4b3b560694
commit 7328c54dd1
7 changed files with 36 additions and 28 deletions

View File

@@ -3320,7 +3320,7 @@ array_TypeConcat(JSContext *cx, JSTypeFunction *jsfun, JSTypeCallsite *jssite)
{
TypeCallsite *site = Valueify(jssite);
if (!site->compileAndGo()) {
if (!site->hasGlobal()) {
if (site->returnTypes)
site->returnTypes->addType(cx, TYPE_UNKNOWN);
return;
@@ -3376,7 +3376,7 @@ array_TypeExtra(JSContext *cx, JSTypeFunction *jsfun, JSTypeCallsite *jssite,
case MAP:
case FILTER:
if (site->compileAndGo()) {
if (site->hasGlobal()) {
/* Makes a new array whose element type will be filled in as the code runs. */
TypeObject *object = site->getInitObject(cx, true);
if (!object)
@@ -3527,7 +3527,7 @@ array_TypeNew(JSContext *cx, JSTypeFunction *jsfun, JSTypeCallsite *jssite)
{
TypeCallsite *site = Valueify(jssite);
if (!site->compileAndGo()) {
if (!site->hasGlobal()) {
if (site->returnTypes)
site->returnTypes->addType(cx, TYPE_UNKNOWN);
return;