Changeset 60789 in webkit


Ignore:
Timestamp:
Jun 7, 2010 10:53:08 AM (14 years ago)
Author:
andreip@google.com
Message:

2010-06-07 Andrei Popescu <andreip@google.com>

Reviewed by Jeremy Orlow.

run-bindings-tests results broken by Changeset 60776
https://bugs.webkit.org/show_bug.cgi?id=40230

The change to CodeGeneratorJS.pm in
http://trac.webkit.org/changeset/60776/trunk/WebCore/bindings/scripts/CodeGeneratorJS.pm
added the possibility to use [CallWith=ScriptExecutionContext] in idl files.

Before the above change was submitted, CodeGeneratorJS.pm was modified so that native
functions return EncodedJSValue instead of JSValues. This was done in
http://trac.webkit.org/changeset/60631/trunk/WebCore/bindings/scripts/CodeGeneratorJS.pm

This CL updates the CodeGeneratorJS.pm to correctly return an EncodedJSValue in the case
where the ScriptExecutionContext pointer is 0 at the time when the native function is invoked.

No new tests, just fixing run-bindings-tests.

  • bindings/scripts/CodeGeneratorJS.pm:
  • bindings/scripts/test/JS/JSTestObj.cpp: (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContext):
  • bindings/scripts/test/JS/JSTestObj.h:
Location:
trunk/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r60788 r60789  
     12010-06-07  Andrei Popescu  <andreip@google.com>
     2
     3        Reviewed by Jeremy Orlow.
     4
     5        run-bindings-tests results broken by Changeset 60776
     6        https://bugs.webkit.org/show_bug.cgi?id=40230
     7
     8        The change to CodeGeneratorJS.pm in
     9        http://trac.webkit.org/changeset/60776/trunk/WebCore/bindings/scripts/CodeGeneratorJS.pm
     10        added the possibility to use [CallWith=ScriptExecutionContext] in idl files.
     11
     12        Before the above change was submitted, CodeGeneratorJS.pm was modified so that native
     13        functions return EncodedJSValue instead of JSValues. This was done in
     14        http://trac.webkit.org/changeset/60631/trunk/WebCore/bindings/scripts/CodeGeneratorJS.pm
     15
     16        This CL updates the CodeGeneratorJS.pm to correctly return an EncodedJSValue in the case
     17        where the ScriptExecutionContext pointer is 0 at the time when the native function is invoked.
     18
     19        No new tests, just fixing run-bindings-tests.
     20
     21        * bindings/scripts/CodeGeneratorJS.pm:
     22        * bindings/scripts/test/JS/JSTestObj.cpp:
     23        (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContext):
     24        * bindings/scripts/test/JS/JSTestObj.h:
     25
    1262010-06-07  Kwang Yul Seo  <skyul@company100.net>
    227
  • trunk/WebCore/bindings/scripts/CodeGeneratorJS.pm

    r60776 r60789  
    18931893                            push(@implContent, "    ScriptExecutionContext* scriptContext = static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();\n");
    18941894                            push(@implContent, "    if (!scriptContext)\n");
    1895                             push(@implContent, "        return jsUndefined();\n");
     1895                            push(@implContent, "        return JSValue::encode(jsUndefined());\n");
    18961896                            $callWithArg = "scriptContext";
    18971897                        }
  • trunk/WebCore/bindings/scripts/test/JS/JSTestObj.cpp

    r60776 r60789  
    761761}
    762762
    763 
    764763EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptExecutionContext(ExecState* exec)
    765764{
    766765    JSValue thisValue = exec->hostThisValue();
    767766    if (!thisValue.inherits(&JSTestObj::s_info))
    768         return throwError(exec, TypeError);
     767        return throwVMTypeError(exec);
    769768    JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
    770769    TestObj* imp = static_cast<TestObj*>(castedThis->impl());
    771770    ScriptExecutionContext* scriptContext = static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
    772771    if (!scriptContext)
    773         return jsUndefined();
     772        return JSValue::encode(jsUndefined());
    774773
    775774    imp->withScriptExecutionContext(scriptContext);
  • trunk/WebCore/bindings/scripts/test/JS/JSTestObj.h

    r60776 r60789  
    116116JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndTwoOptionalArgs(JSC::ExecState*);
    117117JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod(JSC::ExecState*);
    118 
    119118// Attributes
    120119
Note: See TracChangeset for help on using the changeset viewer.