[Webkit-unassigned] [Bug 67458] Generate a WebKitCSSMatrix constructor of V8 using the IDL 'Constructor' extended attribute

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Sep 7 04:06:40 PDT 2011


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





--- Comment #15 from anton muhin <antonm at chromium.org>  2011-09-07 04:06:39 PST ---
(From update of attachment 106159)
View in context: https://bugs.webkit.org/attachment.cgi?id=106159&action=review

First of all, sorry for delay.  And thanks a lot for clarifications.  I still dare to suggest approach which I find more systematic, but feel free to ignore the suggestion.  I do not LGTM it yet as I have two separate question, but I think this is pretty much close to LGTM.

> Source/WebCore/bindings/scripts/CodeGeneratorV8.pm:1419
> +        # Optional arguments with default values [Optional=CallWithDefaultValue] or [Optional=CallWithNullValue] should not generate an early call.

Are you sure it's a valid semantics?

For f([CallWithNullValue] a) we'll get

WebCoreTypeOfA a = convert(args[0]);

So we convert undefined to the object.  You'll generate exactly the same code for WithNullValue.  Are you sure only strings need this distinction between CallWithDefault and CallWithNull?  For example ToNumber(undefined) = Nan and that may apply to floats.

> Source/WebCore/bindings/scripts/CodeGeneratorV8.pm:1460
> +            if ($optional && $optional eq "CallWithNullValue") {

Sorry for being repetitive, but still one another suggestion.  Idea: if we need this distinction (missing parameter vs. undefined), let's make clear:

V8Binding.h:
enum Policy {
  MISSING_IS_UNDEFINED,
  MISSING_IS_EMPTY
}

v8::Handle<v8::Value> parameter(v8::Arguments& args, unsigned index, Policy policy) {
  if ((policy == MISSING_IS_EMPTY) && (index < args.Length()))
    return v8::Handle<v8::Value>();
  return args[index];
}

And now instead direct args[i] we use parameter(args, i, properPolicy).

WDYT?

> Source/WebCore/bindings/scripts/CodeGeneratorV8.pm:1470
> +                    $parameterCheckString .= "    $nativeType $parameterName(args[$paramIndex], true);\n";

that's probably not what you want: if didn't pass CallWithNullValue'd DOMUserData, it will convert it to WebCore string "undefined"

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list