Changeset 212015 in webkit for trunk/Source/JavaScriptCore/runtime/InternalFunction.cpp
- Timestamp:
- Feb 9, 2017, 5:39:13 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/runtime/InternalFunction.cpp
r211247 r212015 2 2 * Copyright (C) 1999-2002 Harri Porten ([email protected]) 3 3 * Copyright (C) 2001 Peter Kelly ([email protected]) 4 * Copyright (C) 2004, 2007-2008, 2016 Apple Inc. All rights reserved.4 * Copyright (C) 2004, 2007-2008, 2016-2017 Apple Inc. All rights reserved. 5 5 * 6 6 * This library is free software; you can redistribute it and/or … … 106 106 // newTarget may be an InternalFunction if we were called from Reflect.construct. 107 107 JSFunction* targetFunction = jsDynamicCast<JSFunction*>(vm, newTarget); 108 JSGlobalObject* lexicalGlobalObject = exec->lexicalGlobalObject(); 108 109 109 110 if (LIKELY(targetFunction)) { … … 116 117 RETURN_IF_EXCEPTION(scope, nullptr); 117 118 if (JSObject* prototype = jsDynamicCast<JSObject*>(vm, prototypeValue)) 118 return targetFunction->rareData(vm)->createInternalFunctionAllocationStructureFromBase(vm, prototype, baseClass);119 return targetFunction->rareData(vm)->createInternalFunctionAllocationStructureFromBase(vm, lexicalGlobalObject, prototype, baseClass); 119 120 } else { 120 121 JSValue prototypeValue = newTarget.get(exec, exec->propertyNames().prototype); … … 123 124 // This only happens if someone Reflect.constructs our builtin constructor with another builtin constructor as the new.target. 124 125 // Thus, we don't care about the cost of looking up the structure from our hash table every time. 125 return vm.prototypeMap.emptyStructureForPrototypeFromBaseStructure( prototype, baseClass);126 return vm.prototypeMap.emptyStructureForPrototypeFromBaseStructure(lexicalGlobalObject, prototype, baseClass); 126 127 } 127 128 }
Note:
See TracChangeset
for help on using the changeset viewer.