From 42766ad06f7d37b507a500c8d78002d25fd804f8 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Thu, 13 Dec 2018 11:34:00 +0100 Subject: Use canonical function in TypeNewScript::rollbackPartiallyInitializedObjects. --- js/src/vm/ObjectGroup.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'js/src/vm/ObjectGroup.cpp') diff --git a/js/src/vm/ObjectGroup.cpp b/js/src/vm/ObjectGroup.cpp index d6a8fcaa4..1fbf8976b 100644 --- a/js/src/vm/ObjectGroup.cpp +++ b/js/src/vm/ObjectGroup.cpp @@ -496,12 +496,7 @@ ObjectGroup::defaultNewGroup(ExclusiveContext* cx, const Class* clasp, // Canonicalize new functions to use the original one associated with its script. JSFunction* fun = &associated->as(); - if (fun->hasScript()) - associated = fun->nonLazyScript()->functionNonDelazifying(); - else if (fun->isInterpretedLazy() && !fun->isSelfHostedBuiltin()) - associated = fun->lazyScript()->functionNonDelazifying(); - else - associated = nullptr; + associated = associated->as().maybeCanonicalFunction(); // If we have previously cleared the 'new' script information for this // function, don't try to construct another one. -- cgit v1.2.3