@@ -278,11 +278,6 @@ using namespace Js;
278278
279279 PropertyQueryFlags JavascriptGeneratorFunction::HasPropertyQuery (PropertyId propertyId, _Inout_opt_ PropertyValueInfo* info)
280280 {
281- if (propertyId == PropertyIds::length)
282- {
283- return PropertyQueryFlags::Property_Found;
284- }
285-
286281 if (propertyId == PropertyIds::caller || propertyId == PropertyIds::arguments)
287282 {
288283 // JavascriptFunction has special case for caller and arguments; call DynamicObject:: virtual directly to skip that.
@@ -294,12 +289,6 @@ using namespace Js;
294289
295290 PropertyQueryFlags JavascriptGeneratorFunction::GetPropertyQuery (Var originalInstance, PropertyId propertyId, Var* value, PropertyValueInfo* info, ScriptContext* requestContext)
296291 {
297- BOOL result;
298- if (GetPropertyBuiltIns (originalInstance, propertyId, value, info, requestContext, &result))
299- {
300- return JavascriptConversion::BooleanToPropertyQueryFlags (result);
301- }
302-
303292 if (propertyId == PropertyIds::caller || propertyId == PropertyIds::arguments)
304293 {
305294 // JavascriptFunction has special case for caller and arguments; call DynamicObject:: virtual directly to skip that.
@@ -316,12 +305,6 @@ using namespace Js;
316305
317306 if (propertyRecord != nullptr )
318307 {
319- BOOL result;
320- if (GetPropertyBuiltIns (originalInstance, propertyRecord->GetPropertyId (), value, info, requestContext, &result))
321- {
322- return JavascriptConversion::BooleanToPropertyQueryFlags (result);
323- }
324-
325308 if (propertyRecord->GetPropertyId () == PropertyIds::caller || propertyRecord->GetPropertyId () == PropertyIds::arguments)
326309 {
327310 // JavascriptFunction has special case for caller and arguments; call DynamicObject:: virtual directly to skip that.
@@ -332,40 +315,13 @@ using namespace Js;
332315 return JavascriptFunction::GetPropertyQuery (originalInstance, propertyNameString, value, info, requestContext);
333316 }
334317
335- bool JavascriptGeneratorFunction::GetPropertyBuiltIns (Var originalInstance, PropertyId propertyId, Var* value, PropertyValueInfo* info, ScriptContext* requestContext, BOOL* result)
336- {
337- if (propertyId == PropertyIds::length)
338- {
339- // Cannot just call the base GetProperty for `length` because we need
340- // to get the length from our private ScriptFunction instead of ourself.
341- int len = 0 ;
342- Var varLength;
343- if (scriptFunction->GetProperty (this , PropertyIds::length, &varLength, NULL , requestContext))
344- {
345- len = JavascriptConversion::ToInt32 (varLength, requestContext);
346- }
347-
348- *value = JavascriptNumber::ToVar (len, requestContext);
349- *result = true ;
350- return true ;
351- }
352-
353- return false ;
354- }
355-
356318 PropertyQueryFlags JavascriptGeneratorFunction::GetPropertyReferenceQuery (Var originalInstance, PropertyId propertyId, Var* value, PropertyValueInfo* info, ScriptContext* requestContext)
357319 {
358320 return JavascriptGeneratorFunction::GetPropertyQuery (originalInstance, propertyId, value, info, requestContext);
359321 }
360322
361323 BOOL JavascriptGeneratorFunction::SetProperty (PropertyId propertyId, Var value, PropertyOperationFlags flags, PropertyValueInfo* info)
362324 {
363- BOOL result;
364- if (SetPropertyBuiltIns (propertyId, value, flags, info, &result))
365- {
366- return result;
367- }
368-
369325 if (propertyId == PropertyIds::caller || propertyId == PropertyIds::arguments)
370326 {
371327 // JavascriptFunction has special case for caller and arguments; call DynamicObject:: virtual directly to skip that.
@@ -382,12 +338,6 @@ using namespace Js;
382338
383339 if (propertyRecord != nullptr )
384340 {
385- BOOL result;
386- if (SetPropertyBuiltIns (propertyRecord->GetPropertyId (), value, flags, info, &result))
387- {
388- return result;
389- }
390-
391341 if (propertyRecord->GetPropertyId () == PropertyIds::caller || propertyRecord->GetPropertyId () == PropertyIds::arguments)
392342 {
393343 // JavascriptFunction has special case for caller and arguments; call DynamicObject:: virtual directly to skip that.
@@ -398,36 +348,8 @@ using namespace Js;
398348 return JavascriptFunction::SetProperty (propertyNameString, value, flags, info);
399349 }
400350
401- bool JavascriptGeneratorFunction::SetPropertyBuiltIns (PropertyId propertyId, Var value, PropertyOperationFlags flags, PropertyValueInfo* info, BOOL* result)
402- {
403- if (propertyId == PropertyIds::length)
404- {
405- JavascriptError::ThrowCantAssignIfStrictMode (flags, this ->GetScriptContext ());
406-
407- *result = false ;
408- return true ;
409- }
410-
411- return false ;
412- }
413-
414- BOOL JavascriptGeneratorFunction::SetAccessors (PropertyId propertyId, Var getter, Var setter, PropertyOperationFlags flags)
415- {
416- if (propertyId == PropertyIds::length)
417- {
418- return this ->scriptFunction ->SetAccessors (propertyId, getter, setter, flags);
419- }
420-
421- return JavascriptFunction::SetAccessors (propertyId, getter, setter, flags);
422- }
423-
424351 _Check_return_ _Success_ (return ) BOOL JavascriptGeneratorFunction::GetAccessors(PropertyId propertyId, _Outptr_result_maybenull_ Var* getter, _Outptr_result_maybenull_ Var* setter, ScriptContext* requestContext)
425352 {
426- if (propertyId == PropertyIds::length)
427- {
428- return this ->scriptFunction ->GetAccessors (propertyId, getter, setter, requestContext);
429- }
430-
431353 if (propertyId == PropertyIds::caller || propertyId == PropertyIds::arguments)
432354 {
433355 // JavascriptFunction has special case for caller and arguments; call DynamicObject:: virtual directly to skip that.
@@ -445,11 +367,6 @@ using namespace Js;
445367 return DynamicObject::GetSetter (propertyId, setterValue, info, requestContext);
446368 }
447369
448- if (propertyId == PropertyIds::length)
449- {
450- return this ->scriptFunction ->GetSetter (propertyId, setterValue, info, requestContext);
451- }
452-
453370 return JavascriptFunction::GetSetter (propertyId, setterValue, info, requestContext);
454371 }
455372
@@ -460,11 +377,6 @@ using namespace Js;
460377
461378 if (propertyRecord != nullptr )
462379 {
463- if (propertyRecord->GetPropertyId () == PropertyIds::length)
464- {
465- return this ->scriptFunction ->GetSetter (propertyNameString, setterValue, info, requestContext);
466- }
467-
468380 if ((propertyRecord->GetPropertyId () == PropertyIds::caller || propertyRecord->GetPropertyId () == PropertyIds::arguments))
469381 {
470382 // JavascriptFunction has special case for caller and arguments; call DynamicObject:: virtual directly to skip that.
@@ -482,11 +394,6 @@ using namespace Js;
482394
483395 BOOL JavascriptGeneratorFunction::DeleteProperty (PropertyId propertyId, PropertyOperationFlags flags)
484396 {
485- if (propertyId == PropertyIds::length)
486- {
487- return false ;
488- }
489-
490397 if (propertyId == PropertyIds::caller || propertyId == PropertyIds::arguments)
491398 {
492399 // JavascriptFunction has special case for caller and arguments; call DynamicObject:: virtual directly to skip that.
@@ -498,11 +405,6 @@ using namespace Js;
498405
499406 BOOL JavascriptGeneratorFunction::DeleteProperty (JavascriptString *propertyNameString, PropertyOperationFlags flags)
500407 {
501- if (BuiltInPropertyRecords::length.Equals (propertyNameString))
502- {
503- return false ;
504- }
505-
506408 if (BuiltInPropertyRecords::caller.Equals (propertyNameString) || BuiltInPropertyRecords::arguments.Equals (propertyNameString))
507409 {
508410 // JavascriptFunction has special case for caller and arguments; call DynamicObject:: virtual directly to skip that.
@@ -514,11 +416,6 @@ using namespace Js;
514416
515417 BOOL JavascriptGeneratorFunction::IsWritable (PropertyId propertyId)
516418 {
517- if (propertyId == PropertyIds::length)
518- {
519- return false ;
520- }
521-
522419 if (propertyId == PropertyIds::caller || propertyId == PropertyIds::arguments)
523420 {
524421 // JavascriptFunction has special case for caller and arguments; call DynamicObject:: virtual directly to skip that.
@@ -530,11 +427,6 @@ using namespace Js;
530427
531428 BOOL JavascriptGeneratorFunction::IsEnumerable (PropertyId propertyId)
532429 {
533- if (propertyId == PropertyIds::length)
534- {
535- return false ;
536- }
537-
538430 if (propertyId == PropertyIds::caller || propertyId == PropertyIds::arguments)
539431 {
540432 // JavascriptFunction has special case for caller and arguments; call DynamicObject:: virtual directly to skip that.
0 commit comments