[Webkit-unassigned] [Bug 189729] JS bindings generator should support EnabledAtRuntime for static methods

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Sep 19 15:20:28 PDT 2018


https://bugs.webkit.org/show_bug.cgi?id=189729

--- Comment #3 from Chris Dumez <cdumez at apple.com> ---
Comment on attachment 350129
  --> https://bugs.webkit.org/attachment.cgi?id=350129
Patch

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

> Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:3658
> +    my $globalObjectPtr = ($globalObjectIsParam? "&globalObject" : "globalObject()");

missing space before '?'. Also, I think we usually omit the parentheses.

> Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:3679
> +    my $globalObjectPtr = ($globalObjectIsParam? "&globalObject" : "globalObject()");

Same comments as above.

> Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:7199
> +    push(@attributes, @{$interface->mapLike->attributes}) if $interface->mapLike;

Could you clarify why maplike is unconditionally treated as runtime enabled?

> Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:7205
> +        if ($attribute->extendedAttributes->{EnabledAtRuntime}) {

Same comment as below. Should probably use NeedsRuntimeCheck()

> Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:7211
> +    push(@operations, @{$interface->iterable->operations}) if IsKeyValueIterableInterface($interface);

Could you clarify why iterable is unconditionally treated as runtime enabled?

> Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:7212
> +    push(@operations, @{$interface->mapLike->operations}) if $interface->mapLike;

ditto.

> Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:7213
> +    push(@operations, @{$interface->serializable->operations}) if $interface->serializable;

ditto.

> Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:7221
> +        if ($operation->extendedAttributes->{EnabledAtRuntime}) {

We normally do not special-case EnabledAtRuntime and instead rely on NeedsRuntimeCheck(). Also note that EnabledAtRuntime is kind of deprecated in favor of EnabledBySetting, unless you need multithreaded access.

> Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:7293
> +        my $runtimeEnableConditionalString = GenerateRuntimeEnableConditionalString($interface, $operationOrAttribute, "true");

GenerateRuntimeEnableConditionalString supports other things that EnabledAtRuntime. For e.g. it supports EnabledBySetting (which is preferred nowadays). Therefore, it is unfortunate that GetRuntimeEnabledStaticProperties() only returns EnabledAtRuntime things.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20180919/2878b3f5/attachment.html>


More information about the webkit-unassigned mailing list