X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/93a3786624b2768d89bfa27e46598dc64e2fb70a..4be4e30906bcb8ee30b4d189205cb70bad6707ce:/runtime/JSScope.cpp?ds=sidebyside diff --git a/runtime/JSScope.cpp b/runtime/JSScope.cpp index 69ff1e4..7ad5665 100644 --- a/runtime/JSScope.cpp +++ b/runtime/JSScope.cpp @@ -301,6 +301,14 @@ template JSObject operations->append(ResolveOperation::checkForDynamicEntriesBeforeGlobalScope()); if (putToBaseOperation) { + unsigned currentAttributes; + JSCell* currentSpecificFunction; + PropertyOffset offset = globalObject->structure()->get(callFrame->vm(), identifier, currentAttributes, currentSpecificFunction); + ASSERT_UNUSED(offset, offset != invalidOffset); + ASSERT_UNUSED(offset, offset == slot.cachedOffset()); + // We just assume that we are clobbering the global specialisation + if (currentSpecificFunction) + globalObject->setStructure(callFrame->vm(), Structure::despecifyFunctionTransition(callFrame->vm(), globalObject->structure(), identifier)); putToBaseOperation->m_isDynamic = requiresDynamicChecks; putToBaseOperation->m_kind = PutToBaseOperation::GlobalPropertyPut; putToBaseOperation->m_structure.set(callFrame->vm(), callFrame->codeBlock()->ownerExecutable(), globalObject->structure());