|
@@ -1178,13 +1178,11 @@ CommonNumber:
|
|
|
return JavascriptObject::CreateOwnStringSymbolPropertiesHelper(object, scriptContext);
|
|
return JavascriptObject::CreateOwnStringSymbolPropertiesHelper(object, scriptContext);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- JavascriptArray* JavascriptOperators::GetOwnEnumerablePropertyNames(Var instance, ScriptContext* scriptContext)
|
|
|
|
|
|
|
+ JavascriptArray* JavascriptOperators::GetOwnEnumerablePropertyNames(RecyclableObject* object, ScriptContext* scriptContext)
|
|
|
{
|
|
{
|
|
|
- RecyclableObject *object = RecyclableObject::FromVar(ToObject(instance, scriptContext));
|
|
|
|
|
-
|
|
|
|
|
- if (JavascriptProxy::Is(instance))
|
|
|
|
|
|
|
+ if (JavascriptProxy::Is(object))
|
|
|
{
|
|
{
|
|
|
- JavascriptProxy* proxy = JavascriptProxy::FromVar(instance);
|
|
|
|
|
|
|
+ JavascriptProxy* proxy = JavascriptProxy::FromVar(object);
|
|
|
JavascriptArray* proxyResult = proxy->PropertyKeysTrap(JavascriptProxy::KeysTrapKind::GetOwnPropertyNamesKind, scriptContext);
|
|
JavascriptArray* proxyResult = proxy->PropertyKeysTrap(JavascriptProxy::KeysTrapKind::GetOwnPropertyNamesKind, scriptContext);
|
|
|
JavascriptArray* proxyResultToReturn = scriptContext->GetLibrary()->CreateArray(0);
|
|
JavascriptArray* proxyResultToReturn = scriptContext->GetLibrary()->CreateArray(0);
|
|
|
|
|
|
|
@@ -1201,7 +1199,7 @@ CommonNumber:
|
|
|
|
|
|
|
|
PropertyDescriptor propertyDescriptor;
|
|
PropertyDescriptor propertyDescriptor;
|
|
|
JavascriptConversion::ToPropertyKey(element, scriptContext, &propertyRecord);
|
|
JavascriptConversion::ToPropertyKey(element, scriptContext, &propertyRecord);
|
|
|
- if (JavascriptOperators::GetOwnPropertyDescriptor(RecyclableObject::FromVar(instance), propertyRecord->GetPropertyId(), scriptContext, &propertyDescriptor))
|
|
|
|
|
|
|
+ if (JavascriptOperators::GetOwnPropertyDescriptor(object, propertyRecord->GetPropertyId(), scriptContext, &propertyDescriptor))
|
|
|
{
|
|
{
|
|
|
if (propertyDescriptor.IsEnumerable())
|
|
if (propertyDescriptor.IsEnumerable())
|
|
|
{
|
|
{
|
|
@@ -1214,13 +1212,11 @@ CommonNumber:
|
|
|
return JavascriptObject::CreateOwnEnumerableStringPropertiesHelper(object, scriptContext);
|
|
return JavascriptObject::CreateOwnEnumerableStringPropertiesHelper(object, scriptContext);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- JavascriptArray* JavascriptOperators::GetOwnEnumerablePropertyNamesSymbols(Var instance, ScriptContext* scriptContext)
|
|
|
|
|
|
|
+ JavascriptArray* JavascriptOperators::GetOwnEnumerablePropertyNamesSymbols(RecyclableObject* object, ScriptContext* scriptContext)
|
|
|
{
|
|
{
|
|
|
- RecyclableObject *object = RecyclableObject::FromVar(ToObject(instance, scriptContext));
|
|
|
|
|
-
|
|
|
|
|
- if (JavascriptProxy::Is(instance))
|
|
|
|
|
|
|
+ if (JavascriptProxy::Is(object))
|
|
|
{
|
|
{
|
|
|
- JavascriptProxy* proxy = JavascriptProxy::FromVar(instance);
|
|
|
|
|
|
|
+ JavascriptProxy* proxy = JavascriptProxy::FromVar(object);
|
|
|
return proxy->PropertyKeysTrap(JavascriptProxy::KeysTrapKind::KeysKind, scriptContext);
|
|
return proxy->PropertyKeysTrap(JavascriptProxy::KeysTrapKind::KeysKind, scriptContext);
|
|
|
}
|
|
}
|
|
|
return JavascriptObject::CreateOwnEnumerableStringSymbolPropertiesHelper(object, scriptContext);
|
|
return JavascriptObject::CreateOwnEnumerableStringSymbolPropertiesHelper(object, scriptContext);
|
|
@@ -5902,9 +5898,9 @@ CommonNumber:
|
|
|
#if ENABLE_DEBUG_CONFIG_OPTIONS
|
|
#if ENABLE_DEBUG_CONFIG_OPTIONS
|
|
|
if (Js::Configuration::Global.flags.IsEnabled(Js::autoProxyFlag))
|
|
if (Js::Configuration::Global.flags.IsEnabled(Js::autoProxyFlag))
|
|
|
{
|
|
{
|
|
|
- newObject = DynamicObject::FromVar(JavascriptProxy::AutoProxyWrapper(newObject));
|
|
|
|
|
|
|
+ DynamicObject* newDynamicObject = DynamicObject::FromVar(JavascriptProxy::AutoProxyWrapper(newObject));
|
|
|
// this might come from a different scriptcontext.
|
|
// this might come from a different scriptcontext.
|
|
|
- newObject = CrossSite::MarshalVar(requestContext, newObject);
|
|
|
|
|
|
|
+ newObject = CrossSite::MarshalVar(requestContext, newDynamicObject, newDynamicObject->GetScriptContext());
|
|
|
}
|
|
}
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
@@ -5943,7 +5939,8 @@ CommonNumber:
|
|
|
ScriptContext* functionScriptContext = function->GetScriptContext();
|
|
ScriptContext* functionScriptContext = function->GetScriptContext();
|
|
|
|
|
|
|
|
RecyclableObject * prototype = JavascriptOperators::GetPrototypeObject(function, functionScriptContext);
|
|
RecyclableObject * prototype = JavascriptOperators::GetPrototypeObject(function, functionScriptContext);
|
|
|
- prototype = RecyclableObject::FromVar(CrossSite::MarshalVar(requestContext, prototype));
|
|
|
|
|
|
|
+ prototype = RecyclableObject::FromVar(CrossSite::MarshalVar(requestContext, prototype, functionScriptContext));
|
|
|
|
|
+
|
|
|
Var object = requestContext->GetLibrary()->CreateObject(prototype);
|
|
Var object = requestContext->GetLibrary()->CreateObject(prototype);
|
|
|
JS_ETW(EventWriteJSCRIPT_RECYCLER_ALLOCATE_OBJECT(object));
|
|
JS_ETW(EventWriteJSCRIPT_RECYCLER_ALLOCATE_OBJECT(object));
|
|
|
#if ENABLE_DEBUG_CONFIG_OPTIONS
|
|
#if ENABLE_DEBUG_CONFIG_OPTIONS
|
|
@@ -6071,8 +6068,10 @@ CommonNumber:
|
|
|
// after we fail the guard check. When invalidating the cache for proto change, make sure we zap the prototype field of the cache in
|
|
// after we fail the guard check. When invalidating the cache for proto change, make sure we zap the prototype field of the cache in
|
|
|
// addition to the guard value.
|
|
// addition to the guard value.
|
|
|
bool prototypeCanBeCached;
|
|
bool prototypeCanBeCached;
|
|
|
- RecyclableObject* prototype = JavascriptOperators::GetPrototypeObjectForConstructorCache(function, constructorScriptContext, prototypeCanBeCached);
|
|
|
|
|
- prototype = RecyclableObject::FromVar(CrossSite::MarshalVar(requestContext, prototype));
|
|
|
|
|
|
|
+ RecyclableObject* prototype = JavascriptOperators::GetPrototypeObjectForConstructorCache(
|
|
|
|
|
+ function, constructorScriptContext, prototypeCanBeCached);
|
|
|
|
|
+ prototype = RecyclableObject::FromVar(CrossSite::MarshalVar(requestContext,
|
|
|
|
|
+ prototype, constructorScriptContext));
|
|
|
|
|
|
|
|
DynamicObject* newObject = requestContext->GetLibrary()->CreateObject(prototype, 8);
|
|
DynamicObject* newObject = requestContext->GetLibrary()->CreateObject(prototype, 8);
|
|
|
|
|
|
|
@@ -6484,9 +6483,9 @@ CommonNumber:
|
|
|
Assert(i <= pDisplay->GetLength());
|
|
Assert(i <= pDisplay->GetLength());
|
|
|
pDisplay->SetLength(i);
|
|
pDisplay->SetLength(i);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
FrameDisplay * JavascriptOperators::OP_LdHandlerScope(Var argThis, ScriptContext* scriptContext)
|
|
FrameDisplay * JavascriptOperators::OP_LdHandlerScope(Var argThis, ScriptContext* scriptContext)
|
|
|
{
|
|
{
|
|
|
-
|
|
|
|
|
// The idea here is to build a stack of nested scopes in the form of a JS array.
|
|
// The idea here is to build a stack of nested scopes in the form of a JS array.
|
|
|
//
|
|
//
|
|
|
// The scope stack for an event handler looks like this:
|
|
// The scope stack for an event handler looks like this:
|
|
@@ -9367,7 +9366,9 @@ CommonNumber:
|
|
|
|
|
|
|
|
Var thisVar = RootToThisObject(object, scriptContext);
|
|
Var thisVar = RootToThisObject(object, scriptContext);
|
|
|
|
|
|
|
|
- RecyclableObject* marshalledFunction = RecyclableObject::FromVar(CrossSite::MarshalVar(requestContext, function));
|
|
|
|
|
|
|
+ RecyclableObject* marshalledFunction = RecyclableObject::FromVar(
|
|
|
|
|
+ CrossSite::MarshalVar(requestContext, function, scriptContext));
|
|
|
|
|
+
|
|
|
Var result = CALL_ENTRYPOINT(threadContext, marshalledFunction->GetEntryPoint(), function, CallInfo(flags, 1), thisVar);
|
|
Var result = CALL_ENTRYPOINT(threadContext, marshalledFunction->GetEntryPoint(), function, CallInfo(flags, 1), thisVar);
|
|
|
result = CrossSite::MarshalVar(requestContext, result);
|
|
result = CrossSite::MarshalVar(requestContext, result);
|
|
|
|
|
|
|
@@ -9407,7 +9408,7 @@ CommonNumber:
|
|
|
RecyclableObject* marshalledFunction = function;
|
|
RecyclableObject* marshalledFunction = function;
|
|
|
if (requestContext)
|
|
if (requestContext)
|
|
|
{
|
|
{
|
|
|
- marshalledFunction = RecyclableObject::FromVar(CrossSite::MarshalVar(requestContext, function));
|
|
|
|
|
|
|
+ marshalledFunction = RecyclableObject::FromVar(CrossSite::MarshalVar(requestContext, function, function->GetScriptContext()));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
Var result = CALL_ENTRYPOINT(threadContext, marshalledFunction->GetEntryPoint(), function, CallInfo(flags, 2), thisVar, putValue);
|
|
Var result = CALL_ENTRYPOINT(threadContext, marshalledFunction->GetEntryPoint(), function, CallInfo(flags, 2), thisVar, putValue);
|