|
|
@@ -278,11 +278,6 @@ using namespace Js;
|
|
|
|
|
|
PropertyQueryFlags JavascriptGeneratorFunction::HasPropertyQuery(PropertyId propertyId, _Inout_opt_ PropertyValueInfo* info)
|
|
|
{
|
|
|
- if (propertyId == PropertyIds::length)
|
|
|
- {
|
|
|
- return PropertyQueryFlags::Property_Found;
|
|
|
- }
|
|
|
-
|
|
|
if (propertyId == PropertyIds::caller || propertyId == PropertyIds::arguments)
|
|
|
{
|
|
|
// JavascriptFunction has special case for caller and arguments; call DynamicObject:: virtual directly to skip that.
|
|
|
@@ -294,12 +289,6 @@ using namespace Js;
|
|
|
|
|
|
PropertyQueryFlags JavascriptGeneratorFunction::GetPropertyQuery(Var originalInstance, PropertyId propertyId, Var* value, PropertyValueInfo* info, ScriptContext* requestContext)
|
|
|
{
|
|
|
- BOOL result;
|
|
|
- if (GetPropertyBuiltIns(originalInstance, propertyId, value, info, requestContext, &result))
|
|
|
- {
|
|
|
- return JavascriptConversion::BooleanToPropertyQueryFlags(result);
|
|
|
- }
|
|
|
-
|
|
|
if (propertyId == PropertyIds::caller || propertyId == PropertyIds::arguments)
|
|
|
{
|
|
|
// JavascriptFunction has special case for caller and arguments; call DynamicObject:: virtual directly to skip that.
|
|
|
@@ -316,12 +305,6 @@ using namespace Js;
|
|
|
|
|
|
if (propertyRecord != nullptr)
|
|
|
{
|
|
|
- BOOL result;
|
|
|
- if (GetPropertyBuiltIns(originalInstance, propertyRecord->GetPropertyId(), value, info, requestContext, &result))
|
|
|
- {
|
|
|
- return JavascriptConversion::BooleanToPropertyQueryFlags(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.
|
|
|
@@ -332,27 +315,6 @@ using namespace Js;
|
|
|
return JavascriptFunction::GetPropertyQuery(originalInstance, propertyNameString, value, info, requestContext);
|
|
|
}
|
|
|
|
|
|
- bool JavascriptGeneratorFunction::GetPropertyBuiltIns(Var originalInstance, PropertyId propertyId, Var* value, PropertyValueInfo* info, ScriptContext* requestContext, BOOL* result)
|
|
|
- {
|
|
|
- if (propertyId == PropertyIds::length)
|
|
|
- {
|
|
|
- // Cannot just call the base GetProperty for `length` because we need
|
|
|
- // to get the length from our private ScriptFunction instead of ourself.
|
|
|
- int len = 0;
|
|
|
- Var varLength;
|
|
|
- if (scriptFunction->GetProperty(this, PropertyIds::length, &varLength, NULL, requestContext))
|
|
|
- {
|
|
|
- len = JavascriptConversion::ToInt32(varLength, requestContext);
|
|
|
- }
|
|
|
-
|
|
|
- *value = JavascriptNumber::ToVar(len, requestContext);
|
|
|
- *result = true;
|
|
|
- return true;
|
|
|
- }
|
|
|
-
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
PropertyQueryFlags JavascriptGeneratorFunction::GetPropertyReferenceQuery(Var originalInstance, PropertyId propertyId, Var* value, PropertyValueInfo* info, ScriptContext* requestContext)
|
|
|
{
|
|
|
return JavascriptGeneratorFunction::GetPropertyQuery(originalInstance, propertyId, value, info, requestContext);
|
|
|
@@ -360,12 +322,6 @@ using namespace Js;
|
|
|
|
|
|
BOOL JavascriptGeneratorFunction::SetProperty(PropertyId propertyId, Var value, PropertyOperationFlags flags, PropertyValueInfo* info)
|
|
|
{
|
|
|
- BOOL result;
|
|
|
- if (SetPropertyBuiltIns(propertyId, value, flags, info, &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.
|
|
|
@@ -382,12 +338,6 @@ using namespace Js;
|
|
|
|
|
|
if (propertyRecord != nullptr)
|
|
|
{
|
|
|
- BOOL result;
|
|
|
- if (SetPropertyBuiltIns(propertyRecord->GetPropertyId(), value, flags, info, &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.
|
|
|
@@ -398,36 +348,8 @@ using namespace Js;
|
|
|
return JavascriptFunction::SetProperty(propertyNameString, value, flags, info);
|
|
|
}
|
|
|
|
|
|
- bool JavascriptGeneratorFunction::SetPropertyBuiltIns(PropertyId propertyId, Var value, PropertyOperationFlags flags, PropertyValueInfo* info, BOOL* result)
|
|
|
- {
|
|
|
- if (propertyId == PropertyIds::length)
|
|
|
- {
|
|
|
- JavascriptError::ThrowCantAssignIfStrictMode(flags, this->GetScriptContext());
|
|
|
-
|
|
|
- *result = false;
|
|
|
- return true;
|
|
|
- }
|
|
|
-
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- BOOL JavascriptGeneratorFunction::SetAccessors(PropertyId propertyId, Var getter, Var setter, PropertyOperationFlags flags)
|
|
|
- {
|
|
|
- if (propertyId == PropertyIds::length)
|
|
|
- {
|
|
|
- return this->scriptFunction->SetAccessors(propertyId, getter, setter, flags);
|
|
|
- }
|
|
|
-
|
|
|
- return JavascriptFunction::SetAccessors(propertyId, getter, setter, flags);
|
|
|
- }
|
|
|
-
|
|
|
_Check_return_ _Success_(return) BOOL JavascriptGeneratorFunction::GetAccessors(PropertyId propertyId, _Outptr_result_maybenull_ Var* getter, _Outptr_result_maybenull_ Var* setter, ScriptContext* requestContext)
|
|
|
{
|
|
|
- if (propertyId == PropertyIds::length)
|
|
|
- {
|
|
|
- return this->scriptFunction->GetAccessors(propertyId, getter, setter, requestContext);
|
|
|
- }
|
|
|
-
|
|
|
if (propertyId == PropertyIds::caller || propertyId == PropertyIds::arguments)
|
|
|
{
|
|
|
// JavascriptFunction has special case for caller and arguments; call DynamicObject:: virtual directly to skip that.
|
|
|
@@ -445,11 +367,6 @@ using namespace Js;
|
|
|
return DynamicObject::GetSetter(propertyId, setterValue, info, requestContext);
|
|
|
}
|
|
|
|
|
|
- if (propertyId == PropertyIds::length)
|
|
|
- {
|
|
|
- return this->scriptFunction->GetSetter(propertyId, setterValue, info, requestContext);
|
|
|
- }
|
|
|
-
|
|
|
return JavascriptFunction::GetSetter(propertyId, setterValue, info, requestContext);
|
|
|
}
|
|
|
|
|
|
@@ -460,11 +377,6 @@ using namespace Js;
|
|
|
|
|
|
if (propertyRecord != nullptr)
|
|
|
{
|
|
|
- if (propertyRecord->GetPropertyId() == PropertyIds::length)
|
|
|
- {
|
|
|
- return this->scriptFunction->GetSetter(propertyNameString, setterValue, info, requestContext);
|
|
|
- }
|
|
|
-
|
|
|
if ((propertyRecord->GetPropertyId() == PropertyIds::caller || propertyRecord->GetPropertyId() == PropertyIds::arguments))
|
|
|
{
|
|
|
// JavascriptFunction has special case for caller and arguments; call DynamicObject:: virtual directly to skip that.
|
|
|
@@ -482,11 +394,6 @@ using namespace Js;
|
|
|
|
|
|
BOOL JavascriptGeneratorFunction::DeleteProperty(PropertyId propertyId, PropertyOperationFlags flags)
|
|
|
{
|
|
|
- if (propertyId == PropertyIds::length)
|
|
|
- {
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
if (propertyId == PropertyIds::caller || propertyId == PropertyIds::arguments)
|
|
|
{
|
|
|
// JavascriptFunction has special case for caller and arguments; call DynamicObject:: virtual directly to skip that.
|
|
|
@@ -498,11 +405,6 @@ using namespace Js;
|
|
|
|
|
|
BOOL JavascriptGeneratorFunction::DeleteProperty(JavascriptString *propertyNameString, PropertyOperationFlags flags)
|
|
|
{
|
|
|
- if (BuiltInPropertyRecords::length.Equals(propertyNameString))
|
|
|
- {
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
if (BuiltInPropertyRecords::caller.Equals(propertyNameString) || BuiltInPropertyRecords::arguments.Equals(propertyNameString))
|
|
|
{
|
|
|
// JavascriptFunction has special case for caller and arguments; call DynamicObject:: virtual directly to skip that.
|
|
|
@@ -514,11 +416,6 @@ using namespace Js;
|
|
|
|
|
|
BOOL JavascriptGeneratorFunction::IsWritable(PropertyId propertyId)
|
|
|
{
|
|
|
- if (propertyId == PropertyIds::length)
|
|
|
- {
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
if (propertyId == PropertyIds::caller || propertyId == PropertyIds::arguments)
|
|
|
{
|
|
|
// JavascriptFunction has special case for caller and arguments; call DynamicObject:: virtual directly to skip that.
|
|
|
@@ -530,11 +427,6 @@ using namespace Js;
|
|
|
|
|
|
BOOL JavascriptGeneratorFunction::IsEnumerable(PropertyId propertyId)
|
|
|
{
|
|
|
- if (propertyId == PropertyIds::length)
|
|
|
- {
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
if (propertyId == PropertyIds::caller || propertyId == PropertyIds::arguments)
|
|
|
{
|
|
|
// JavascriptFunction has special case for caller and arguments; call DynamicObject:: virtual directly to skip that.
|