PropertyQueryFlags JavascriptStringObject::GetPropertyQuery(Var originalInstance, PropertyId propertyId, Var* value, PropertyValueInfo* info, ScriptContext* requestContext) { BOOL result; if (GetPropertyBuiltIns(propertyId, value, requestContext, &result)) { return JavascriptConversion::BooleanToPropertyQueryFlags(result); } if (JavascriptConversion::PropertyQueryFlagsToBoolean(DynamicObject::GetPropertyQuery(originalInstance, propertyId, value, info, requestContext))) { return PropertyQueryFlags::Property_Found; } // For NumericPropertyIds check that index is less than JavascriptString length ScriptContext*scriptContext = GetScriptContext(); uint32 index; if (scriptContext->IsNumericPropertyId(propertyId, &index)) { JavascriptString* str = this->InternalUnwrap(); str = JavascriptString::FromVar(CrossSite::MarshalVar(requestContext, str, scriptContext)); return JavascriptConversion::BooleanToPropertyQueryFlags(str->GetItemAt(index, value)); } *value = requestContext->GetMissingPropertyResult(); return PropertyQueryFlags::Property_NotFound; }
BOOL JavascriptStringObject::GetProperty(Var originalInstance, PropertyId propertyId, Var* value, PropertyValueInfo* info, ScriptContext* requestContext) { BOOL result; if (GetPropertyBuiltIns(propertyId, value, requestContext, &result)) { return result; } if (DynamicObject::GetProperty(originalInstance, propertyId, value, info, requestContext)) { return true; } // For NumericPropertyIds check that index is less than JavascriptString length ScriptContext*scriptContext = GetScriptContext(); uint32 index; if (scriptContext->IsNumericPropertyId(propertyId, &index)) { JavascriptString* str = JavascriptString::FromVar(CrossSite::MarshalVar(requestContext, this->InternalUnwrap())); return str->GetItemAt(index, value); } *value = requestContext->GetMissingPropertyResult(); return false; }
BOOL BoundFunction::GetProperty(Var originalInstance, PropertyId propertyId, Var* value, PropertyValueInfo* info, ScriptContext* requestContext) { BOOL result; if (GetPropertyBuiltIns(originalInstance, propertyId, value, info, requestContext, &result)) { return result; } return JavascriptFunction::GetProperty(originalInstance, propertyId, value, info, requestContext); }
BOOL JavascriptSIMDFloat64x2::GetProperty(Var originalInstance, JavascriptString* propertyNameString, Var* value, PropertyValueInfo* info, ScriptContext* requestContext) { PropertyRecord const* propertyRecord; this->GetScriptContext()->FindPropertyRecord(propertyNameString, &propertyRecord); if (propertyRecord != nullptr && GetPropertyBuiltIns(propertyRecord->GetPropertyId(), value, requestContext)) { return true; } return false; }
BOOL ES5Array::GetProperty(Var originalInstance, PropertyId propertyId, Var* value, PropertyValueInfo* info, ScriptContext* requestContext) { BOOL result; if (GetPropertyBuiltIns(propertyId, value, &result)) { return result; } // Skip JavascriptArray override return DynamicObject::GetProperty(originalInstance, propertyId, value, info, requestContext); }
BOOL BoundFunction::GetProperty(Var originalInstance, JavascriptString* propertyNameString, Var* value, PropertyValueInfo* info, ScriptContext* requestContext) { BOOL result; PropertyRecord const* propertyRecord; this->GetScriptContext()->FindPropertyRecord(propertyNameString, &propertyRecord); if (propertyRecord != nullptr && GetPropertyBuiltIns(originalInstance, propertyRecord->GetPropertyId(), value, info, requestContext, &result)) { return result; } return JavascriptFunction::GetProperty(originalInstance, propertyNameString, value, info, requestContext); }
BOOL ES5Array::GetProperty(Var originalInstance, JavascriptString* propertyNameString, Var* value, PropertyValueInfo* info, ScriptContext* requestContext) { BOOL result; PropertyRecord const* propertyRecord; this->GetScriptContext()->FindPropertyRecord(propertyNameString, &propertyRecord); if (propertyRecord != nullptr && GetPropertyBuiltIns(propertyRecord->GetPropertyId(), value, &result)) { return result; } // Skip JavascriptArray override return DynamicObject::GetProperty(originalInstance, propertyNameString, value, info, requestContext); }
PropertyQueryFlags JavascriptStringObject::GetPropertyQuery(Var originalInstance, JavascriptString* propertyNameString, Var* value, PropertyValueInfo* info, ScriptContext* requestContext) { AssertMsg(!PropertyRecord::IsPropertyNameNumeric(propertyNameString->GetString(), propertyNameString->GetLength()), "Numeric property names should have been converted to uint or PropertyRecord*"); BOOL result; PropertyRecord const* propertyRecord; this->GetScriptContext()->FindPropertyRecord(propertyNameString, &propertyRecord); if (propertyRecord != nullptr && GetPropertyBuiltIns(propertyRecord->GetPropertyId(), value, requestContext, &result)) { return JavascriptConversion::BooleanToPropertyQueryFlags(result); } return DynamicObject::GetPropertyQuery(originalInstance, propertyNameString, value, info, requestContext); }
BOOL JavascriptGeneratorFunction::GetProperty(Var originalInstance, PropertyId propertyId, Var* value, PropertyValueInfo* info, ScriptContext* requestContext) { BOOL result; if (GetPropertyBuiltIns(originalInstance, propertyId, value, info, requestContext, &result)) { return result; } if (propertyId == PropertyIds::caller || propertyId == PropertyIds::arguments) { // JavascriptFunction has special case for caller and arguments; call DynamicObject:: virtual directly to skip that. return DynamicObject::GetProperty(originalInstance, propertyId, value, info, requestContext); } return JavascriptFunction::GetProperty(originalInstance, propertyId, value, info, requestContext); }
BOOL JavascriptGeneratorFunction::GetProperty(Var originalInstance, JavascriptString* propertyNameString, Var* value, PropertyValueInfo* info, ScriptContext* requestContext) { PropertyRecord const* propertyRecord; this->GetScriptContext()->FindPropertyRecord(propertyNameString, &propertyRecord); if (propertyRecord != nullptr) { BOOL result; if (GetPropertyBuiltIns(originalInstance, propertyRecord->GetPropertyId(), value, info, requestContext, &result)) { return result; } if (propertyRecord->GetPropertyId() == PropertyIds::caller || propertyRecord->GetPropertyId() == PropertyIds::arguments) { // JavascriptFunction has special case for caller and arguments; call DynamicObject:: virtual directly to skip that. return DynamicObject::GetProperty(originalInstance, propertyNameString, value, info, requestContext); } } return JavascriptFunction::GetProperty(originalInstance, propertyNameString, value, info, requestContext); }
BOOL JavascriptSIMDFloat64x2::GetProperty(Var originalInstance, PropertyId propertyId, Var* value, PropertyValueInfo* info, ScriptContext* requestContext) { return GetPropertyBuiltIns(propertyId, value, requestContext); }