[webkit-reviews] review granted: [Bug 209762] Bindings that override getOwnPropertySlotByIndex need to say they MayHaveIndexedAccessors : [Attachment 394962] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Mar 30 14:55:31 PDT 2020


Darin Adler <darin at apple.com> has granted Keith Miller
<keith_miller at apple.com>'s request for review:
Bug 209762: Bindings that override getOwnPropertySlotByIndex need to say they
MayHaveIndexedAccessors
https://bugs.webkit.org/show_bug.cgi?id=209762

Attachment 394962: Patch

https://bugs.webkit.org/attachment.cgi?id=394962&action=review




--- Comment #5 from Darin Adler <darin at apple.com> ---
Comment on attachment 394962
  --> https://bugs.webkit.org/attachment.cgi?id=394962
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=394962&action=review

> Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:2751
> +    if (InstanceOverridesGetOwnPropertySlot($interface)) {
> +	   push(@headerContent, "	 JSC::IndexingType
indexingModeIncludingHistory = JSC::MayHaveIndexedAccessors;\n");
> +    } else {
> +	   push(@headerContent, "	 JSC::IndexingType
indexingModeIncludingHistory = JSC::NonArray;\n");
> +    }

Why not just emit the constant? Seems unnecessary to put this into a local
variable.

    my $indexingModeIncludingHistory =
InstanceOverridesGetOwnPropertySlot($interface)
	? "JSC::MayHaveIndexedAccessors" : "JSC::NonArray";

> Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:2753
> +	   push(@headerContent, "	 return JSC::Structure::create(vm,
globalObject, prototype, JSC::TypeInfo(JSC::GlobalObjectType, StructureFlags),
info(), indexingModeIncludingHistory);\n");

Just put a $ in front of indexingModeIncludingHistory here.


More information about the webkit-reviews mailing list