|
Lines 406-548
sub ShouldUseGlobalObjectPrototype
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm_sec1
|
| 406 |
|
406 |
|
| 407 |
sub GenerateIndexedGetter |
407 |
sub GenerateIndexedGetter |
| 408 |
{ |
408 |
{ |
| 409 |
my ($interface, $indexedGetterOperation) = @_; |
409 |
my ($outputArray, $indent, $interface, $indexedGetterOperation) = @_; |
| 410 |
|
410 |
|
| 411 |
my @output = (); |
|
|
| 412 |
|
| 413 |
my @attributes = (); |
411 |
my @attributes = (); |
| 414 |
push(@attributes, "ReadOnly") if !$interface->extendedAttributes->{CustomNamedSetter}; |
412 |
push(@attributes, "ReadOnly") if !GetIndexedSetterOperation($interface) && !$interface->extendedAttributes->{CustomNamedSetter}; |
| 415 |
|
413 |
|
| 416 |
my $attributeString = ((@attributes > 0) ? join(" | ", @attributes) : "0"); |
414 |
my $attributeString = ((@attributes > 0) ? join(" | ", @attributes) : "0"); |
| 417 |
|
415 |
|
| 418 |
my $indexedGetterFunctionName = $indexedGetterOperation->name || "item"; |
416 |
my $indexedGetterFunctionName = $indexedGetterOperation->extendedAttributes->{ImplementedAs} || $indexedGetterOperation->name || "item"; |
| 419 |
my $nativeToJSConversion = NativeToJSValueUsingPointers($indexedGetterOperation, $interface, "thisObject->wrapped().${indexedGetterFunctionName}(index)", "*thisObject->globalObject()"); |
417 |
my $nativeToJSConversion = NativeToJSValueUsingPointers($indexedGetterOperation, $interface, "thisObject->wrapped().${indexedGetterFunctionName}(index)", "*thisObject->globalObject()"); |
| 420 |
|
418 |
|
| 421 |
push(@output, " slot.setValue(thisObject, ${attributeString}, ${nativeToJSConversion});\n"); |
419 |
push(@$outputArray, $indent . "slot.setValue(thisObject, ${attributeString}, ${nativeToJSConversion});\n"); |
| 422 |
push(@output, " return true;\n"); |
420 |
push(@$outputArray, $indent . "return true;\n"); |
| 423 |
|
|
|
| 424 |
return @output; |
| 425 |
} |
421 |
} |
| 426 |
|
422 |
|
| 427 |
sub GenerateNamedGetter |
423 |
sub GenerateNamedGetter |
| 428 |
{ |
424 |
{ |
| 429 |
my ($interface, $namedGetterOperation) = @_; |
425 |
my ($outputArray, $indent, $interface, $namedGetterOperation) = @_; |
| 430 |
|
|
|
| 431 |
my @output = (); |
| 432 |
|
426 |
|
| 433 |
my @attributes = (); |
427 |
my @attributes = (); |
| 434 |
push(@attributes, "ReadOnly") if !$interface->extendedAttributes->{CustomNamedSetter}; |
428 |
push(@attributes, "ReadOnly") if !GetNamedSetterOperation($interface) && !$interface->extendedAttributes->{CustomNamedSetter}; |
| 435 |
push(@attributes, "DontEnum") if $interface->extendedAttributes->{LegacyUnenumerableNamedProperties}; |
429 |
push(@attributes, "DontEnum") if $interface->extendedAttributes->{LegacyUnenumerableNamedProperties}; |
| 436 |
|
430 |
|
| 437 |
my $attributeString = ((@attributes > 0) ? join(" | ", @attributes) : "0"); |
431 |
my $attributeString = ((@attributes > 0) ? join(" | ", @attributes) : "0"); |
| 438 |
|
432 |
|
| 439 |
if ($interface->extendedAttributes->{CustomNamedGetter}) { |
433 |
if ($interface->extendedAttributes->{CustomNamedGetter}) { |
| 440 |
push(@output, " JSValue value;\n"); |
434 |
push(@$outputArray, $indent . "JSValue value;\n"); |
| 441 |
push(@output, " if (thisObject->nameGetter(state, propertyName, value)) {\n"); |
435 |
push(@$outputArray, $indent . "if (thisObject->nameGetter(state, propertyName, value)) {\n"); |
| 442 |
push(@output, " slot.setValue(thisObject, ${attributeString}, value);\n"); |
436 |
push(@$outputArray, $indent . " slot.setValue(thisObject, ${attributeString}, value);\n"); |
| 443 |
} else { |
437 |
} else { |
| 444 |
my $namedGetterFunctionName = $namedGetterOperation->extendedAttributes->{ImplementedAs} || $namedGetterOperation->name || "namedItem"; |
438 |
my $namedGetterFunctionName = $namedGetterOperation->extendedAttributes->{ImplementedAs} || $namedGetterOperation->name || "namedItem"; |
| 445 |
my $itemVariable = "item"; |
439 |
my $itemVariable = "item"; |
| 446 |
push(@output, " auto item = thisObject->wrapped().${namedGetterFunctionName}(propertyNameToAtomicString(propertyName));\n"); |
440 |
push(@$outputArray, $indent . "auto item = thisObject->wrapped().${namedGetterFunctionName}(propertyNameToAtomicString(propertyName));\n"); |
| 447 |
|
441 |
|
| 448 |
if ($namedGetterOperation->extendedAttributes->{MayThrowException}) { |
442 |
if ($namedGetterOperation->extendedAttributes->{MayThrowException}) { |
| 449 |
push(@output, " if (item.hasException()) {\n"); |
443 |
push(@$outputArray, $indent . "if (item.hasException()) {\n"); |
| 450 |
push(@output, " auto throwScope = DECLARE_THROW_SCOPE(state->vm());\n"); |
444 |
push(@$outputArray, $indent . " auto throwScope = DECLARE_THROW_SCOPE(state->vm());\n"); |
| 451 |
push(@output, " propagateException(*state, throwScope, item.releaseException());\n"); |
445 |
push(@$outputArray, $indent . " propagateException(*state, throwScope, item.releaseException());\n"); |
| 452 |
push(@output, " return true;\n"); |
446 |
push(@$outputArray, $indent . " return true;\n"); |
| 453 |
push(@output, " }\n\n"); |
447 |
push(@$outputArray, $indent . "}\n\n"); |
| 454 |
push(@output, " auto itemValue = item.releaseReturnValue();\n"); |
448 |
push(@$outputArray, $indent . "auto itemValue = item.releaseReturnValue();\n"); |
| 455 |
|
449 |
|
| 456 |
$itemVariable = "itemValue"; |
450 |
$itemVariable = "itemValue"; |
| 457 |
} |
451 |
} |
| 458 |
|
452 |
|
| 459 |
my $IDLType = GetIDLType($interface, $namedGetterOperation->type); |
453 |
my $IDLType = GetIDLType($interface, $namedGetterOperation->type); |
| 460 |
push(@output, " if (!${IDLType}::isNullValue(${itemVariable})) {\n"); |
|
|
| 461 |
|
| 462 |
my $nativeToJSConversion = NativeToJSValueUsingPointers($namedGetterOperation, $interface, $itemVariable, "*thisObject->globalObject()", 1); |
454 |
my $nativeToJSConversion = NativeToJSValueUsingPointers($namedGetterOperation, $interface, $itemVariable, "*thisObject->globalObject()", 1); |
| 463 |
push(@output, " slot.setValue(thisObject, ${attributeString}, ${nativeToJSConversion});\n"); |
455 |
push(@$outputArray, $indent . "if (!${IDLType}::isNullValue(${itemVariable})) {\n"); |
|
|
456 |
push(@$outputArray, $indent . " slot.setValue(thisObject, ${attributeString}, ${nativeToJSConversion});\n"); |
| 464 |
} |
457 |
} |
| 465 |
|
458 |
|
| 466 |
push(@output, " return true;\n"); |
459 |
push(@$outputArray, $indent . " return true;\n"); |
| 467 |
push(@output, " }\n"); |
460 |
push(@$outputArray, $indent . "}\n"); |
| 468 |
|
|
|
| 469 |
return @output; |
| 470 |
} |
461 |
} |
| 471 |
|
462 |
|
| 472 |
sub GenerateGetOwnPropertySlotBody |
463 |
sub GenerateGetOwnPropertySlotBody |
| 473 |
{ |
464 |
{ |
| 474 |
my ($interface, $className, $indexedGetterOperation, $namedGetterOperation) = @_; |
465 |
my ($outputArray, $interface, $className) = @_; |
| 475 |
|
466 |
|
| 476 |
my @output = (); |
467 |
return if $interface->extendedAttributes->{CustomGetOwnPropertySlot}; |
| 477 |
|
468 |
|
|
|
469 |
my $namedGetterOperation = GetNamedGetterOperation($interface); |
| 470 |
my $indexedGetterOperation = GetIndexedGetterOperation($interface); |
| 471 |
|
| 478 |
my $ownPropertyCheck = sub { |
472 |
my $ownPropertyCheck = sub { |
| 479 |
push(@output, " if (Base::getOwnPropertySlot(thisObject, state, propertyName, slot))\n"); |
473 |
push(@$outputArray, " if (Base::getOwnPropertySlot(thisObject, state, propertyName, slot))\n"); |
| 480 |
push(@output, " return true;\n"); |
474 |
push(@$outputArray, " return true;\n"); |
| 481 |
}; |
475 |
}; |
| 482 |
|
476 |
|
| 483 |
# FIXME: As per the Web IDL specification, the prototype check is supposed to skip "named properties objects": |
477 |
# FIXME: As per the Web IDL specification, the prototype check is supposed to skip "named properties objects": |
| 484 |
# https://heycam.github.io/webidl/#dfn-named-property-visibility |
478 |
# https://heycam.github.io/webidl/#dfn-named-property-visibility |
| 485 |
# https://heycam.github.io/webidl/#dfn-named-properties-object |
479 |
# https://heycam.github.io/webidl/#dfn-named-properties-object |
| 486 |
my $prototypeCheck = sub { |
480 |
my $prototypeCheck = sub { |
| 487 |
push(@output, " JSValue proto = thisObject->getPrototypeDirect();\n"); |
481 |
push(@$outputArray, " JSValue proto = thisObject->getPrototypeDirect();\n"); |
| 488 |
push(@output, " if (proto.isObject() && jsCast<JSObject*>(proto)->hasProperty(state, propertyName))\n"); |
482 |
push(@$outputArray, " if (proto.isObject() && jsCast<JSObject*>(proto)->hasProperty(state, propertyName))\n"); |
| 489 |
push(@output, " return false;\n\n"); |
483 |
push(@$outputArray, " return false;\n\n"); |
| 490 |
}; |
484 |
}; |
| 491 |
|
485 |
|
| 492 |
push(@output, "bool ${className}::getOwnPropertySlot(JSObject* object, ExecState* state, PropertyName propertyName, PropertySlot& slot)\n"); |
486 |
push(@$outputArray, "bool ${className}::getOwnPropertySlot(JSObject* object, ExecState* state, PropertyName propertyName, PropertySlot& slot)\n"); |
| 493 |
push(@output, "{\n"); |
487 |
push(@$outputArray, "{\n"); |
| 494 |
push(@output, " auto* thisObject = jsCast<${className}*>(object);\n"); |
488 |
push(@$outputArray, " auto* thisObject = jsCast<${className}*>(object);\n"); |
| 495 |
push(@output, " ASSERT_GC_OBJECT_INHERITS(thisObject, info());\n"); |
489 |
push(@$outputArray, " ASSERT_GC_OBJECT_INHERITS(thisObject, info());\n"); |
| 496 |
|
490 |
|
| 497 |
|
491 |
|
| 498 |
if ($indexedGetterOperation) { |
492 |
if ($indexedGetterOperation) { |
| 499 |
push(@output, " auto optionalIndex = parseIndex(propertyName);\n"); |
493 |
push(@$outputArray, " auto optionalIndex = parseIndex(propertyName);\n"); |
| 500 |
push(@output, " if (optionalIndex && optionalIndex.value() < thisObject->wrapped().length()) {\n"); |
494 |
push(@$outputArray, " if (optionalIndex && optionalIndex.value() < thisObject->wrapped().length()) {\n"); |
| 501 |
push(@output, " auto index = optionalIndex.value();\n"); |
495 |
push(@$outputArray, " auto index = optionalIndex.value();\n"); |
| 502 |
push(@output, GenerateIndexedGetter($interface, $indexedGetterOperation)); |
496 |
GenerateIndexedGetter($outputArray, " ", $interface, $indexedGetterOperation); |
| 503 |
push(@output, " }\n"); |
497 |
push(@$outputArray, " }\n"); |
| 504 |
} |
498 |
} |
| 505 |
|
499 |
|
| 506 |
my $hasNamedGetter = $namedGetterOperation || $interface->extendedAttributes->{CustomNamedGetter}; |
500 |
my $hasNamedGetter = $namedGetterOperation || $interface->extendedAttributes->{CustomNamedGetter}; |
| 507 |
if ($hasNamedGetter) { |
501 |
if ($hasNamedGetter) { |
| 508 |
if (!$interface->extendedAttributes->{OverrideBuiltins}) { |
502 |
if (!$codeGenerator->InheritsExtendedAttribute($interface, "OverrideBuiltins")) { |
| 509 |
&$ownPropertyCheck(); |
503 |
&$ownPropertyCheck(); |
| 510 |
&$prototypeCheck(); |
504 |
&$prototypeCheck(); |
| 511 |
} |
505 |
} |
| 512 |
if ($indexedGetterOperation) { |
506 |
if ($indexedGetterOperation) { |
| 513 |
push(@output, " if (!optionalIndex && thisObject->classInfo() == info() && !propertyName.isSymbol()) {\n"); |
507 |
push(@$outputArray, " if (!optionalIndex && thisObject->classInfo() == info() && !propertyName.isSymbol()) {\n"); |
| 514 |
} else { |
508 |
} else { |
| 515 |
push(@output, " if (thisObject->classInfo() == info() && !propertyName.isSymbol()) {\n"); |
509 |
push(@$outputArray, " if (thisObject->classInfo() == info() && !propertyName.isSymbol()) {\n"); |
| 516 |
} |
510 |
} |
| 517 |
push(@output, GenerateNamedGetter($interface, $namedGetterOperation)); |
511 |
GenerateNamedGetter($outputArray, " ", $interface, $namedGetterOperation); |
| 518 |
push(@output, " }\n"); |
512 |
push(@$outputArray, " }\n"); |
| 519 |
} |
513 |
} |
| 520 |
|
514 |
|
| 521 |
if ($interface->extendedAttributes->{JSCustomGetOwnPropertySlotAndDescriptor}) { |
515 |
if ($interface->extendedAttributes->{CustomGetOwnPropertySlotAndDescriptor}) { |
| 522 |
push(@output, " if (thisObject->getOwnPropertySlotDelegate(state, propertyName, slot))\n"); |
516 |
push(@$outputArray, " if (thisObject->getOwnPropertySlotDelegate(state, propertyName, slot))\n"); |
| 523 |
push(@output, " return true;\n"); |
517 |
push(@$outputArray, " return true;\n"); |
| 524 |
} |
518 |
} |
| 525 |
|
519 |
|
| 526 |
if (!$hasNamedGetter || $interface->extendedAttributes->{OverrideBuiltins}) { |
520 |
if (!$hasNamedGetter || $codeGenerator->InheritsExtendedAttribute($interface, "OverrideBuiltins")) { |
| 527 |
&$ownPropertyCheck(); |
521 |
&$ownPropertyCheck(); |
| 528 |
} |
522 |
} |
| 529 |
|
523 |
|
| 530 |
push(@output, " return false;\n"); |
524 |
push(@$outputArray, " return false;\n"); |
| 531 |
push(@output, "}\n\n"); |
525 |
push(@$outputArray, "}\n\n"); |
| 532 |
|
|
|
| 533 |
return @output; |
| 534 |
} |
526 |
} |
| 535 |
|
527 |
|
| 536 |
sub GenerateGetOwnPropertySlotBodyByIndex |
528 |
sub GenerateGetOwnPropertySlotBodyByIndex |
| 537 |
{ |
529 |
{ |
| 538 |
my ($interface, $className, $indexedGetterOperation, $namedGetterOperation) = @_; |
530 |
my ($outputArray, $interface, $className) = @_; |
| 539 |
|
531 |
|
| 540 |
my @output = (); |
532 |
return if $interface->extendedAttributes->{CustomGetOwnPropertySlotByIndex}; |
| 541 |
|
533 |
|
| 542 |
push(@output, "bool ${className}::getOwnPropertySlotByIndex(JSObject* object, ExecState* state, unsigned index, PropertySlot& slot)\n"); |
534 |
my $namedGetterOperation = GetNamedGetterOperation($interface); |
| 543 |
push(@output, "{\n"); |
535 |
my $indexedGetterOperation = GetIndexedGetterOperation($interface); |
| 544 |
push(@output, " auto* thisObject = jsCast<${className}*>(object);\n"); |
536 |
|
| 545 |
push(@output, " ASSERT_GC_OBJECT_INHERITS(thisObject, info());\n"); |
537 |
push(@$outputArray, "bool ${className}::getOwnPropertySlotByIndex(JSObject* object, ExecState* state, unsigned index, PropertySlot& slot)\n"); |
|
|
538 |
push(@$outputArray, "{\n"); |
| 539 |
push(@$outputArray, " auto* thisObject = jsCast<${className}*>(object);\n"); |
| 540 |
push(@$outputArray, " ASSERT_GC_OBJECT_INHERITS(thisObject, info());\n"); |
| 546 |
|
541 |
|
| 547 |
# Sink the int-to-string conversion that happens when we create a PropertyName |
542 |
# Sink the int-to-string conversion that happens when we create a PropertyName |
| 548 |
# to the point where we actually need it. |
543 |
# to the point where we actually need it. |
|
Lines 551-605
sub GenerateGetOwnPropertySlotBodyByInde
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm_sec2
|
| 551 |
if ($generatedPropertyName) { |
546 |
if ($generatedPropertyName) { |
| 552 |
return; |
547 |
return; |
| 553 |
} |
548 |
} |
| 554 |
push(@output, " Identifier propertyName = Identifier::from(state, index);\n"); |
549 |
push(@$outputArray, " Identifier propertyName = Identifier::from(state, index);\n"); |
| 555 |
$generatedPropertyName = 1; |
550 |
$generatedPropertyName = 1; |
| 556 |
}; |
551 |
}; |
| 557 |
|
552 |
|
| 558 |
if ($indexedGetterOperation) { |
553 |
if ($indexedGetterOperation) { |
| 559 |
push(@output, " if (LIKELY(index < thisObject->wrapped().length())) {\n"); |
554 |
push(@$outputArray, " if (LIKELY(index < thisObject->wrapped().length())) {\n"); |
| 560 |
push(@output, GenerateIndexedGetter($interface, $indexedGetterOperation)); |
555 |
GenerateIndexedGetter($outputArray, " ", $interface, $indexedGetterOperation); |
| 561 |
push(@output, " }\n"); |
556 |
push(@$outputArray, " }\n"); |
| 562 |
} |
557 |
} |
| 563 |
|
558 |
|
| 564 |
# Indexing an object with an integer that is not a supported property index should not call the named property getter. |
559 |
# Indexing an object with an integer that is not a supported property index should not call the named property getter. |
| 565 |
# https://heycam.github.io/webidl/#idl-indexed-properties |
560 |
# https://heycam.github.io/webidl/#idl-indexed-properties |
| 566 |
if (!$indexedGetterOperation && ($namedGetterOperation || $interface->extendedAttributes->{CustomNamedGetter})) { |
561 |
if (!$indexedGetterOperation && ($namedGetterOperation || $interface->extendedAttributes->{CustomNamedGetter})) { |
| 567 |
&$propertyNameGeneration(); |
562 |
&$propertyNameGeneration(); |
| 568 |
push(@output, " if (thisObject->classInfo() == info()) {\n"); |
563 |
push(@$outputArray, " if (thisObject->classInfo() == info()) {\n"); |
| 569 |
push(@output, GenerateNamedGetter($interface, $namedGetterOperation)); |
564 |
GenerateNamedGetter($outputArray, " ", $interface, $namedGetterOperation); |
| 570 |
push(@output, " }\n"); |
565 |
push(@$outputArray, " }\n"); |
| 571 |
} |
566 |
} |
| 572 |
|
567 |
|
| 573 |
if ($interface->extendedAttributes->{JSCustomGetOwnPropertySlotAndDescriptor}) { |
568 |
if ($interface->extendedAttributes->{CustomGetOwnPropertySlotAndDescriptor}) { |
| 574 |
&$propertyNameGeneration(); |
569 |
&$propertyNameGeneration(); |
| 575 |
push(@output, " if (thisObject->getOwnPropertySlotDelegate(state, propertyName, slot))\n"); |
570 |
push(@$outputArray, " if (thisObject->getOwnPropertySlotDelegate(state, propertyName, slot))\n"); |
| 576 |
push(@output, " return true;\n"); |
571 |
push(@$outputArray, " return true;\n"); |
| 577 |
} |
572 |
} |
| 578 |
|
573 |
|
| 579 |
push(@output, " return Base::getOwnPropertySlotByIndex(thisObject, state, index, slot);\n"); |
574 |
push(@$outputArray, " return Base::getOwnPropertySlotByIndex(thisObject, state, index, slot);\n"); |
| 580 |
push(@output, "}\n\n"); |
575 |
push(@$outputArray, "}\n\n"); |
| 581 |
|
|
|
| 582 |
return @output; |
| 583 |
} |
576 |
} |
| 584 |
|
577 |
|
|
|
578 |
# https://heycam.github.io/webidl/#legacy-platform-object-property-enumeration |
| 585 |
sub GenerateGetOwnPropertyNames |
579 |
sub GenerateGetOwnPropertyNames |
| 586 |
{ |
580 |
{ |
| 587 |
my ($interface, $className, $indexedGetterOperation, $namedGetterOperation) = @_; |
581 |
my ($outputArray, $interface, $className) = @_; |
| 588 |
|
582 |
|
| 589 |
my @output = (); |
583 |
return if $interface->extendedAttributes->{CustomEnumerateProperty}; |
| 590 |
|
584 |
|
| 591 |
# Property enumeration - https://heycam.github.io/webidl/#legacy-platform-object-property-enumeration |
585 |
my $namedGetterOperation = GetNamedGetterOperation($interface); |
| 592 |
|
586 |
my $indexedGetterOperation = GetIndexedGetterOperation($interface); |
| 593 |
push(@implContent, "void ${className}::getOwnPropertyNames(JSObject* object, ExecState* state, PropertyNameArray& propertyNames, EnumerationMode mode)\n"); |
587 |
|
| 594 |
push(@implContent, "{\n"); |
588 |
push(@$outputArray, "void ${className}::getOwnPropertyNames(JSObject* object, ExecState* state, PropertyNameArray& propertyNames, EnumerationMode mode)\n"); |
| 595 |
push(@implContent, " auto* thisObject = jsCast<${className}*>(object);\n"); |
589 |
push(@$outputArray, "{\n"); |
| 596 |
push(@implContent, " ASSERT_GC_OBJECT_INHERITS(thisObject, info());\n"); |
590 |
push(@$outputArray, " auto* thisObject = jsCast<${className}*>(object);\n"); |
|
|
591 |
push(@$outputArray, " ASSERT_GC_OBJECT_INHERITS(thisObject, info());\n"); |
| 597 |
|
592 |
|
| 598 |
# 1. If the object supports indexed properties, then the object’s supported |
593 |
# 1. If the object supports indexed properties, then the object’s supported |
| 599 |
# property indices are enumerated first, in numerical order. |
594 |
# property indices are enumerated first, in numerical order. |
| 600 |
if ($indexedGetterOperation) { |
595 |
if ($indexedGetterOperation) { |
| 601 |
push(@implContent, " for (unsigned i = 0, count = thisObject->wrapped().length(); i < count; ++i)\n"); |
596 |
push(@$outputArray, " for (unsigned i = 0, count = thisObject->wrapped().length(); i < count; ++i)\n"); |
| 602 |
push(@implContent, " propertyNames.add(Identifier::from(state, i));\n"); |
597 |
push(@$outputArray, " propertyNames.add(Identifier::from(state, i));\n"); |
| 603 |
} |
598 |
} |
| 604 |
|
599 |
|
| 605 |
# 2. If the object supports named properties and doesn’t implement an interface |
600 |
# 2. If the object supports named properties and doesn’t implement an interface |
|
Lines 609-733
sub GenerateGetOwnPropertyNames
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm_sec3
|
| 609 |
# the definition of the set of supported property names. |
604 |
# the definition of the set of supported property names. |
| 610 |
if ($namedGetterOperation) { |
605 |
if ($namedGetterOperation) { |
| 611 |
if (!$interface->extendedAttributes->{LegacyUnenumerableNamedProperties}) { |
606 |
if (!$interface->extendedAttributes->{LegacyUnenumerableNamedProperties}) { |
| 612 |
push(@implContent, " for (auto& propertyName : thisObject->wrapped().supportedPropertyNames())\n"); |
607 |
push(@$outputArray, " for (auto& propertyName : thisObject->wrapped().supportedPropertyNames())\n"); |
| 613 |
push(@implContent, " propertyNames.add(Identifier::fromString(state, propertyName));\n"); |
608 |
push(@$outputArray, " propertyNames.add(Identifier::fromString(state, propertyName));\n"); |
| 614 |
} else { |
609 |
} else { |
| 615 |
push(@implContent, " if (mode.includeDontEnumProperties()) {\n"); |
610 |
push(@$outputArray, " if (mode.includeDontEnumProperties()) {\n"); |
| 616 |
push(@implContent, " for (auto& propertyName : thisObject->wrapped().supportedPropertyNames())\n"); |
611 |
push(@$outputArray, " for (auto& propertyName : thisObject->wrapped().supportedPropertyNames())\n"); |
| 617 |
push(@implContent, " propertyNames.add(Identifier::fromString(state, propertyName));\n"); |
612 |
push(@$outputArray, " propertyNames.add(Identifier::fromString(state, propertyName));\n"); |
| 618 |
push(@implContent, " }\n"); |
613 |
push(@$outputArray, " }\n"); |
| 619 |
} |
614 |
} |
| 620 |
} |
615 |
} |
|
|
616 |
|
| 621 |
# 3. Finally, any enumerable own properties or properties from the object’s |
617 |
# 3. Finally, any enumerable own properties or properties from the object’s |
| 622 |
# prototype chain are then enumerated, in no defined order. |
618 |
# prototype chain are then enumerated, in no defined order. |
| 623 |
push(@implContent, " Base::getOwnPropertyNames(thisObject, state, propertyNames, mode);\n"); |
619 |
push(@$outputArray, " Base::getOwnPropertyNames(thisObject, state, propertyNames, mode);\n"); |
| 624 |
push(@implContent, "}\n\n"); |
620 |
push(@$outputArray, "}\n\n"); |
| 625 |
|
|
|
| 626 |
return @output; |
| 627 |
} |
621 |
} |
| 628 |
|
622 |
|
| 629 |
sub GeneratePut |
623 |
# https://heycam.github.io/webidl/#invoke-indexed-setter |
|
|
624 |
sub GenerateInvokeIndexedPropertySetter |
| 630 |
{ |
625 |
{ |
| 631 |
my ($interface, $className, $indexedSetterOperation, $namedSetterOperation) = @_; |
626 |
my ($outputArray, $indent, $interface, $indexedSetterOperation, $indexExpression, $value) = @_; |
| 632 |
|
627 |
|
| 633 |
assert("Named setters are not supported.") if $namedSetterOperation; |
628 |
# The second argument of the indexed setter operation is the argument being converted. |
|
|
629 |
my $argument = @{$indexedSetterOperation->arguments}[1]; |
| 630 |
my $nativeValue = JSValueToNative($interface, $argument, $value, $indexedSetterOperation->extendedAttributes->{Conditional}, "state", "*state", "thisObject", "", ""); |
| 631 |
|
| 632 |
push(@$outputArray, $indent . "auto throwScope = DECLARE_THROW_SCOPE(state->vm());\n"); |
| 633 |
push(@$outputArray, $indent . "auto nativeValue = ${nativeValue};\n"); |
| 634 |
push(@$outputArray, $indent . "RETURN_IF_EXCEPTION(throwScope, true);\n"); |
| 635 |
|
| 636 |
my $indexedSetterFunctionName = $indexedSetterOperation->name || "setItem"; |
| 637 |
my $nativeValuePassExpression = PassArgumentExpression("nativeValue", $argument); |
| 638 |
my $functionString = "thisObject->wrapped().${indexedSetterFunctionName}(${indexExpression}, ${nativeValuePassExpression})"; |
| 639 |
$functionString = "propagateException(*state, throwScope, ${functionString})" if NeedsExplicitPropagateExceptionCall($indexedSetterOperation); |
| 640 |
|
| 641 |
push(@$outputArray, $indent . $functionString . ";\n"); |
| 642 |
} |
| 634 |
|
643 |
|
| 635 |
my @output = (); |
644 |
# https://heycam.github.io/webidl/#invoke-named-setter |
|
|
645 |
sub GenerateInvokeNamedPropertySetter |
| 646 |
{ |
| 647 |
my ($outputArray, $indent, $interface, $namedSetterOperation, $value) = @_; |
| 648 |
|
| 649 |
my $argument = @{$namedSetterOperation->arguments}[1]; |
| 650 |
my $nativeValue = JSValueToNative($interface, $argument, $value, $namedSetterOperation->extendedAttributes->{Conditional}, "state", "*state", "thisObject", "", ""); |
| 651 |
|
| 652 |
push(@$outputArray, $indent . "auto throwScope = DECLARE_THROW_SCOPE(state->vm());\n"); |
| 653 |
push(@$outputArray, $indent . "auto nativeValue = ${nativeValue};\n"); |
| 654 |
push(@$outputArray, $indent . "RETURN_IF_EXCEPTION(throwScope, true);\n"); |
| 655 |
|
| 656 |
my $namedSetterFunctionName = $namedSetterOperation->name || "setNamedItem"; |
| 657 |
my $nativeValuePassExpression = PassArgumentExpression("nativeValue", $argument); |
| 658 |
my $functionString = "thisObject->wrapped().${namedSetterFunctionName}(propertyNameToString(propertyName), ${nativeValuePassExpression})"; |
| 659 |
$functionString = "propagateException(*state, throwScope, ${functionString})" if NeedsExplicitPropagateExceptionCall($namedSetterOperation); |
| 660 |
|
| 661 |
push(@$outputArray, $indent . $functionString . ";\n"); |
| 662 |
} |
| 636 |
|
663 |
|
| 637 |
push(@output, "bool ${className}::put(JSCell* cell, ExecState* state, PropertyName propertyName, JSValue value, PutPropertySlot& slot)\n"); |
664 |
sub GeneratePut |
| 638 |
push(@output, "{\n"); |
665 |
{ |
| 639 |
push(@output, " auto* thisObject = jsCast<${className}*>(cell);\n"); |
666 |
my ($outputArray, $interface, $className) = @_; |
| 640 |
push(@output, " ASSERT_GC_OBJECT_INHERITS(thisObject, info());\n"); |
667 |
|
| 641 |
|
668 |
return if $interface->extendedAttributes->{CustomPutFunction}; |
| 642 |
if ($indexedSetterOperation || $interface->extendedAttributes->{CustomIndexedSetter}) { |
669 |
|
| 643 |
if ($interface->extendedAttributes->{CustomIndexedSetter}) { |
670 |
my $namedSetterOperation = GetNamedSetterOperation($interface); |
| 644 |
push(@output, " if (auto index = parseIndex(propertyName)) {\n"); |
671 |
my $indexedSetterOperation = GetIndexedSetterOperation($interface); |
| 645 |
push(@output, " thisObject->indexSetter(state, index.value(), value);\n"); |
672 |
|
| 646 |
push(@output, " return true;\n"); |
673 |
push(@$outputArray, "bool ${className}::put(JSCell* cell, ExecState* state, PropertyName propertyName, JSValue value, PutPropertySlot& putPropertySlot)\n"); |
| 647 |
push(@output, " }\n"); |
674 |
push(@$outputArray, "{\n"); |
| 648 |
} else { |
675 |
push(@$outputArray, " auto* thisObject = jsCast<${className}*>(cell);\n"); |
| 649 |
# The second argument of the indexed setter operation is the argument being converted. |
676 |
push(@$outputArray, " ASSERT_GC_OBJECT_INHERITS(thisObject, info());\n\n"); |
| 650 |
my $argument = @{$indexedSetterOperation->arguments}[1]; |
677 |
|
| 651 |
my $nativeValue = JSValueToNative($interface, $argument, "value", $indexedSetterOperation->extendedAttributes->{Conditional}, "state", "*state", "thisObject", "", ""); |
678 |
if (($namedSetterOperation && $namedSetterOperation->extendedAttributes->{CEReactions}) || ($indexedSetterOperation && $indexedSetterOperation->extendedAttributes->{CEReactions})) { |
| 652 |
|
679 |
push(@$outputArray, " CustomElementReactionStack customElementReactionStack;\n\n"); |
| 653 |
push(@output, " if (auto index = parseIndex(propertyName)) {\n"); |
680 |
AddToImplIncludes("CustomElementReactionQueue.h"); |
| 654 |
push(@output, " auto throwScope = DECLARE_THROW_SCOPE(state->vm());\n"); |
681 |
} |
| 655 |
push(@output, " auto nativeValue = ${nativeValue};\n"); |
682 |
|
| 656 |
push(@output, " RETURN_IF_EXCEPTION(throwScope, true);\n"); |
683 |
if ($indexedSetterOperation) { |
| 657 |
|
684 |
push(@$outputArray, " if (auto index = parseIndex(propertyName)) {\n"); |
| 658 |
my $indexedSetterFunctionName = $indexedSetterOperation->name || "setItem"; |
685 |
|
| 659 |
my $functionString = "${indexedSetterFunctionName}(index, WTFMove(nativeValue))"; |
686 |
GenerateInvokeIndexedPropertySetter($outputArray, " ", $interface, $indexedSetterOperation, "index.value()", "value"); |
| 660 |
$functionString = "propagateException(*state, throwScope, ${functionString})" if NeedsExplicitPropagateExceptionCall($indexedSetterOperation); |
687 |
|
| 661 |
|
688 |
push(@$outputArray, " return true;\n"); |
| 662 |
push(@output, " ${functionString};\n"); |
689 |
push(@$outputArray, " }\n\n"); |
| 663 |
push(@output, " return true;\n"); |
690 |
} |
| 664 |
push(@output, " }\n"); |
691 |
|
|
|
692 |
if ($namedSetterOperation) { |
| 693 |
# FIMXE: We need a more comprehensive story for Symbols. |
| 694 |
push(@$outputArray, " if (!propertyName.isSymbol()) {\n"); |
| 695 |
|
| 696 |
my $additionalIndent = ""; |
| 697 |
|
| 698 |
my $overrideBuiltins = $codeGenerator->InheritsExtendedAttribute($interface, "OverrideBuiltins"); |
| 699 |
if (!$overrideBuiltins) { |
| 700 |
push(@$outputArray, " PropertySlot slot { thisObject, PropertySlot::InternalMethodType::VMInquiry };\n"); |
| 701 |
push(@$outputArray, " JSValue prototype = thisObject->getPrototypeDirect();\n"); |
| 702 |
push(@$outputArray, " if (!(prototype.isObject() && asObject(prototype)->getPropertySlot(state, propertyName, slot))) {\n"); |
| 703 |
$additionalIndent .= " "; |
| 665 |
} |
704 |
} |
|
|
705 |
|
| 706 |
GenerateInvokeNamedPropertySetter($outputArray, $additionalIndent . " ", $interface, $namedSetterOperation, "value"); |
| 707 |
push(@$outputArray, $additionalIndent . " return true;\n"); |
| 708 |
|
| 709 |
if (!$overrideBuiltins) { |
| 710 |
push(@$outputArray, " }\n"); |
| 711 |
} |
| 712 |
|
| 713 |
push(@$outputArray, " }\n\n"); |
| 666 |
} |
714 |
} |
| 667 |
|
715 |
|
|
|
716 |
assert("Using both a named property setter and [CustomNamedSetter] together is not supported.") if $namedSetterOperation && $interface->extendedAttributes->{CustomNamedSetter}; |
| 668 |
if ($interface->extendedAttributes->{CustomNamedSetter}) { |
717 |
if ($interface->extendedAttributes->{CustomNamedSetter}) { |
| 669 |
push(@output, " bool putResult = false;\n"); |
718 |
push(@$outputArray, " bool putResult = false;\n"); |
| 670 |
push(@output, " if (thisObject->putDelegate(state, propertyName, value, slot, putResult))\n"); |
719 |
push(@$outputArray, " if (thisObject->putDelegate(state, propertyName, value, putPropertySlot, putResult))\n"); |
| 671 |
push(@output, " return putResult;\n"); |
720 |
push(@$outputArray, " return putResult;\n\n"); |
| 672 |
} |
721 |
} |
| 673 |
|
722 |
|
| 674 |
push(@output, " return Base::put(thisObject, state, propertyName, value, slot);\n"); |
723 |
push(@$outputArray, " return Base::put(thisObject, state, propertyName, value, putPropertySlot);\n"); |
| 675 |
push(@output, "}\n\n"); |
724 |
push(@$outputArray, "}\n\n"); |
| 676 |
|
|
|
| 677 |
return @output; |
| 678 |
} |
725 |
} |
| 679 |
|
726 |
|
| 680 |
sub GeneratePutByIndex |
727 |
sub GeneratePutByIndex |
| 681 |
{ |
728 |
{ |
| 682 |
my ($interface, $className, $indexedSetterOperation, $namedSetterOperation) = @_; |
729 |
my ($outputArray, $interface, $className) = @_; |
| 683 |
|
730 |
|
| 684 |
assert("Named setters are not supported.") if $namedSetterOperation; |
731 |
return if $interface->extendedAttributes->{CustomPutFunction}; |
| 685 |
|
732 |
|
| 686 |
my @output = (); |
733 |
my $namedSetterOperation = GetNamedSetterOperation($interface); |
| 687 |
|
734 |
my $indexedSetterOperation = GetIndexedSetterOperation($interface); |
| 688 |
push(@output, "bool ${className}::putByIndex(JSCell* cell, ExecState* state, unsigned index, JSValue value, bool shouldThrow)\n"); |
735 |
|
| 689 |
push(@output, "{\n"); |
736 |
my $overrideBuiltins = $codeGenerator->InheritsExtendedAttribute($interface, "OverrideBuiltins"); |
| 690 |
push(@output, " auto* thisObject = jsCast<${className}*>(cell);\n"); |
737 |
my $ellidesCallsToBase = ($namedSetterOperation && $overrideBuiltins) && !$interface->extendedAttributes->{CustomNamedSetter}; |
| 691 |
push(@output, " ASSERT_GC_OBJECT_INHERITS(thisObject, info());\n"); |
738 |
|
| 692 |
|
739 |
push(@$outputArray, "bool ${className}::putByIndex(JSCell* cell, ExecState* state, unsigned index, JSValue value, bool" . (!$ellidesCallsToBase ? " shouldThrow" : "") . ")\n"); |
| 693 |
if ($indexedSetterOperation || $interface->extendedAttributes->{CustomIndexedSetter}) { |
740 |
push(@$outputArray, "{\n"); |
| 694 |
if ($interface->extendedAttributes->{CustomIndexedSetter}) { |
741 |
push(@$outputArray, " auto* thisObject = jsCast<${className}*>(cell);\n"); |
| 695 |
push(@output, " if (LIKELY(index <= MAX_ARRAY_INDEX)) {\n"); |
742 |
push(@$outputArray, " ASSERT_GC_OBJECT_INHERITS(thisObject, info());\n\n"); |
| 696 |
push(@output, " thisObject->indexSetter(state, index, value);\n"); |
743 |
|
| 697 |
push(@output, " return true;\n"); |
744 |
if (($namedSetterOperation && $namedSetterOperation->extendedAttributes->{CEReactions}) || ($indexedSetterOperation && $indexedSetterOperation->extendedAttributes->{CEReactions})) { |
| 698 |
push(@output, " }\n"); |
745 |
push(@$outputArray, " CustomElementReactionStack customElementReactionStack;\n\n"); |
| 699 |
} else { |
746 |
AddToImplIncludes("CustomElementReactionQueue.h"); |
| 700 |
# The second argument of the indexed setter operation is the argument being converted. |
747 |
} |
| 701 |
my $argument = @{$indexedSetterOperation->arguments}[1]; |
748 |
|
| 702 |
my $nativeValue = JSValueToNative($interface, $argument, "value", $indexedSetterOperation->extendedAttributes->{Conditional}, "state", "*state", "thisObject", "", ""); |
749 |
if ($indexedSetterOperation ) { |
| 703 |
|
750 |
push(@$outputArray, " if (LIKELY(index <= MAX_ARRAY_INDEX)) {\n"); |
| 704 |
push(@output, " if (LIKELY(index <= MAX_ARRAY_INDEX)) {\n"); |
751 |
|
| 705 |
push(@output, " auto throwScope = DECLARE_THROW_SCOPE(state->vm());\n"); |
752 |
GenerateInvokeIndexedPropertySetter($outputArray, " ", $interface, $indexedSetterOperation, "index", "value"); |
| 706 |
push(@output, " auto nativeValue = ${nativeValue};\n"); |
753 |
|
| 707 |
push(@output, " RETURN_IF_EXCEPTION(throwScope, true);\n"); |
754 |
push(@$outputArray, " return true;\n"); |
| 708 |
|
755 |
push(@$outputArray, " }\n\n"); |
| 709 |
my $indexedSetterFunctionName = $indexedSetterOperation->name || "setItem"; |
756 |
} |
| 710 |
my $functionString = "${indexedSetterFunctionName}(index, WTFMove(nativeValue))"; |
757 |
|
| 711 |
$functionString = "propagateException(*state, throwScope, ${functionString})" if NeedsExplicitPropagateExceptionCall($indexedSetterOperation); |
758 |
if ($namedSetterOperation) { |
| 712 |
|
759 |
push(@$outputArray, " Identifier propertyName = Identifier::from(state, index);\n"); |
| 713 |
push(@output, " ${functionString};\n"); |
760 |
|
| 714 |
push(@output, " return true;\n"); |
761 |
my $additionalIndent = ""; |
| 715 |
push(@output, " }\n"); |
762 |
if (!$overrideBuiltins) { |
|
|
763 |
push(@$outputArray, " PropertySlot slot { thisObject, PropertySlot::InternalMethodType::VMInquiry };\n"); |
| 764 |
push(@$outputArray, " JSValue prototype = thisObject->getPrototypeDirect();\n"); |
| 765 |
push(@$outputArray, " if (!(prototype.isObject() && asObject(prototype)->getPropertySlot(state, propertyName, slot))) {\n"); |
| 766 |
$additionalIndent .= " "; |
| 767 |
} |
| 768 |
|
| 769 |
GenerateInvokeNamedPropertySetter($outputArray, $additionalIndent . " ", $interface, $namedSetterOperation, "value"); |
| 770 |
push(@$outputArray, $additionalIndent . " return true;\n"); |
| 771 |
|
| 772 |
if (!$overrideBuiltins) { |
| 773 |
push(@$outputArray, " }\n\n"); |
| 716 |
} |
774 |
} |
| 717 |
} |
775 |
} |
| 718 |
|
776 |
|
|
|
777 |
assert("Using both a named property setter and [CustomNamedSetter] together is not supported.") if $namedSetterOperation && $interface->extendedAttributes->{CustomNamedSetter}; |
| 719 |
if ($interface->extendedAttributes->{CustomNamedSetter}) { |
778 |
if ($interface->extendedAttributes->{CustomNamedSetter}) { |
| 720 |
push(@output, " Identifier propertyName = Identifier::from(state, index);\n"); |
779 |
push(@$outputArray, " Identifier propertyName = Identifier::from(state, index);\n"); |
| 721 |
push(@output, " PutPropertySlot slot(thisObject, shouldThrow);\n"); |
780 |
push(@$outputArray, " PutPropertySlot slot(thisObject, shouldThrow);\n"); |
| 722 |
push(@output, " bool putResult = false;\n"); |
781 |
push(@$outputArray, " bool putResult = false;\n"); |
| 723 |
push(@output, " if (thisObject->putDelegate(state, propertyName, value, slot, putResult))\n"); |
782 |
push(@$outputArray, " if (thisObject->putDelegate(state, propertyName, value, slot, putResult))\n"); |
| 724 |
push(@output, " return putResult;\n"); |
783 |
push(@$outputArray, " return putResult;\n\n"); |
| 725 |
} |
784 |
} |
|
|
785 |
|
| 786 |
if (!$ellidesCallsToBase) { |
| 787 |
push(@$outputArray, " return Base::putByIndex(cell, state, index, value, shouldThrow);\n"); |
| 788 |
} |
| 789 |
|
| 790 |
push(@$outputArray, "}\n\n"); |
| 791 |
} |
| 726 |
|
792 |
|
| 727 |
push(@output, " return Base::putByIndex(cell, state, index, value, shouldThrow);\n"); |
793 |
sub GenerateIsUnforgeablePropertyName |
| 728 |
push(@output, "}\n\n"); |
794 |
{ |
|
|
795 |
my ($outputArray, $interface) = @_; |
| 796 |
|
| 797 |
my @unforgeablePropertyNames = (); |
| 798 |
foreach my $property (@{$interface->attributes}, @{$interface->operations}) { |
| 799 |
next if $property->isStatic; |
| 800 |
|
| 801 |
if (IsUnforgeable($interface, $property)) { |
| 802 |
push (@unforgeablePropertyNames, $property->name); |
| 803 |
} |
| 804 |
} |
| 805 |
|
| 806 |
return 0 if (scalar(@unforgeablePropertyNames) == 0); |
| 807 |
|
| 808 |
my $condition = join(" || ", map { "propertyName == \"" . $_ . "\"" } @unforgeablePropertyNames); |
| 809 |
|
| 810 |
push(@$outputArray, "static bool isUnforgeablePropertyName(PropertyName propertyName)\n"); |
| 811 |
push(@$outputArray, "{\n"); |
| 812 |
push(@$outputArray, " return ${condition};\n"); |
| 813 |
push(@$outputArray, "}\n\n"); |
| 814 |
|
| 815 |
return 1; |
| 816 |
} |
| 729 |
|
817 |
|
| 730 |
return @output; |
818 |
# https://heycam.github.io/webidl/#legacy-platform-object-defineownproperty |
|
|
819 |
sub GenerateDefineOwnProperty |
| 820 |
{ |
| 821 |
my ($outputArray, $interface, $className) = @_; |
| 822 |
|
| 823 |
return if $interface->extendedAttributes->{CustomDefineOwnProperty}; |
| 824 |
|
| 825 |
my $namedSetterOperation = GetNamedSetterOperation($interface); |
| 826 |
my $indexedSetterOperation = GetIndexedSetterOperation($interface); |
| 827 |
|
| 828 |
return if !$namedSetterOperation && !$indexedSetterOperation; |
| 829 |
|
| 830 |
push(@$outputArray, "bool ${className}::defineOwnProperty(JSObject* object, ExecState* state, PropertyName propertyName, const PropertyDescriptor& propertyDescriptor, bool shouldThrow)\n"); |
| 831 |
push(@$outputArray, "{\n"); |
| 832 |
push(@$outputArray, " auto* thisObject = jsCast<${className}*>(object);\n"); |
| 833 |
push(@$outputArray, " ASSERT_GC_OBJECT_INHERITS(thisObject, info());\n\n"); |
| 834 |
|
| 835 |
if (($namedSetterOperation && $namedSetterOperation->extendedAttributes->{CEReactions}) || ($indexedSetterOperation && $indexedSetterOperation->extendedAttributes->{CEReactions})) { |
| 836 |
push(@$outputArray, " CustomElementReactionStack customElementReactionStack;\n\n"); |
| 837 |
AddToImplIncludes("CustomElementReactionQueue.h"); |
| 838 |
} |
| 839 |
|
| 840 |
# 1. If O supports indexed properties and P is an array index property name, then: |
| 841 |
if (GetIndexedGetterOperation($interface)) { |
| 842 |
push(@$outputArray, " if (auto index = parseIndex(propertyName)) {\n"); |
| 843 |
|
| 844 |
# NOTE: The numbers are out of order because there is no reason doing steps 1, 3, and 4 if there |
| 845 |
# is no indexed property setter. |
| 846 |
|
| 847 |
if (!$indexedSetterOperation) { |
| 848 |
# 2. If O does not implement an interface with an indexed property setter, then return false. |
| 849 |
push(@$outputArray, " return false;\n"); |
| 850 |
} else { |
| 851 |
# 1. If the result of calling IsDataDescriptor(Desc) is false, then return false. |
| 852 |
push(@$outputArray, " if (!propertyDescriptor.isDataDescriptor())\n"); |
| 853 |
push(@$outputArray, " return false;\n"); |
| 854 |
|
| 855 |
# 3. Invoke the indexed property setter with P and Desc.[[Value]]. |
| 856 |
GenerateInvokeIndexedPropertySetter($outputArray, " ", $interface, $indexedSetterOperation, "index.value()", "propertyDescriptor.value()"); |
| 857 |
|
| 858 |
# 4. Return true. |
| 859 |
push(@$outputArray, " return true;\n"); |
| 860 |
} |
| 861 |
push(@$outputArray, " }\n\n"); |
| 862 |
} |
| 863 |
|
| 864 |
# 2. If O supports named properties, O does not implement an interface with the [Global] or [PrimaryGlobal] |
| 865 |
# extended attribute and P is not an unforgeable property name of O, then: |
| 866 |
if (GetNamedGetterOperation($interface) && !IsGlobalOrPrimaryGlobalInterface($interface)) { |
| 867 |
# FIMXE: We need a more comprehensive story for Symbols. |
| 868 |
push(@$outputArray, " if (!propertyName.isSymbol()) {\n"); |
| 869 |
|
| 870 |
my $additionalIndent = ""; |
| 871 |
|
| 872 |
my $hasUnforgableProperties = GenerateIsUnforgeablePropertyName($outputArray, $interface); |
| 873 |
if ($hasUnforgableProperties) { |
| 874 |
push(@$outputArray, " if (!isUnforgeablePropertyName(propertyName)) {\n"); |
| 875 |
$additionalIndent .= " "; |
| 876 |
} |
| 877 |
|
| 878 |
# 1. Let creating be true if P is not a supported property name, and false otherwise. |
| 879 |
# NOTE: This step is strength reduced into the only use of 'creating' in step 2.2.1 |
| 880 |
|
| 881 |
# 2. If O implements an interface with the [OverrideBuiltins] extended attribute or O |
| 882 |
# does not have an own property named P, then: |
| 883 |
my $overrideBuiltins = $codeGenerator->InheritsExtendedAttribute($interface, "OverrideBuiltins"); |
| 884 |
if (!$overrideBuiltins) { |
| 885 |
# FIXME: Is Base::getOwnPropertySlot the right function to call? Is there a function that will |
| 886 |
# only look at the actual properties, and not call into our implementation of the |
| 887 |
# [[GetOwnProperty]] hook? |
| 888 |
push(@$outputArray, $additionalIndent. " PropertySlot slot { thisObject, PropertySlot::InternalMethodType::VMInquiry };\n"); |
| 889 |
push(@$outputArray, $additionalIndent. " if (!Base::getOwnPropertySlot(thisObject, state, propertyName, slot)) {\n"); |
| 890 |
$additionalIndent .= " "; |
| 891 |
} |
| 892 |
if (!$namedSetterOperation) { |
| 893 |
# 2.1. If creating is false and O does not implement an interface with a named property setter, then return false. |
| 894 |
push(@$outputArray, $additionalIndent . " if (thisObject->wrapped().isSupportedPropertyName(propertyNameToString(propertyName)))\n"); |
| 895 |
push(@$outputArray, $additionalIndent . " return false;\n"); |
| 896 |
} else { |
| 897 |
# 2.2. If O implements an interface with a named property setter, then: |
| 898 |
|
| 899 |
# 2.2.1. If the result of calling IsDataDescriptor(Desc) is false, then return false. |
| 900 |
push(@$outputArray, $additionalIndent . " if (!propertyDescriptor.isDataDescriptor())\n"); |
| 901 |
push(@$outputArray, $additionalIndent . " return false;\n"); |
| 902 |
|
| 903 |
# 2.2.2. Invoke the named property setter with P and Desc.[[Value]]. |
| 904 |
GenerateInvokeNamedPropertySetter($outputArray, $additionalIndent . " ", $interface, $namedSetterOperation, "propertyDescriptor.value()"); |
| 905 |
|
| 906 |
# 2.2.3. Return true. |
| 907 |
push(@$outputArray, $additionalIndent . " return true;\n"); |
| 908 |
} |
| 909 |
|
| 910 |
if (!$overrideBuiltins) { |
| 911 |
push(@$outputArray, $additionalIndent . " }\n"); |
| 912 |
} |
| 913 |
|
| 914 |
if ($hasUnforgableProperties) { |
| 915 |
push(@$outputArray, " }\n"); |
| 916 |
} |
| 917 |
|
| 918 |
# Close the !propertyName.isSymbol() condition. |
| 919 |
push(@$outputArray, " }\n\n"); |
| 920 |
} |
| 921 |
|
| 922 |
push(@$outputArray, " PropertyDescriptor newPropertyDescriptor = propertyDescriptor;\n"); |
| 923 |
|
| 924 |
# 3. If O does not implement an interface with the [Global] or [PrimaryGlobal] extended attribute, |
| 925 |
# then set Desc.[[Configurable]] to true. |
| 926 |
if (!IsGlobalOrPrimaryGlobalInterface($interface)) { |
| 927 |
push(@$outputArray, " newPropertyDescriptor.setConfigurable(true);\n"); |
| 928 |
} |
| 929 |
|
| 930 |
# 4. Return OrdinaryDefineOwnProperty(O, P, Desc). |
| 931 |
# FIXME: Does this do the same thing? |
| 932 |
push(@$outputArray, " return Base::defineOwnProperty(object, state, propertyName, configurablePropertyDescriptor, shouldThrow);\n"); |
| 933 |
|
| 934 |
push(@$outputArray, "}\n\n"); |
| 731 |
} |
935 |
} |
| 732 |
|
936 |
|
| 733 |
sub GenerateDeletePropertyCommon |
937 |
sub GenerateDeletePropertyCommon |
|
Lines 745-751
sub GenerateDeletePropertyCommon
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm_sec4
|
| 745 |
assert("Named property deleters are not allowed on global object interfaces.") if IsGlobalOrPrimaryGlobalInterface($interface); |
949 |
assert("Named property deleters are not allowed on global object interfaces.") if IsGlobalOrPrimaryGlobalInterface($interface); |
| 746 |
|
950 |
|
| 747 |
AddToImplIncludes("JSDOMAbstractOperations.h", $conditional); |
951 |
AddToImplIncludes("JSDOMAbstractOperations.h", $conditional); |
| 748 |
my $overrideBuiltin = $interface->extendedAttributes->{OverrideBuiltins} ? "true" : "false"; |
952 |
my $overrideBuiltin = $codeGenerator->InheritsExtendedAttribute($interface, "OverrideBuiltins") ? "true" : "false"; |
| 749 |
push(@$outputArray, " if (isVisibleNamedProperty<${overrideBuiltin}>(*state, thisObject, propertyName)) {\n"); |
953 |
push(@$outputArray, " if (isVisibleNamedProperty<${overrideBuiltin}>(*state, thisObject, propertyName)) {\n"); |
| 750 |
|
954 |
|
| 751 |
if ($operation->extendedAttributes->{CEReactions}) { |
955 |
if ($operation->extendedAttributes->{CEReactions}) { |
|
Lines 877-898
sub GenerateDeletePropertyByIndexDefinit
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm_sec5
|
| 877 |
|
1081 |
|
| 878 |
sub GenerateNamedDeleterDefinition |
1082 |
sub GenerateNamedDeleterDefinition |
| 879 |
{ |
1083 |
{ |
| 880 |
my ($outputArray, $interface, $className, $operation) = @_; |
1084 |
my ($outputArray, $interface, $className) = @_; |
|
|
1085 |
|
| 1086 |
return if $interface->extendedAttributes->{CustomDeleteProperty}; |
| 881 |
|
1087 |
|
|
|
1088 |
my $namedDeleterOperation = GetNamedDeleterOperation($interface); |
| 1089 |
|
| 882 |
# This implements https://heycam.github.io/webidl/#legacy-platform-object-delete using |
1090 |
# This implements https://heycam.github.io/webidl/#legacy-platform-object-delete using |
| 883 |
# the deleteProperty and deletePropertyByIndex override hooks. |
1091 |
# the deleteProperty and deletePropertyByIndex override hooks. |
| 884 |
|
1092 |
|
| 885 |
assert("Named property deleters are not allowed without a corresponding named property getter.") if !GetNamedGetterOperation($interface); |
1093 |
assert("Named property deleters are not allowed without a corresponding named property getter.") if !GetNamedGetterOperation($interface); |
| 886 |
assert("Named property deleters are not allowed on global object interfaces.") if IsGlobalOrPrimaryGlobalInterface($interface); |
1094 |
assert("Named property deleters are not allowed on global object interfaces.") if IsGlobalOrPrimaryGlobalInterface($interface); |
| 887 |
|
1095 |
|
| 888 |
my $conditional = $operation->extendedAttributes->{Conditional}; |
1096 |
my $conditional = $namedDeleterOperation->extendedAttributes->{Conditional}; |
| 889 |
if ($conditional) { |
1097 |
if ($conditional) { |
| 890 |
my $conditionalString = $codeGenerator->GenerateConditionalStringFromAttributeValue($conditional); |
1098 |
my $conditionalString = $codeGenerator->GenerateConditionalStringFromAttributeValue($conditional); |
| 891 |
push(@$outputArray, "#if ${conditionalString}\n\n");; |
1099 |
push(@$outputArray, "#if ${conditionalString}\n\n");; |
| 892 |
} |
1100 |
} |
| 893 |
|
1101 |
|
| 894 |
GenerateDeletePropertyDefinition($outputArray, $interface, $className, $operation, $conditional); |
1102 |
GenerateDeletePropertyDefinition($outputArray, $interface, $className, $namedDeleterOperation, $conditional); |
| 895 |
GenerateDeletePropertyByIndexDefinition($outputArray, $interface, $className, $operation, $conditional); |
1103 |
GenerateDeletePropertyByIndexDefinition($outputArray, $interface, $className, $namedDeleterOperation, $conditional); |
| 896 |
|
1104 |
|
| 897 |
push(@implContent, "#endif\n\n") if $conditional; |
1105 |
push(@implContent, "#endif\n\n") if $conditional; |
| 898 |
} |
1106 |
} |
|
Lines 1108-1121
sub GetSpecialAccessorOperationForType
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm_sec6
|
| 1108 |
return 0; |
1316 |
return 0; |
| 1109 |
} |
1317 |
} |
| 1110 |
|
1318 |
|
| 1111 |
sub HasComplexGetOwnProperty |
|
|
| 1112 |
{ |
| 1113 |
my $interface = shift; |
| 1114 |
return $interface->extendedAttributes->{CheckSecurity} |
| 1115 |
|| IsDOMGlobalObject($interface) |
| 1116 |
|| InstanceOverridesGetOwnPropertySlot($interface); |
| 1117 |
} |
| 1118 |
|
| 1119 |
sub IsGlobalOrPrimaryGlobalInterface |
1319 |
sub IsGlobalOrPrimaryGlobalInterface |
| 1120 |
{ |
1320 |
{ |
| 1121 |
my $interface = shift; |
1321 |
my $interface = shift; |
|
Lines 1306-1312
sub InstanceOverridesGetOwnPropertySlot
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm_sec7
|
| 1306 |
my $interface = shift; |
1506 |
my $interface = shift; |
| 1307 |
return $interface->extendedAttributes->{CustomGetOwnPropertySlot} |
1507 |
return $interface->extendedAttributes->{CustomGetOwnPropertySlot} |
| 1308 |
|| $interface->extendedAttributes->{CustomNamedGetter} |
1508 |
|| $interface->extendedAttributes->{CustomNamedGetter} |
| 1309 |
|| $interface->extendedAttributes->{JSCustomGetOwnPropertySlotAndDescriptor} |
1509 |
|| $interface->extendedAttributes->{CustomGetOwnPropertySlotAndDescriptor} |
|
|
1510 |
|| GetIndexedGetterOperation($interface) |
| 1511 |
|| GetNamedGetterOperation($interface); |
| 1512 |
} |
| 1513 |
|
| 1514 |
sub InstanceOverridesGetOwnPropertySlotByIndex |
| 1515 |
{ |
| 1516 |
my $interface = shift; |
| 1517 |
return $interface->extendedAttributes->{CustomGetOwnPropertySlotByIndex} |
| 1518 |
|| $interface->extendedAttributes->{CustomNamedGetter} |
| 1519 |
|| $interface->extendedAttributes->{CustomGetOwnPropertySlotAndDescriptor} |
| 1520 |
|| GetIndexedGetterOperation($interface) |
| 1521 |
|| GetNamedGetterOperation($interface); |
| 1522 |
} |
| 1523 |
|
| 1524 |
sub InstanceOverridesGetOwnPropertyNames |
| 1525 |
{ |
| 1526 |
my $interface = shift; |
| 1527 |
return $interface->extendedAttributes->{CustomEnumerateProperty} |
| 1310 |
|| GetIndexedGetterOperation($interface) |
1528 |
|| GetIndexedGetterOperation($interface) |
| 1311 |
|| GetNamedGetterOperation($interface); |
1529 |
|| GetNamedGetterOperation($interface); |
| 1312 |
} |
1530 |
} |
|
Lines 1315-1321
sub InstanceOverridesPut
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm_sec8
|
| 1315 |
{ |
1533 |
{ |
| 1316 |
my $interface = shift; |
1534 |
my $interface = shift; |
| 1317 |
return $interface->extendedAttributes->{CustomNamedSetter} |
1535 |
return $interface->extendedAttributes->{CustomNamedSetter} |
| 1318 |
|| $interface->extendedAttributes->{CustomIndexedSetter} |
1536 |
|| $interface->extendedAttributes->{CustomPutFunction} |
|
|
1537 |
|| GetIndexedSetterOperation($interface) |
| 1538 |
|| GetNamedSetterOperation($interface); |
| 1539 |
} |
| 1540 |
|
| 1541 |
sub InstanceOverridesDefineOwnProperty |
| 1542 |
{ |
| 1543 |
my $interface = shift; |
| 1544 |
return $interface->extendedAttributes->{CustomDefineOwnProperty} |
| 1319 |
|| GetIndexedSetterOperation($interface) |
1545 |
|| GetIndexedSetterOperation($interface) |
| 1320 |
|| GetNamedSetterOperation($interface); |
1546 |
|| GetNamedSetterOperation($interface); |
| 1321 |
} |
1547 |
} |
|
Lines 1334-1354
sub PrototypeHasStaticPropertyTable
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm_sec9
|
| 1334 |
return $numConstants > 0 || PrototypePropertyCount($interface) > 0; |
1560 |
return $numConstants > 0 || PrototypePropertyCount($interface) > 0; |
| 1335 |
} |
1561 |
} |
| 1336 |
|
1562 |
|
| 1337 |
sub InstanceOverridesPutImplementation |
|
|
| 1338 |
{ |
| 1339 |
my $interface = shift; |
| 1340 |
return $interface->extendedAttributes->{CustomNamedSetter} |
| 1341 |
|| $interface->extendedAttributes->{CustomIndexedSetter}; |
| 1342 |
} |
| 1343 |
|
| 1344 |
sub InstanceOverridesPutDeclaration |
| 1345 |
{ |
| 1346 |
my $interface = shift; |
| 1347 |
return $interface->extendedAttributes->{CustomPutFunction} |
| 1348 |
|| $interface->extendedAttributes->{CustomNamedSetter} |
| 1349 |
|| $interface->extendedAttributes->{CustomIndexedSetter}; |
| 1350 |
} |
| 1351 |
|
| 1352 |
sub InstanceNeedsVisitChildren |
1563 |
sub InstanceNeedsVisitChildren |
| 1353 |
{ |
1564 |
{ |
| 1354 |
my $interface = shift; |
1565 |
my $interface = shift; |
|
Lines 1999-2005
sub GenerateHeader
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm_sec10
|
| 1999 |
$structureFlags{"JSC::HasStaticPropertyTable"} = 1 if InstancePropertyCount($interface) > 0; |
2210 |
$structureFlags{"JSC::HasStaticPropertyTable"} = 1 if InstancePropertyCount($interface) > 0; |
| 2000 |
$structureFlags{"JSC::NewImpurePropertyFiresWatchpoints"} = 1 if $interface->extendedAttributes->{NewImpurePropertyFiresWatchpoints}; |
2211 |
$structureFlags{"JSC::NewImpurePropertyFiresWatchpoints"} = 1 if $interface->extendedAttributes->{NewImpurePropertyFiresWatchpoints}; |
| 2001 |
$structureFlags{"JSC::IsImmutablePrototypeExoticObject"} = 1 if $interface->extendedAttributes->{IsImmutablePrototypeExoticObject}; |
2212 |
$structureFlags{"JSC::IsImmutablePrototypeExoticObject"} = 1 if $interface->extendedAttributes->{IsImmutablePrototypeExoticObject}; |
| 2002 |
|
2213 |
$structureFlags{"JSC::MasqueradesAsUndefined"} = 1 if $interface->extendedAttributes->{MasqueradesAsUndefined}; |
|
|
2214 |
$structureFlags{"JSC::ImplementsHasInstance | JSC::ImplementsDefaultHasInstance"} = 1 if $interfaceName eq "DOMWindow"; |
| 2215 |
|
| 2003 |
# Prototype |
2216 |
# Prototype |
| 2004 |
unless (ShouldUseGlobalObjectPrototype($interface)) { |
2217 |
unless (ShouldUseGlobalObjectPrototype($interface)) { |
| 2005 |
push(@headerContent, " static JSC::JSObject* createPrototype(JSC::VM&, JSDOMGlobalObject&);\n"); |
2218 |
push(@headerContent, " static JSC::JSObject* createPrototype(JSC::VM&, JSDOMGlobalObject&);\n"); |
|
Lines 2026-2076
sub GenerateHeader
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm_sec11
|
| 2026 |
my $namedGetterOperation = GetNamedGetterOperation($interface); |
2239 |
my $namedGetterOperation = GetNamedGetterOperation($interface); |
| 2027 |
my $indexedGetterOperation = GetIndexedGetterOperation($interface); |
2240 |
my $indexedGetterOperation = GetIndexedGetterOperation($interface); |
| 2028 |
|
2241 |
|
| 2029 |
my $hasNamedGetter = $namedGetterOperation |
2242 |
# FIXME: Why doesn't this also include Indexed Getters, {CustomGetOwnPropertySlot} and {CustomGetOwnPropertySlotAndDescriptor} |
| 2030 |
|| $interface->extendedAttributes->{CustomNamedGetter}; |
2243 |
if ($namedGetterOperation || $interface->extendedAttributes->{CustomNamedGetter}) { |
| 2031 |
|
2244 |
if ($codeGenerator->InheritsExtendedAttribute($interface, "OverrideBuiltins")) { |
| 2032 |
my $hasComplexGetter = $indexedGetterOperation |
|
|
| 2033 |
|| $interface->extendedAttributes->{JSCustomGetOwnPropertySlotAndDescriptor} |
| 2034 |
|| $interface->extendedAttributes->{CustomGetOwnPropertySlot} |
| 2035 |
|| $hasNamedGetter; |
| 2036 |
|
| 2037 |
if ($hasNamedGetter) { |
| 2038 |
if ($interface->extendedAttributes->{OverrideBuiltins}) { |
| 2039 |
$structureFlags{"JSC::GetOwnPropertySlotIsImpure"} = 1; |
2245 |
$structureFlags{"JSC::GetOwnPropertySlotIsImpure"} = 1; |
| 2040 |
} else { |
2246 |
} else { |
| 2041 |
$structureFlags{"JSC::GetOwnPropertySlotIsImpureForPropertyAbsence"} = 1; |
2247 |
$structureFlags{"JSC::GetOwnPropertySlotIsImpureForPropertyAbsence"} = 1; |
| 2042 |
} |
2248 |
} |
| 2043 |
} |
2249 |
} |
| 2044 |
|
2250 |
|
| 2045 |
my $overridesGet = InstanceOverridesGetOwnPropertySlot($interface); |
2251 |
# ClassInfo MethodTable declarations. |
| 2046 |
if ($overridesGet) { |
2252 |
|
|
|
2253 |
if (InstanceOverridesGetOwnPropertySlot($interface)) { |
| 2047 |
push(@headerContent, " static bool getOwnPropertySlot(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);\n"); |
2254 |
push(@headerContent, " static bool getOwnPropertySlot(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);\n"); |
| 2048 |
$structureFlags{"JSC::OverridesGetOwnPropertySlot"} = 1; |
2255 |
$structureFlags{"JSC::OverridesGetOwnPropertySlot"} = 1; |
| 2049 |
|
|
|
| 2050 |
if ($hasComplexGetter) { |
| 2051 |
push(@headerContent, " static bool getOwnPropertySlotByIndex(JSC::JSObject*, JSC::ExecState*, unsigned propertyName, JSC::PropertySlot&);\n"); |
| 2052 |
$structureFlags{"JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero"} = 1; |
| 2053 |
} |
| 2054 |
} |
2256 |
} |
| 2055 |
|
2257 |
|
| 2056 |
my $overridesPut = InstanceOverridesPutDeclaration($interface); |
2258 |
if (InstanceOverridesGetOwnPropertySlotByIndex($interface)) { |
| 2057 |
if ($overridesPut) { |
2259 |
push(@headerContent, " static bool getOwnPropertySlotByIndex(JSC::JSObject*, JSC::ExecState*, unsigned propertyName, JSC::PropertySlot&);\n"); |
|
|
2260 |
$structureFlags{"JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero"} = 1; |
| 2261 |
} |
| 2262 |
|
| 2263 |
# FIXME: Currently only DOMWindow needs to override the getPropertyNames family of functions, but even |
| 2264 |
# so, it should probably be turned into an extended attribute. |
| 2265 |
if ($interfaceName eq "DOMWindow") { |
| 2266 |
push(@headerContent, " static void getPropertyNames(JSC::JSObject*, JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode = JSC::EnumerationMode());\n"); |
| 2267 |
push(@headerContent, " static void getGenericPropertyNames(JSC::JSObject*, JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode = JSC::EnumerationMode());\n"); |
| 2268 |
push(@headerContent, " static void getStructurePropertyNames(JSC::JSObject*, JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode = JSC::EnumerationMode());\n"); |
| 2269 |
push(@headerContent, " static uint32_t getEnumerableLength(JSC::ExecState*, JSC::JSObject*);\n"); |
| 2270 |
$structureFlags{"JSC::OverridesGetPropertyNames"} = 1; |
| 2271 |
} |
| 2272 |
|
| 2273 |
if (InstanceOverridesGetOwnPropertyNames($interface)) { |
| 2274 |
push(@headerContent, " static void getOwnPropertyNames(JSC::JSObject*, JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode = JSC::EnumerationMode());\n"); |
| 2275 |
$structureFlags{"JSC::OverridesGetPropertyNames"} = 1; |
| 2276 |
} |
| 2277 |
|
| 2278 |
if (InstanceOverridesPut($interface)) { |
| 2058 |
push(@headerContent, " static bool put(JSC::JSCell*, JSC::ExecState*, JSC::PropertyName, JSC::JSValue, JSC::PutPropertySlot&);\n"); |
2279 |
push(@headerContent, " static bool put(JSC::JSCell*, JSC::ExecState*, JSC::PropertyName, JSC::JSValue, JSC::PutPropertySlot&);\n"); |
| 2059 |
push(@headerContent, " static bool putByIndex(JSC::JSCell*, JSC::ExecState*, unsigned propertyName, JSC::JSValue, bool shouldThrow);\n"); |
2280 |
push(@headerContent, " static bool putByIndex(JSC::JSCell*, JSC::ExecState*, unsigned propertyName, JSC::JSValue, bool shouldThrow);\n"); |
| 2060 |
} |
2281 |
} |
|
|
2282 |
|
| 2283 |
if (InstanceOverridesDefineOwnProperty($interface)) { |
| 2284 |
push(@headerContent, " static bool defineOwnProperty(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, const JSC::PropertyDescriptor&, bool shouldThrow);\n"); |
| 2285 |
} |
| 2061 |
|
2286 |
|
| 2062 |
if (InstanceOverridesDelete($interface)) { |
2287 |
if (InstanceOverridesDelete($interface)) { |
| 2063 |
push(@headerContent, " static bool deleteProperty(JSC::JSCell*, JSC::ExecState*, JSC::PropertyName);\n"); |
2288 |
push(@headerContent, " static bool deleteProperty(JSC::JSCell*, JSC::ExecState*, JSC::PropertyName);\n"); |
| 2064 |
push(@headerContent, " static bool deletePropertyByIndex(JSC::JSCell*, JSC::ExecState*, unsigned);\n"); |
2289 |
push(@headerContent, " static bool deletePropertyByIndex(JSC::JSCell*, JSC::ExecState*, unsigned);\n"); |
| 2065 |
} |
2290 |
} |
| 2066 |
|
2291 |
|
| 2067 |
# LegacyCaller and custom call functions |
2292 |
if (InstanceOverridesCall($interface)) { |
| 2068 |
if (IsCallable($interface)) { |
|
|
| 2069 |
push(@headerContent, " static JSC::CallType getCallData(JSC::JSCell*, JSC::CallData&);\n\n"); |
2293 |
push(@headerContent, " static JSC::CallType getCallData(JSC::JSCell*, JSC::CallData&);\n\n"); |
| 2070 |
$headerIncludes{"<runtime/CallData.h>"} = 1; |
2294 |
$headerIncludes{"<runtime/CallData.h>"} = 1; |
| 2071 |
$structureFlags{"JSC::TypeOfShouldCallGetCallData"} = 1; |
2295 |
$structureFlags{"JSC::TypeOfShouldCallGetCallData"} = 1; |
| 2072 |
} |
2296 |
} |
| 2073 |
|
2297 |
|
|
|
2298 |
if ($interface->extendedAttributes->{CustomGetPrototype}) { |
| 2299 |
push (@headerContent, " static JSC::JSValue getPrototype(JSC::JSObject*, JSC::ExecState*);\n"); |
| 2300 |
} |
| 2301 |
|
| 2302 |
if ($interface->extendedAttributes->{CustomToStringName}) { |
| 2303 |
push (@headerContent, " static String toStringName(const JSC::JSObject*, JSC::ExecState*);\n"); |
| 2304 |
} |
| 2305 |
|
| 2306 |
if ($interface->extendedAttributes->{CustomPreventExtensions}) { |
| 2307 |
push(@headerContent, " static bool preventExtensions(JSC::JSObject*, JSC::ExecState*);\n"); |
| 2308 |
} |
| 2309 |
|
| 2310 |
if (InstanceNeedsEstimatedSize($interface)) { |
| 2311 |
push(@headerContent, " static size_t estimatedSize(JSCell*);\n"); |
| 2312 |
} |
| 2313 |
|
| 2074 |
if (!$hasParent) { |
2314 |
if (!$hasParent) { |
| 2075 |
push(@headerContent, " static void destroy(JSC::JSCell*);\n"); |
2315 |
push(@headerContent, " static void destroy(JSC::JSCell*);\n"); |
| 2076 |
} |
2316 |
} |
|
Lines 2088-2094
sub GenerateHeader
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm_sec12
|
| 2088 |
} |
2328 |
} |
| 2089 |
|
2329 |
|
| 2090 |
# Structure ID |
2330 |
# Structure ID |
| 2091 |
$structureFlags{"JSC::ImplementsHasInstance | JSC::ImplementsDefaultHasInstance"} = 1 if $interfaceName eq "DOMWindow"; |
|
|
| 2092 |
push(@headerContent, " static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)\n"); |
2331 |
push(@headerContent, " static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)\n"); |
| 2093 |
push(@headerContent, " {\n"); |
2332 |
push(@headerContent, " {\n"); |
| 2094 |
if (IsDOMGlobalObject($interface)) { |
2333 |
if (IsDOMGlobalObject($interface)) { |
|
Lines 2104-2140
sub GenerateHeader
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm_sec13
|
| 2104 |
push(@headerContent, " }\n\n"); |
2343 |
push(@headerContent, " }\n\n"); |
| 2105 |
|
2344 |
|
| 2106 |
# Custom pushEventHandlerScope function |
2345 |
# Custom pushEventHandlerScope function |
| 2107 |
push(@headerContent, " JSC::JSScope* pushEventHandlerScope(JSC::ExecState*, JSC::JSScope*) const;\n\n") if $interface->extendedAttributes->{JSCustomPushEventHandlerScope}; |
2346 |
if ($interface->extendedAttributes->{CustomPushEventHandlerScope}) { |
| 2108 |
|
2347 |
push(@headerContent, " JSC::JSScope* pushEventHandlerScope(JSC::ExecState*, JSC::JSScope*) const;\n\n"); |
| 2109 |
# Custom getPropertyNames function exists on DOMWindow |
|
|
| 2110 |
if ($interfaceName eq "DOMWindow") { |
| 2111 |
push(@headerContent, " static void getPropertyNames(JSC::JSObject*, JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode = JSC::EnumerationMode());\n"); |
| 2112 |
push(@headerContent, " static void getGenericPropertyNames(JSC::JSObject*, JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode = JSC::EnumerationMode());\n"); |
| 2113 |
push(@headerContent, " static void getStructurePropertyNames(JSC::JSObject*, JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode = JSC::EnumerationMode());\n"); |
| 2114 |
push(@headerContent, " static uint32_t getEnumerableLength(JSC::ExecState*, JSC::JSObject*);\n"); |
| 2115 |
$structureFlags{"JSC::OverridesGetPropertyNames"} = 1; |
| 2116 |
} |
| 2117 |
|
| 2118 |
# Custom getOwnPropertyNames function |
| 2119 |
if ($interface->extendedAttributes->{CustomEnumerateProperty} || $indexedGetterOperation || $namedGetterOperation) { |
| 2120 |
push(@headerContent, " static void getOwnPropertyNames(JSC::JSObject*, JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode = JSC::EnumerationMode());\n"); |
| 2121 |
$structureFlags{"JSC::OverridesGetPropertyNames"} = 1; |
| 2122 |
} |
2348 |
} |
| 2123 |
|
|
|
| 2124 |
# Custom defineOwnProperty function |
| 2125 |
push(@headerContent, " static bool defineOwnProperty(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, const JSC::PropertyDescriptor&, bool shouldThrow);\n") if $interface->extendedAttributes->{JSCustomDefineOwnProperty}; |
| 2126 |
|
| 2127 |
# Custom getPrototype / setPrototype functions. |
| 2128 |
push (@headerContent, " static JSC::JSValue getPrototype(JSC::JSObject*, JSC::ExecState*);\n") if $interface->extendedAttributes->{CustomGetPrototype}; |
| 2129 |
|
| 2130 |
# Custom toStringName function. |
| 2131 |
push (@headerContent, " static String toStringName(const JSC::JSObject*, JSC::ExecState*);\n") if $interface->extendedAttributes->{CustomToStringName}; |
| 2132 |
|
| 2133 |
# Custom preventExtensions function. |
| 2134 |
push(@headerContent, " static bool preventExtensions(JSC::JSObject*, JSC::ExecState*);\n") if $interface->extendedAttributes->{CustomPreventExtensions}; |
| 2135 |
|
2349 |
|
| 2136 |
$structureFlags{"JSC::MasqueradesAsUndefined"} = 1 if $interface->extendedAttributes->{MasqueradesAsUndefined}; |
|
|
| 2137 |
|
| 2138 |
# Constructor object getter |
2350 |
# Constructor object getter |
| 2139 |
unless ($interface->extendedAttributes->{NoInterfaceObject}) { |
2351 |
unless ($interface->extendedAttributes->{NoInterfaceObject}) { |
| 2140 |
push(@headerContent, " static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*);\n"); |
2352 |
push(@headerContent, " static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*);\n"); |
|
Lines 2142-2149
sub GenerateHeader
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm_sec14
|
| 2142 |
} |
2354 |
} |
| 2143 |
|
2355 |
|
| 2144 |
# Serializer function. |
2356 |
# Serializer function. |
| 2145 |
push(@headerContent, " static JSC::JSObject* serialize(JSC::ExecState*, JS${interfaceName}* thisObject, JSC::ThrowScope&);\n") if $interface->serializable; |
2357 |
if ($interface->serializable) { |
| 2146 |
|
2358 |
push(@headerContent, " static JSC::JSObject* serialize(JSC::ExecState*, ${className}* thisObject, JSC::ThrowScope&);\n"); |
|
|
2359 |
} |
| 2360 |
|
| 2147 |
my $numCustomOperations = 0; |
2361 |
my $numCustomOperations = 0; |
| 2148 |
my $numCustomAttributes = 0; |
2362 |
my $numCustomAttributes = 0; |
| 2149 |
|
2363 |
|
|
Lines 2193-2203
sub GenerateHeader
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm_sec15
|
| 2193 |
push(@headerContent, " template<typename> static JSC::Subspace* subspaceFor(JSC::VM& vm) { return $subspaceFunc(vm); }\n"); |
2407 |
push(@headerContent, " template<typename> static JSC::Subspace* subspaceFor(JSC::VM& vm) { return $subspaceFunc(vm); }\n"); |
| 2194 |
} |
2408 |
} |
| 2195 |
} |
2409 |
} |
| 2196 |
|
2410 |
|
| 2197 |
if (InstanceNeedsEstimatedSize($interface)) { |
|
|
| 2198 |
push(@headerContent, " static size_t estimatedSize(JSCell*);\n"); |
| 2199 |
} |
| 2200 |
|
| 2201 |
if ($numCustomAttributes > 0) { |
2411 |
if ($numCustomAttributes > 0) { |
| 2202 |
push(@headerContent, "\n // Custom attributes\n"); |
2412 |
push(@headerContent, "\n // Custom attributes\n"); |
| 2203 |
|
2413 |
|
|
Lines 2295-2301
sub GenerateHeader
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm_sec16
|
| 2295 |
push(@headerContent, " void finishCreation(JSC::VM&);\n"); |
2505 |
push(@headerContent, " void finishCreation(JSC::VM&);\n"); |
| 2296 |
} |
2506 |
} |
| 2297 |
|
2507 |
|
| 2298 |
if ($interface->extendedAttributes->{JSCustomGetOwnPropertySlotAndDescriptor}) { |
2508 |
if ($interface->extendedAttributes->{CustomGetOwnPropertySlotAndDescriptor}) { |
| 2299 |
push(@headerContent, " bool getOwnPropertySlotDelegate(JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);\n"); |
2509 |
push(@headerContent, " bool getOwnPropertySlotDelegate(JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);\n"); |
| 2300 |
} |
2510 |
} |
| 2301 |
|
2511 |
|
|
Lines 2306-2316
sub GenerateHeader
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm_sec17
|
| 2306 |
if ($interface->extendedAttributes->{CustomNamedSetter}) { |
2516 |
if ($interface->extendedAttributes->{CustomNamedSetter}) { |
| 2307 |
push(@headerContent, " bool putDelegate(JSC::ExecState*, JSC::PropertyName, JSC::JSValue, JSC::PutPropertySlot&, bool& putResult);\n"); |
2517 |
push(@headerContent, " bool putDelegate(JSC::ExecState*, JSC::PropertyName, JSC::JSValue, JSC::PutPropertySlot&, bool& putResult);\n"); |
| 2308 |
} |
2518 |
} |
| 2309 |
|
2519 |
|
| 2310 |
if ($interface->extendedAttributes->{CustomIndexedSetter}) { |
|
|
| 2311 |
push(@headerContent, " void indexSetter(JSC::ExecState*, unsigned index, JSC::JSValue);\n"); |
| 2312 |
} |
| 2313 |
|
| 2314 |
push(@headerContent, "};\n\n"); |
2520 |
push(@headerContent, "};\n\n"); |
| 2315 |
|
2521 |
|
| 2316 |
if (ShouldGenerateWrapperOwnerCode($hasParent, $interface)) { |
2522 |
if (ShouldGenerateWrapperOwnerCode($hasParent, $interface)) { |
|
Lines 3613-3619
sub GenerateImplementation
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm_sec18
|
| 3613 |
push(@implContent, "}\n\n"); |
3819 |
push(@implContent, "}\n\n"); |
| 3614 |
} |
3820 |
} |
| 3615 |
|
3821 |
|
| 3616 |
if ($interface->extendedAttributes->{JSCustomNamedGetterOnPrototype}) { |
3822 |
if ($interface->extendedAttributes->{CustomNamedGetterOnPrototype}) { |
| 3617 |
push(@implContent, "bool ${className}Prototype::put(JSCell* cell, ExecState* state, PropertyName propertyName, JSValue value, PutPropertySlot& slot)\n"); |
3823 |
push(@implContent, "bool ${className}Prototype::put(JSCell* cell, ExecState* state, PropertyName propertyName, JSValue value, PutPropertySlot& slot)\n"); |
| 3618 |
push(@implContent, "{\n"); |
3824 |
push(@implContent, "{\n"); |
| 3619 |
push(@implContent, " auto* thisObject = jsCast<${className}Prototype*>(cell);\n"); |
3825 |
push(@implContent, " auto* thisObject = jsCast<${className}Prototype*>(cell);\n"); |
|
Lines 3792-3834
sub GenerateImplementation
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm_sec19
|
| 3792 |
push(@implContent, "}\n\n"); |
3998 |
push(@implContent, "}\n\n"); |
| 3793 |
} |
3999 |
} |
| 3794 |
|
4000 |
|
| 3795 |
my $overridesGet = InstanceOverridesGetOwnPropertySlot($interface); |
4001 |
if (InstanceOverridesGetOwnPropertySlot($interface)) { |
| 3796 |
if ($overridesGet) { |
4002 |
GenerateGetOwnPropertySlotBody(\@implContent, $interface, $className); |
| 3797 |
if (!$interface->extendedAttributes->{CustomGetOwnPropertySlot}) { |
|
|
| 3798 |
push(@implContent, GenerateGetOwnPropertySlotBody($interface, $className, $indexedGetterOperation, $namedGetterOperation)); |
| 3799 |
} |
| 3800 |
|
| 3801 |
if ($indexedGetterOperation || $namedGetterOperation |
| 3802 |
|| $interface->extendedAttributes->{CustomNamedGetter} |
| 3803 |
|| $interface->extendedAttributes->{JSCustomGetOwnPropertySlotAndDescriptor}) { |
| 3804 |
push(@implContent, GenerateGetOwnPropertySlotBodyByIndex($interface, $className, $indexedGetterOperation, $namedGetterOperation)); |
| 3805 |
} |
| 3806 |
} |
4003 |
} |
| 3807 |
|
4004 |
|
| 3808 |
|
4005 |
if (InstanceOverridesGetOwnPropertySlotByIndex($interface)) { |
| 3809 |
if (($indexedGetterOperation || $namedGetterOperation) && !$interface->extendedAttributes->{CustomEnumerateProperty}) { |
4006 |
GenerateGetOwnPropertySlotBodyByIndex(\@implContent, $interface, $className); |
| 3810 |
push(@implContent, GenerateGetOwnPropertyNames($interface, $className, $indexedGetterOperation, $namedGetterOperation)); |
|
|
| 3811 |
} |
4007 |
} |
| 3812 |
|
4008 |
|
| 3813 |
my $namedSetterOperation = GetNamedSetterOperation($interface); |
4009 |
if (InstanceOverridesGetOwnPropertyNames($interface)) { |
| 3814 |
my $indexedSetterOperation = GetIndexedSetterOperation($interface); |
4010 |
GenerateGetOwnPropertyNames(\@implContent, $interface, $className); |
| 3815 |
|
|
|
| 3816 |
my $hasSetter = InstanceOverridesPut($interface); |
| 3817 |
if ($hasSetter) { |
| 3818 |
if (!$interface->extendedAttributes->{CustomPutFunction}) { |
| 3819 |
push(@implContent, GeneratePut($interface, $className, $indexedSetterOperation, $namedSetterOperation)); |
| 3820 |
|
| 3821 |
if ($interface->extendedAttributes->{CustomIndexedSetter} || $interface->extendedAttributes->{CustomNamedSetter}) { |
| 3822 |
push(@implContent, GeneratePutByIndex($interface, $className, $indexedSetterOperation, $namedSetterOperation)); |
| 3823 |
} |
| 3824 |
} |
| 3825 |
} |
4011 |
} |
| 3826 |
|
4012 |
|
| 3827 |
my $namedDeleterOperation = GetNamedDeleterOperation($interface); |
4013 |
if (InstanceOverridesPut($interface)) { |
| 3828 |
if ($namedDeleterOperation) { |
4014 |
GeneratePut(\@implContent, $interface, $className); |
| 3829 |
GenerateNamedDeleterDefinition(\@implContent, $interface, $className, $namedDeleterOperation); |
4015 |
GeneratePutByIndex(\@implContent, $interface, $className); |
|
|
4016 |
} |
| 4017 |
|
| 4018 |
if (InstanceOverridesDefineOwnProperty($interface)) { |
| 4019 |
GenerateDefineOwnProperty(\@implContent, $interface, $className); |
| 3830 |
} |
4020 |
} |
| 3831 |
|
4021 |
|
|
|
4022 |
if (InstanceOverridesDelete($interface)) { |
| 4023 |
GenerateNamedDeleterDefinition(\@implContent, $interface, $className); |
| 4024 |
} |
| 4025 |
|
| 4026 |
if (InstanceOverridesCall($interface)) { |
| 4027 |
GenerateLegacyCallerDefinitions($interface, $className); |
| 4028 |
} |
| 4029 |
|
| 3832 |
if ($numAttributes > 0) { |
4030 |
if ($numAttributes > 0) { |
| 3833 |
AddToImplIncludes("JSDOMAttribute.h"); |
4031 |
AddToImplIncludes("JSDOMAttribute.h"); |
| 3834 |
|
4032 |
|
|
Lines 3908-3915
sub GenerateImplementation
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm_sec20
|
| 3908 |
foreach my $operation (@operations) { |
4106 |
foreach my $operation (@operations) { |
| 3909 |
GenerateOperationDefinition($interface, $className, $operation); |
4107 |
GenerateOperationDefinition($interface, $className, $operation); |
| 3910 |
} |
4108 |
} |
| 3911 |
|
4109 |
|
| 3912 |
GenerateLegacyCallerDefinitions($interface, $className); |
|
|
| 3913 |
GenerateIterableDefinition($interface) if $interface->iterable; |
4110 |
GenerateIterableDefinition($interface) if $interface->iterable; |
| 3914 |
GenerateSerializerDefinition($interface, $className) if $interface->serializable; |
4111 |
GenerateSerializerDefinition($interface, $className) if $interface->serializable; |
| 3915 |
|
4112 |
|
|
Lines 4769-4778
sub GenerateLegacyCallerDefinitions
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm_sec21
|
| 4769 |
{ |
4966 |
{ |
| 4770 |
my ($interface, $className) = @_; |
4967 |
my ($interface, $className) = @_; |
| 4771 |
|
4968 |
|
| 4772 |
if (!IsCallable($interface) || $interface->extendedAttributes->{CustomCall}) { |
4969 |
return if $interface->extendedAttributes->{CustomCall}; |
| 4773 |
return; |
4970 |
|
| 4774 |
} |
|
|
| 4775 |
|
| 4776 |
my @legacyCallers = @{$interface->{LegacyCallers}}; |
4971 |
my @legacyCallers = @{$interface->{LegacyCallers}}; |
| 4777 |
if (@legacyCallers > 1) { |
4972 |
if (@legacyCallers > 1) { |
| 4778 |
foreach my $legacyCaller (@legacyCallers) { |
4973 |
foreach my $legacyCaller (@legacyCallers) { |
|
Lines 6312-6325
sub GeneratePrototypeDeclaration
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm_sec22
|
| 6312 |
} |
6507 |
} |
| 6313 |
} |
6508 |
} |
| 6314 |
|
6509 |
|
| 6315 |
if ($interface->extendedAttributes->{JSCustomNamedGetterOnPrototype}) { |
6510 |
if ($interface->extendedAttributes->{CustomNamedGetterOnPrototype}) { |
| 6316 |
push(@$outputArray, "\n"); |
6511 |
push(@$outputArray, "\n"); |
| 6317 |
push(@$outputArray, " static bool put(JSC::JSCell*, JSC::ExecState*, JSC::PropertyName, JSC::JSValue, JSC::PutPropertySlot&);\n"); |
6512 |
push(@$outputArray, " static bool put(JSC::JSCell*, JSC::ExecState*, JSC::PropertyName, JSC::JSValue, JSC::PutPropertySlot&);\n"); |
| 6318 |
push(@$outputArray, " bool putDelegate(JSC::ExecState*, JSC::PropertyName, JSC::JSValue, JSC::PutPropertySlot&, bool& putResult);\n"); |
6513 |
push(@$outputArray, " bool putDelegate(JSC::ExecState*, JSC::PropertyName, JSC::JSValue, JSC::PutPropertySlot&, bool& putResult);\n"); |
| 6319 |
} |
6514 |
} |
| 6320 |
|
6515 |
|
| 6321 |
# Custom defineOwnProperty function |
6516 |
# Custom defineOwnProperty function |
| 6322 |
if ($interface->extendedAttributes->{JSCustomDefineOwnPropertyOnPrototype}) { |
6517 |
if ($interface->extendedAttributes->{CustomDefineOwnPropertyOnPrototype}) { |
| 6323 |
push(@$outputArray, "\n"); |
6518 |
push(@$outputArray, "\n"); |
| 6324 |
push(@$outputArray, " static bool defineOwnProperty(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, const JSC::PropertyDescriptor&, bool shouldThrow);\n"); |
6519 |
push(@$outputArray, " static bool defineOwnProperty(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, const JSC::PropertyDescriptor&, bool shouldThrow);\n"); |
| 6325 |
} |
6520 |
} |
|
Lines 6580-6586
sub IsConstructable
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm_sec23
|
| 6580 |
|| $interface->extendedAttributes->{JSBuiltinConstructor}; |
6775 |
|| $interface->extendedAttributes->{JSBuiltinConstructor}; |
| 6581 |
} |
6776 |
} |
| 6582 |
|
6777 |
|
| 6583 |
sub IsCallable |
6778 |
sub InstanceOverridesCall |
| 6584 |
{ |
6779 |
{ |
| 6585 |
my $interface = shift; |
6780 |
my $interface = shift; |
| 6586 |
return $interface->extendedAttributes->{CustomCall} || $interface->{LegacyCallers} |
6781 |
return $interface->extendedAttributes->{CustomCall} || $interface->{LegacyCallers} |
|
Lines 6589-6595
sub IsCallable
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm_sec24
|
| 6589 |
sub HeaderNeedsPrototypeDeclaration |
6784 |
sub HeaderNeedsPrototypeDeclaration |
| 6590 |
{ |
6785 |
{ |
| 6591 |
my $interface = shift; |
6786 |
my $interface = shift; |
| 6592 |
return IsDOMGlobalObject($interface) || $interface->extendedAttributes->{JSCustomNamedGetterOnPrototype} || $interface->extendedAttributes->{JSCustomDefineOwnPropertyOnPrototype}; |
6787 |
return IsDOMGlobalObject($interface) |
|
|
6788 |
|| $interface->extendedAttributes->{CustomNamedGetterOnPrototype} |
| 6789 |
|| $interface->extendedAttributes->{CustomDefineOwnPropertyOnPrototype}; |
| 6593 |
} |
6790 |
} |
| 6594 |
|
6791 |
|
| 6595 |
sub IsUnforgeable |
6792 |
sub IsUnforgeable |