Changeset 70411 in webkit


Ignore:
Timestamp:
Oct 24, 2010 4:58:15 AM (13 years ago)
Author:
Nikolas Zimmermann
Message:

2010-10-24 Nikolas Zimmermann <nzimmermann@rim.com>

Reviewed by Dirk Schulze.

Convert SVGAngle to the new SVGPropertyTearOff concept, reimplement it properly
https://bugs.webkit.org/show_bug.cgi?id=48179

Speculative fix for the WebGL tests, I was not aware they're not run on Leopard, so I missed the breakage.

  • bindings/scripts/CodeGeneratorJS.pm: Restore the order of type checking in the 'StrictTypeChecking' code.
  • bindings/scripts/CodeGeneratorV8.pm: Ditto.
Location:
trunk/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r70410 r70411  
     12010-10-24  Nikolas Zimmermann  <nzimmermann@rim.com>
     2
     3        Reviewed by Dirk Schulze.
     4
     5        Convert SVGAngle to the new SVGPropertyTearOff concept, reimplement it properly
     6        https://bugs.webkit.org/show_bug.cgi?id=48179
     7
     8        Speculative fix for the WebGL tests, I was not aware they're not run on Leopard, so I missed the breakage.
     9
     10        * bindings/scripts/CodeGeneratorJS.pm: Restore the order of type checking in the 'StrictTypeChecking' code.
     11        * bindings/scripts/CodeGeneratorV8.pm: Ditto.
     12
    1132010-10-23  Nikolas Zimmermann  <nzimmermann@rim.com>
    214
  • trunk/WebCore/bindings/scripts/CodeGeneratorJS.pm

    r70410 r70411  
    18121812                            if ($attribute->signature->extendedAttributes->{"StrictTypeChecking"}) {
    18131813                                my $argType = $attribute->signature->type;
    1814                                 if ($codeGenerator->IsStringType($argType)) {
     1814                                if (!IsNativeType($argType)) {
     1815                                    push(@implContent, "    if (!value.isUndefinedOrNull() && !value.inherits(&JS${argType}::s_info)) {\n");
     1816                                    push(@implContent, "        throwVMTypeError(exec);\n");
     1817                                    push(@implContent, "        return;\n");
     1818                                    push(@implContent, "    };\n");
     1819                                } elsif ($codeGenerator->IsStringType($argType)) {
    18151820                                    push(@implContent, "    if (!value.isUndefinedOrNull() && !value.isString() && !value.isObject()) {\n");
    18161821                                    push(@implContent, "        throwVMTypeError(exec);\n");
     
    18191824                                } elsif ($codeGenerator->IsNumericType($argType)) {
    18201825                                    push(@implContent, "    if (!value.isUndefinedOrNull() && !value.isNumber()) {\n");
    1821                                     push(@implContent, "        throwVMTypeError(exec);\n");
    1822                                     push(@implContent, "        return;\n");
    1823                                     push(@implContent, "    };\n");
    1824                                 } elsif (!IsNativeType($argType)) {
    1825                                     push(@implContent, "    if (!value.isUndefinedOrNull() && !value.inherits(&JS${argType}::s_info)) {\n");
    18261826                                    push(@implContent, "        throwVMTypeError(exec);\n");
    18271827                                    push(@implContent, "        return;\n");
     
    20792079                            if ($function->signature->extendedAttributes->{"StrictTypeChecking"}) {
    20802080                                my $argValue = "exec->argument($argsIndex)";
    2081                                 if ($codeGenerator->IsStringType($argType)) {
     2081                                if (!IsNativeType($argType)) {
     2082                                    push(@implContent, "    if (exec->argumentCount() > $argsIndex && !${argValue}.isUndefinedOrNull() && !${argValue}.inherits(&JS${argType}::s_info))\n");
     2083                                    push(@implContent, "        return throwVMTypeError(exec);\n");
     2084                                } elsif ($codeGenerator->IsStringType($argType)) {
    20822085                                    push(@implContent, "    if (exec->argumentCount() > $argsIndex && !${argValue}.isUndefinedOrNull() && !${argValue}.isString() && !${argValue}.isObject())\n");
    20832086                                    push(@implContent, "        return throwVMTypeError(exec);\n");
     
    20852088                                    push(@implContent, "    if (exec->argumentCount() > $argsIndex && !${argValue}.isUndefinedOrNull() && !${argValue}.isNumber())\n");
    20862089                                    push(@implContent, "        return throwVMTypeError(exec);\n");
    2087                                 } elsif (!IsNativeType($argType)) {
    2088                                     push(@implContent, "    if (exec->argumentCount() > $argsIndex && !${argValue}.isUndefinedOrNull() && !${argValue}.inherits(&JS${argType}::s_info))\n");
    2089                                     push(@implContent, "        return throwVMTypeError(exec);\n");
    2090                                 }
     2090                                }
    20912091                            }
    20922092
  • trunk/WebCore/bindings/scripts/CodeGeneratorV8.pm

    r70410 r70411  
    943943    if ($attribute->signature->extendedAttributes->{"StrictTypeChecking"}) {
    944944        my $argType = GetTypeFromSignature($attribute->signature);
    945         if ($codeGenerator->IsStringType($argType)) {
     945        if (IsWrapperType($argType)) {
     946            push(@implContentDecls, "    if (!isUndefinedOrNull(value) && !V8${argType}::HasInstance(value)) {\n");
     947            push(@implContentDecls, "        V8Proxy::throwTypeError();\n");
     948            push(@implContentDecls, "        return;\n");
     949            push(@implContentDecls, "    }\n");
     950        } elsif ($codeGenerator->IsStringType($argType)) {
    946951            push(@implContentDecls, "    if (!isUndefinedOrNull(value) && !value->IsString() && !value->IsObject()) {\n");
    947952            push(@implContentDecls, "        V8Proxy::throwTypeError();\n");
     
    950955        } elsif ($codeGenerator->IsNumericType($argType)) {
    951956            push(@implContentDecls, "    if (!isUndefinedOrNull(value) && !value->IsNumber()) {\n");
    952             push(@implContentDecls, "        V8Proxy::throwTypeError();\n");
    953             push(@implContentDecls, "        return;\n");
    954             push(@implContentDecls, "    }\n");
    955         } elsif (IsWrapperType($argType)) {
    956             push(@implContentDecls, "    if (!isUndefinedOrNull(value) && !V8${argType}::HasInstance(value)) {\n");
    957957            push(@implContentDecls, "        V8Proxy::throwTypeError();\n");
    958958            push(@implContentDecls, "        return;\n");
     
    14071407                my $argValue = "args[$paramIndex]";
    14081408                my $argType = GetTypeFromSignature($parameter);
    1409                 if ($codeGenerator->IsStringType($argType)) {
     1409                if (IsWrapperType($argType)) {
     1410                    push(@implContentDecls, "    if (args.Length() > $paramIndex && !isUndefinedOrNull($argValue) && !V8${argType}::HasInstance($argValue)) {\n");
     1411                    push(@implContentDecls, "        V8Proxy::throwTypeError();\n");
     1412                    push(@implContentDecls, "        return notHandledByInterceptor();\n");
     1413                    push(@implContentDecls, "    }\n");
     1414                } elsif ($codeGenerator->IsStringType($argType)) {
    14101415                    push(@implContentDecls, "    if (args.Length() > $paramIndex && !isUndefinedOrNull($argValue) && !${argValue}->IsString() && !${argValue}->IsObject()) {\n");
    14111416                    push(@implContentDecls, "        V8Proxy::throwTypeError();\n");
     
    14141419                } elsif ($codeGenerator->IsNumericType($argType)) {
    14151420                    push(@implContentDecls, "    if (args.Length() > $paramIndex && !isUndefinedOrNull($argValue) && !${argValue}->IsNumber()) {\n");
    1416                     push(@implContentDecls, "        V8Proxy::throwTypeError();\n");
    1417                     push(@implContentDecls, "        return notHandledByInterceptor();\n");
    1418                     push(@implContentDecls, "    }\n");
    1419                 } elsif (IsWrapperType($argType)) {
    1420                     push(@implContentDecls, "    if (args.Length() > $paramIndex && !isUndefinedOrNull($argValue) && !V8${argType}::HasInstance($argValue)) {\n");
    14211421                    push(@implContentDecls, "        V8Proxy::throwTypeError();\n");
    14221422                    push(@implContentDecls, "        return notHandledByInterceptor();\n");
Note: See TracChangeset for help on using the changeset viewer.