@@ -278,11 +278,6 @@ using namespace Js;
278
278
279
279
PropertyQueryFlags JavascriptGeneratorFunction::HasPropertyQuery (PropertyId propertyId, _Inout_opt_ PropertyValueInfo* info)
280
280
{
281
- if (propertyId == PropertyIds::length)
282
- {
283
- return PropertyQueryFlags::Property_Found;
284
- }
285
-
286
281
if (propertyId == PropertyIds::caller || propertyId == PropertyIds::arguments)
287
282
{
288
283
// JavascriptFunction has special case for caller and arguments; call DynamicObject:: virtual directly to skip that.
@@ -294,12 +289,6 @@ using namespace Js;
294
289
295
290
PropertyQueryFlags JavascriptGeneratorFunction::GetPropertyQuery (Var originalInstance, PropertyId propertyId, Var* value, PropertyValueInfo* info, ScriptContext* requestContext)
296
291
{
297
- BOOL result;
298
- if (GetPropertyBuiltIns (originalInstance, propertyId, value, info, requestContext, &result))
299
- {
300
- return JavascriptConversion::BooleanToPropertyQueryFlags (result);
301
- }
302
-
303
292
if (propertyId == PropertyIds::caller || propertyId == PropertyIds::arguments)
304
293
{
305
294
// JavascriptFunction has special case for caller and arguments; call DynamicObject:: virtual directly to skip that.
@@ -316,12 +305,6 @@ using namespace Js;
316
305
317
306
if (propertyRecord != nullptr )
318
307
{
319
- BOOL result;
320
- if (GetPropertyBuiltIns (originalInstance, propertyRecord->GetPropertyId (), value, info, requestContext, &result))
321
- {
322
- return JavascriptConversion::BooleanToPropertyQueryFlags (result);
323
- }
324
-
325
308
if (propertyRecord->GetPropertyId () == PropertyIds::caller || propertyRecord->GetPropertyId () == PropertyIds::arguments)
326
309
{
327
310
// JavascriptFunction has special case for caller and arguments; call DynamicObject:: virtual directly to skip that.
@@ -332,40 +315,13 @@ using namespace Js;
332
315
return JavascriptFunction::GetPropertyQuery (originalInstance, propertyNameString, value, info, requestContext);
333
316
}
334
317
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
-
356
318
PropertyQueryFlags JavascriptGeneratorFunction::GetPropertyReferenceQuery (Var originalInstance, PropertyId propertyId, Var* value, PropertyValueInfo* info, ScriptContext* requestContext)
357
319
{
358
320
return JavascriptGeneratorFunction::GetPropertyQuery (originalInstance, propertyId, value, info, requestContext);
359
321
}
360
322
361
323
BOOL JavascriptGeneratorFunction::SetProperty (PropertyId propertyId, Var value, PropertyOperationFlags flags, PropertyValueInfo* info)
362
324
{
363
- BOOL result;
364
- if (SetPropertyBuiltIns (propertyId, value, flags, info, &result))
365
- {
366
- return result;
367
- }
368
-
369
325
if (propertyId == PropertyIds::caller || propertyId == PropertyIds::arguments)
370
326
{
371
327
// JavascriptFunction has special case for caller and arguments; call DynamicObject:: virtual directly to skip that.
@@ -382,12 +338,6 @@ using namespace Js;
382
338
383
339
if (propertyRecord != nullptr )
384
340
{
385
- BOOL result;
386
- if (SetPropertyBuiltIns (propertyRecord->GetPropertyId (), value, flags, info, &result))
387
- {
388
- return result;
389
- }
390
-
391
341
if (propertyRecord->GetPropertyId () == PropertyIds::caller || propertyRecord->GetPropertyId () == PropertyIds::arguments)
392
342
{
393
343
// JavascriptFunction has special case for caller and arguments; call DynamicObject:: virtual directly to skip that.
@@ -398,36 +348,8 @@ using namespace Js;
398
348
return JavascriptFunction::SetProperty (propertyNameString, value, flags, info);
399
349
}
400
350
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
-
424
351
_Check_return_ _Success_ (return ) BOOL JavascriptGeneratorFunction::GetAccessors(PropertyId propertyId, _Outptr_result_maybenull_ Var* getter, _Outptr_result_maybenull_ Var* setter, ScriptContext* requestContext)
425
352
{
426
- if (propertyId == PropertyIds::length)
427
- {
428
- return this ->scriptFunction ->GetAccessors (propertyId, getter, setter, requestContext);
429
- }
430
-
431
353
if (propertyId == PropertyIds::caller || propertyId == PropertyIds::arguments)
432
354
{
433
355
// JavascriptFunction has special case for caller and arguments; call DynamicObject:: virtual directly to skip that.
@@ -445,11 +367,6 @@ using namespace Js;
445
367
return DynamicObject::GetSetter (propertyId, setterValue, info, requestContext);
446
368
}
447
369
448
- if (propertyId == PropertyIds::length)
449
- {
450
- return this ->scriptFunction ->GetSetter (propertyId, setterValue, info, requestContext);
451
- }
452
-
453
370
return JavascriptFunction::GetSetter (propertyId, setterValue, info, requestContext);
454
371
}
455
372
@@ -460,11 +377,6 @@ using namespace Js;
460
377
461
378
if (propertyRecord != nullptr )
462
379
{
463
- if (propertyRecord->GetPropertyId () == PropertyIds::length)
464
- {
465
- return this ->scriptFunction ->GetSetter (propertyNameString, setterValue, info, requestContext);
466
- }
467
-
468
380
if ((propertyRecord->GetPropertyId () == PropertyIds::caller || propertyRecord->GetPropertyId () == PropertyIds::arguments))
469
381
{
470
382
// JavascriptFunction has special case for caller and arguments; call DynamicObject:: virtual directly to skip that.
@@ -482,11 +394,6 @@ using namespace Js;
482
394
483
395
BOOL JavascriptGeneratorFunction::DeleteProperty (PropertyId propertyId, PropertyOperationFlags flags)
484
396
{
485
- if (propertyId == PropertyIds::length)
486
- {
487
- return false ;
488
- }
489
-
490
397
if (propertyId == PropertyIds::caller || propertyId == PropertyIds::arguments)
491
398
{
492
399
// JavascriptFunction has special case for caller and arguments; call DynamicObject:: virtual directly to skip that.
@@ -498,11 +405,6 @@ using namespace Js;
498
405
499
406
BOOL JavascriptGeneratorFunction::DeleteProperty (JavascriptString *propertyNameString, PropertyOperationFlags flags)
500
407
{
501
- if (BuiltInPropertyRecords::length.Equals (propertyNameString))
502
- {
503
- return false ;
504
- }
505
-
506
408
if (BuiltInPropertyRecords::caller.Equals (propertyNameString) || BuiltInPropertyRecords::arguments.Equals (propertyNameString))
507
409
{
508
410
// JavascriptFunction has special case for caller and arguments; call DynamicObject:: virtual directly to skip that.
@@ -514,11 +416,6 @@ using namespace Js;
514
416
515
417
BOOL JavascriptGeneratorFunction::IsWritable (PropertyId propertyId)
516
418
{
517
- if (propertyId == PropertyIds::length)
518
- {
519
- return false ;
520
- }
521
-
522
419
if (propertyId == PropertyIds::caller || propertyId == PropertyIds::arguments)
523
420
{
524
421
// JavascriptFunction has special case for caller and arguments; call DynamicObject:: virtual directly to skip that.
@@ -530,11 +427,6 @@ using namespace Js;
530
427
531
428
BOOL JavascriptGeneratorFunction::IsEnumerable (PropertyId propertyId)
532
429
{
533
- if (propertyId == PropertyIds::length)
534
- {
535
- return false ;
536
- }
537
-
538
430
if (propertyId == PropertyIds::caller || propertyId == PropertyIds::arguments)
539
431
{
540
432
// JavascriptFunction has special case for caller and arguments; call DynamicObject:: virtual directly to skip that.
0 commit comments