summaryrefslogtreecommitdiffstats
path: root/js/src/vm/TypeInference.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/vm/TypeInference.cpp')
-rw-r--r--js/src/vm/TypeInference.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/js/src/vm/TypeInference.cpp b/js/src/vm/TypeInference.cpp
index 60d9e183a..7c2c0194e 100644
--- a/js/src/vm/TypeInference.cpp
+++ b/js/src/vm/TypeInference.cpp
@@ -2945,7 +2945,8 @@ ObjectGroup::clearNewScript(ExclusiveContext* cx, ObjectGroup* replacement /* =
// Mark the constructing function as having its 'new' script cleared, so we
// will not try to construct another one later.
- if (!newScript->function()->setNewScriptCleared(cx))
+ RootedFunction fun(cx, newScript->function());
+ if (!JSObject::setNewScriptCleared(cx, fun))
cx->recoverFromOutOfMemory();
}