Changeset 94811 in webkit


Ignore:
Timestamp:
Sep 8, 2011 3:38:44 PM (13 years ago)
Author:
weinig@apple.com
Message:

Remove the Completion object from JSC, I have never liked it
https://bugs.webkit.org/show_bug.cgi?id=67755

Reviewed by Gavin Barraclough.

../JavaScriptCore:

  • Removes the Completion object and replaces its use with out parameter exceptions.
  • Remove ComplType and virtual exceptionType() function on JSObject. Replace with ClassInfo for InterruptedExecutionError and TerminatedExecutionError.
  • API/JSBase.cpp:

(JSEvaluateScript):
(JSCheckScriptSyntax):

(JSC::Interpreter::throwException):

  • jsc.cpp:

(functionLoad):
(functionCheckSyntax):
(runWithScripts):
(runInteractive):

  • runtime/Completion.cpp:

(JSC::checkSyntax):
(JSC::evaluate):

  • runtime/Completion.h:
  • runtime/ExceptionHelpers.cpp:

(JSC::InterruptedExecutionError::toString):
(JSC::TerminatedExecutionError::toString):
(JSC::createInterruptedExecutionException):

  • runtime/ExceptionHelpers.h:

(JSC::InterruptedExecutionError::InterruptedExecutionError):
(JSC::InterruptedExecutionError::create):
(JSC::InterruptedExecutionError::createStructure):
(JSC::TerminatedExecutionError::TerminatedExecutionError):
(JSC::TerminatedExecutionError::create):
(JSC::TerminatedExecutionError::createStructure):

  • runtime/JSGlobalData.cpp:

(JSC::JSGlobalData::JSGlobalData):

  • runtime/JSObject.h:

../JavaScriptGlue:

  • JSRun.cpp:

(JSRun::Evaluate):
(JSRun::CheckSyntax):

  • JSRun.h:
  • JavaScriptGlue.cpp:

(JSRunEvaluate):

../WebCore:

  • bindings/js/JSDOMBinding.cpp:

(WebCore::reportException):

  • bindings/js/JSEventListener.cpp:

(WebCore::JSEventListener::handleEvent):

  • bindings/js/JSInjectedScriptManager.cpp:

(WebCore::InjectedScriptManager::createInjectedScript):

  • bindings/js/JSMainThreadExecState.h:

(WebCore::JSMainThreadExecState::evaluate):

  • bindings/js/ScriptController.cpp:

(WebCore::ScriptController::evaluateInWorld):

  • bindings/js/WorkerScriptController.cpp:

(WebCore::WorkerScriptController::evaluate):

  • bindings/objc/WebScriptObject.mm:

(-[WebScriptObject evaluateWebScript:]):

  • bridge/NP_jsobject.cpp:

(_NPN_Evaluate):

  • bridge/jni/jni_jsobject.mm:

(JavaJSObject::eval):

../WebKit/mac:

  • Plugins/Hosted/NetscapePluginInstanceProxy.mm:

(WebKit::NetscapePluginInstanceProxy::evaluate):

../WebKit/qt:

  • Api/qwebelement.cpp:

(QWebElement::evaluateJavaScript):

../WebKit2:

  • WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:

(WebKit::NPRuntimeObjectMap::evaluate):

Location:
trunk/Source
Files:
33 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/API/JSBase.cpp

    r91401 r94811  
    3030#include "APICast.h"
    3131#include "APIShims.h"
    32 #include "Completion.h"
    3332#include "OpaqueJSString.h"
    3433#include "SourceCode.h"
     
    5352    JSGlobalObject* globalObject = exec->dynamicGlobalObject();
    5453    SourceCode source = makeSource(script->ustring(), sourceURL->ustring(), startingLineNumber);
    55     Completion completion = evaluate(globalObject->globalExec(), globalObject->globalScopeChain(), source, jsThisObject);
    5654
    57     if (completion.complType() == Throw) {
     55    JSValue evaluationException;
     56    JSValue returnValue = evaluate(globalObject->globalExec(), globalObject->globalScopeChain(), source, jsThisObject, &evaluationException);
     57
     58    if (evaluationException) {
    5859        if (exception)
    59             *exception = toRef(exec, completion.value());
     60            *exception = toRef(exec, evaluationException);
    6061        return 0;
    6162    }
    6263
    63     if (completion.value())
    64         return toRef(exec, completion.value());
    65    
     64    if (returnValue)
     65        return toRef(exec, returnValue);
     66
    6667    // happens, for example, when the only statement is an empty (';') statement
    6768    return toRef(exec, jsUndefined());
     
    7475
    7576    SourceCode source = makeSource(script->ustring(), sourceURL->ustring(), startingLineNumber);
    76     Completion completion = checkSyntax(exec->dynamicGlobalObject()->globalExec(), source);
    77     if (completion.complType() == Throw) {
     77   
     78    JSValue syntaxException;
     79    bool isValidSyntax = checkSyntax(exec->dynamicGlobalObject()->globalExec(), source, &syntaxException);
     80
     81    if (!isValidSyntax) {
    7882        if (exception)
    79             *exception = toRef(exec, completion.value());
     83            *exception = toRef(exec, syntaxException);
    8084        return false;
    8185    }
    82    
     86
    8387    return true;
    8488}
  • trunk/Source/JavaScriptCore/ChangeLog

    r94806 r94811  
     12011-09-08  Sam Weinig  <sam@webkit.org>
     2
     3        Remove the Completion object from JSC, I have never liked it
     4        https://bugs.webkit.org/show_bug.cgi?id=67755
     5
     6        Reviewed by Gavin Barraclough.
     7
     8        - Removes the Completion object and replaces its use with out parameter exceptions.
     9        - Remove ComplType and virtual exceptionType() function on JSObject. Replace with
     10          ClassInfo for InterruptedExecutionError and TerminatedExecutionError.
     11
     12        * API/JSBase.cpp:
     13        (JSEvaluateScript):
     14        (JSCheckScriptSyntax):
     15        * JavaScriptCore.exp:
     16        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
     17        * interpreter/Interpreter.cpp:
     18        (JSC::Interpreter::throwException):
     19        * jsc.cpp:
     20        (functionLoad):
     21        (functionCheckSyntax):
     22        (runWithScripts):
     23        (runInteractive):
     24        * runtime/Completion.cpp:
     25        (JSC::checkSyntax):
     26        (JSC::evaluate):
     27        * runtime/Completion.h:
     28        * runtime/ExceptionHelpers.cpp:
     29        (JSC::InterruptedExecutionError::toString):
     30        (JSC::TerminatedExecutionError::toString):
     31        (JSC::createInterruptedExecutionException):
     32        * runtime/ExceptionHelpers.h:
     33        (JSC::InterruptedExecutionError::InterruptedExecutionError):
     34        (JSC::InterruptedExecutionError::create):
     35        (JSC::InterruptedExecutionError::createStructure):
     36        (JSC::TerminatedExecutionError::TerminatedExecutionError):
     37        (JSC::TerminatedExecutionError::create):
     38        (JSC::TerminatedExecutionError::createStructure):
     39        * runtime/JSGlobalData.cpp:
     40        (JSC::JSGlobalData::JSGlobalData):
     41        * runtime/JSObject.h:
     42
    1432011-09-08  Ryosuke Niwa  <rniwa@webkit.org>
    244
  • trunk/Source/JavaScriptCore/JavaScriptCore.exp

    r94774 r94811  
    120120__ZN3JSC11JSByteArrayC1EPNS_9ExecStateEPNS_9StructureEPN3WTF9ByteArrayE
    121121__ZN3JSC11ParserArena5resetEv
    122 __ZN3JSC11checkSyntaxEPNS_9ExecStateERKNS_10SourceCodeE
     122__ZN3JSC11checkSyntaxEPNS_9ExecStateERKNS_10SourceCodeEPNS_7JSValueE
    123123__ZN3JSC11createErrorEPNS_9ExecStateERKNS_7UStringE
    124124__ZN3JSC11regExpFlagsERKNS_7UStringE
     
    136136__ZN3JSC12JSGlobalData15dumpRegExpTraceEv
    137137__ZN3JSC12JSGlobalData22clearBuiltinStructuresEv
     138__ZN3JSC12JSGlobalData23releaseExecutableMemoryEv
    138139__ZN3JSC12JSGlobalData6createENS_15ThreadStackTypeENS_8HeapSizeE
    139140__ZN3JSC12JSGlobalDataD1Ev
     
    218219__ZN3JSC23setUpStaticFunctionSlotEPNS_9ExecStateEPKNS_9HashEntryEPNS_8JSObjectERKNS_10IdentifierERNS_12PropertySlotE
    219220__ZN3JSC24DynamicGlobalObjectScopeC1ERNS_12JSGlobalDataEPNS_14JSGlobalObjectE
     221__ZN3JSC24TerminatedExecutionError6s_infoE
    220222__ZN3JSC24createStackOverflowErrorEPNS_9ExecStateE
    221223__ZN3JSC25evaluateInGlobalCallFrameERKNS_7UStringERNS_7JSValueEPNS_14JSGlobalObjectE
     
    327329__ZN3JSC8Profiler14startProfilingEPNS_9ExecStateERKNS_7UStringE
    328330__ZN3JSC8Profiler8profilerEv
    329 __ZN3JSC8evaluateEPNS_9ExecStateEPNS_14ScopeChainNodeERKNS_10SourceCodeENS_7JSValueE
     331__ZN3JSC8evaluateEPNS_9ExecStateEPNS_14ScopeChainNodeERKNS_10SourceCodeENS_7JSValueEPS7_
    330332__ZN3JSC8isZombieEPKNS_6JSCellE
    331333__ZN3JSC9CodeBlockD1Ev
     
    618620_jscore_fastmalloc_introspection
    619621_kJSClassDefinitionEmpty
    620 
    621 #ifndef NDEBUG
    622 __ZN3JSC12JSGlobalData23releaseExecutableMemoryEv
    623 #endif
  • trunk/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def

    r94774 r94811  
    4040    ??8JSC@@YA_NABVUString@0@0@Z
    4141    ??8WTF@@YA_NABVCString@0@0@Z
     42    ?checkSyntax@JSC@@YA_NPAVExecState@1@ABVSourceCode@1@PAVJSValue@1@@Z
     43    ?evaluate@JSC@@YA?AVJSValue@1@PAVExecState@1@PAVScopeChainNode@1@ABVSourceCode@1@V21@PAV21@@Z
    4244    ?EcmaScriptConverter@DoubleToStringConverter@double_conversion@WTF@@SAABV123@XZ
    4345    ?ToExponential@DoubleToStringConverter@double_conversion@WTF@@QBE_NNHPAVStringBuilder@23@@Z
     
    8183    ?checkCurrentIdentifierTable@Identifier@JSC@@CAXPAVExecState@2@@Z
    8284    ?checkCurrentIdentifierTable@Identifier@JSC@@CAXPAVJSGlobalData@2@@Z
    83     ?checkSyntax@JSC@@YA?AVCompletion@1@PAVExecState@1@ABVSourceCode@1@@Z
    8485    ?checksum@MD5@WTF@@QAEXAAV?$Vector@E$0BA@@2@@Z
    8586    ?className@JSObject@JSC@@UBE?AVUString@2@XZ
     
    161162    ?equalUTF16WithUTF8@Unicode@WTF@@YA_NPB_W0PBD1@Z
    162163    ?evaluate@DebuggerCallFrame@JSC@@QBE?AVJSValue@2@ABVUString@2@AAV32@@Z
    163     ?evaluate@JSC@@YA?AVCompletion@1@PAVExecState@1@PAVScopeChainNode@1@ABVSourceCode@1@VJSValue@1@@Z
    164164    ?exclude@Profile@JSC@@QAEXPBVProfileNode@2@@Z
    165165    ?fastCalloc@WTF@@YAPAXII@Z
  • trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp

    r94336 r94811  
    709709        }
    710710
    711         ComplType exceptionType = exception->exceptionType();
    712         isInterrupt = exceptionType == Interrupted || exceptionType == Terminated;
     711        isInterrupt = (exception->inherits(&InterruptedExecutionError::s_info) || exception->inherits(&TerminatedExecutionError::s_info));
    713712    }
    714713
  • trunk/Source/JavaScriptCore/jsc.cpp

    r94644 r94811  
    262262
    263263    JSGlobalObject* globalObject = exec->lexicalGlobalObject();
    264     Completion result = evaluate(globalObject->globalExec(), globalObject->globalScopeChain(), makeSource(script.data(), fileName));
    265     if (result.complType() == Throw)
    266         throwError(exec, result.value());
    267     return JSValue::encode(result.value());
     264   
     265    JSValue evaluationException;
     266    JSValue result = evaluate(globalObject->globalExec(), globalObject->globalScopeChain(), makeSource(script.data(), fileName), JSValue(), &evaluationException);
     267    if (evaluationException)
     268        throwError(exec, evaluationException);
     269    return JSValue::encode(result);
    268270}
    269271
     
    279281    StopWatch stopWatch;
    280282    stopWatch.start();
    281     Completion result = checkSyntax(globalObject->globalExec(), makeSource(script.data(), fileName));
     283
     284    JSValue syntaxException;
     285    bool validSyntax = checkSyntax(globalObject->globalExec(), makeSource(script.data(), fileName), &syntaxException);
    282286    stopWatch.stop();
    283287
    284     if (result.complType() == Throw)
    285         throwError(exec, result.value());
     288    if (!validSyntax)
     289        throwError(exec, syntaxException);
    286290    return JSValue::encode(jsNumber(stopWatch.getElapsedMS()));
    287291}
     
    437441        globalData.startSampling();
    438442
    439         Completion completion = evaluate(globalObject->globalExec(), globalObject->globalScopeChain(), makeSource(script, fileName));
    440         success = success && completion.complType() != Throw;
     443        JSValue evaluationException;
     444        JSValue returnValue = evaluate(globalObject->globalExec(), globalObject->globalScopeChain(), makeSource(script, fileName), JSValue(), &evaluationException);
     445        success = success && !evaluationException;
    441446        if (dump) {
    442             if (completion.complType() == Throw)
    443                 printf("Exception: %s\n", completion.value().toString(globalObject->globalExec()).utf8().data());
     447            if (evaluationException)
     448                printf("Exception: %s\n", evaluationException.toString(globalObject->globalExec()).utf8().data());
    444449            else
    445                 printf("End: %s\n", completion.value().toString(globalObject->globalExec()).utf8().data());
     450                printf("End: %s\n", returnValue.toString(globalObject->globalExec()).utf8().data());
    446451        }
    447452
     
    474479        if (line[0])
    475480            add_history(line);
    476         Completion completion = evaluate(globalObject->globalExec(), globalObject->globalScopeChain(), makeSource(line, interpreterName));
     481        JSValue evaluationException;
     482        JSValue returnValue = evaluate(globalObject->globalExec(), globalObject->globalScopeChain(), makeSource(line, interpreterName), JSValue(), &evaluationException);
    477483        free(line);
    478484#else
     
    489495            break;
    490496        line.append('\0');
    491         Completion completion = evaluate(globalObject->globalExec(), globalObject->globalScopeChain(), makeSource(line.data(), interpreterName));
    492 #endif
    493         if (completion.complType() == Throw)
    494             printf("Exception: %s\n", completion.value().toString(globalObject->globalExec()).utf8().data());
     497
     498        JSValue evaluationException;
     499        JSValue returnValue = evaluate(globalObject->globalExec(), globalObject->globalScopeChain(), makeSource(line.data(), interpreterName), JSValue(), &evaluationException);
     500#endif
     501        if (evaluationException)
     502            printf("Exception: %s\n", evaluationException.toString(globalObject->globalExec()).utf8().data());
    495503        else
    496             printf("%s\n", completion.value().toString(globalObject->globalExec()).utf8().data());
     504            printf("%s\n", returnValue.toString(globalObject->globalExec()).utf8().data());
    497505
    498506        globalObject->globalExec()->clearException();
  • trunk/Source/JavaScriptCore/runtime/Completion.cpp

    r91095 r94811  
    3535namespace JSC {
    3636
    37 Completion checkSyntax(ExecState* exec, const SourceCode& source)
     37bool checkSyntax(ExecState* exec, const SourceCode& source, JSValue* returnedException)
    3838{
    3939    JSLock lock(exec);
     
    4242    ProgramExecutable* program = ProgramExecutable::create(exec, source);
    4343    JSObject* error = program->checkSyntax(exec);
    44     if (error)
    45         return Completion(Throw, error);
     44    if (error) {
     45        if (returnedException)
     46            *returnedException = error;
     47        return false;
     48    }
    4649
    47     return Completion(Normal);
     50    return true;
    4851}
    4952
    50 Completion evaluate(ExecState* exec, ScopeChainNode* scopeChain, const SourceCode& source, JSValue thisValue)
     53JSValue evaluate(ExecState* exec, ScopeChainNode* scopeChain, const SourceCode& source, JSValue thisValue, JSValue* returnedException)
    5154{
    5255    JSLock lock(exec);
     
    5558    ProgramExecutable* program = ProgramExecutable::create(exec, source);
    5659    if (!program) {
    57         JSValue exception = exec->globalData().exception;
     60        if (returnedException)
     61            *returnedException = exec->globalData().exception;
     62
    5863        exec->globalData().exception = JSValue();
    59         return Completion(Throw, exception);
     64        return jsUndefined();
    6065    }
    6166
     
    6368        thisValue = exec->dynamicGlobalObject();
    6469    JSObject* thisObj = thisValue.toThisObject(exec);
    65 
    6670    JSValue result = exec->interpreter()->execute(program, exec, scopeChain, thisObj);
    6771
    6872    if (exec->hadException()) {
    69         JSValue exception = exec->exception();
     73        if (returnedException)
     74            *returnedException = exec->exception();
     75
    7076        exec->clearException();
     77        return jsUndefined();
     78    }
    7179
    72         ComplType exceptionType = Throw;
    73         if (exception.isObject())
    74             exceptionType = asObject(exception)->exceptionType();
    75         return Completion(exceptionType, exception);
    76     }
    77     return Completion(Normal, result);
     80    ASSERT(result);
     81    return result;
    7882}
    7983
  • trunk/Source/JavaScriptCore/runtime/Completion.h

    r79904 r94811  
    3232    class SourceCode;
    3333
    34     enum ComplType { Normal, Break, Continue, ReturnValue, Throw, Interrupted, Terminated };
    35 
    36     /*
    37      * Completion objects are used to convey the return status and value
    38      * from functions.
    39      */
    40     class Completion {
    41     public:
    42         Completion(ComplType type = Normal, JSValue value = JSValue())
    43             : m_type(type)
    44             , m_value(value)
    45         {
    46         }
    47 
    48         ComplType complType() const { return m_type; }
    49         JSValue value() const { return m_value; }
    50         void setValue(JSValue v) { m_value = v; }
    51         bool isValueCompletion() const { return m_value; }
    52 
    53     private:
    54         ComplType m_type;
    55         JSValue m_value;
    56     };
    57 
    58     Completion checkSyntax(ExecState*, const SourceCode&);
    59     Completion evaluate(ExecState*, ScopeChainNode*, const SourceCode&, JSValue thisValue = JSValue());
     34    bool checkSyntax(ExecState*, const SourceCode&, JSValue* exception = 0);
     35    JSValue evaluate(ExecState*, ScopeChainNode*, const SourceCode&, JSValue thisValue = JSValue(), JSValue* exception = 0);
    6036
    6137} // namespace JSC
  • trunk/Source/JavaScriptCore/runtime/ExceptionHelpers.cpp

    r94364 r94811  
    4242namespace JSC {
    4343
    44 class InterruptedExecutionError : public JSNonFinalObject {
    45 private:
    46     InterruptedExecutionError(JSGlobalData& globalData)
    47         : JSNonFinalObject(globalData, globalData.interruptedExecutionErrorStructure.get())
    48     {
    49     }
     44const ClassInfo InterruptedExecutionError::s_info = { "InterruptedExecutionError", 0, 0, 0 };
    5045
    51 public:
    52     typedef JSNonFinalObject Base;
     46UString InterruptedExecutionError::toString(ExecState*) const
     47{
     48    return "JavaScript execution exceeded timeout.";
     49}
    5350
    54     static InterruptedExecutionError* create(JSGlobalData& globalData)
    55     {
    56         InterruptedExecutionError* error = new (allocateCell<InterruptedExecutionError>(globalData.heap)) InterruptedExecutionError(globalData);
    57         error->finishCreation(globalData);
    58         return error;
    59     }
     51const ClassInfo TerminatedExecutionError::s_info = { "TerminatedExecutionError", 0, 0, 0 };
    6052
    61     virtual ComplType exceptionType() const { return Interrupted; }
     53UString TerminatedExecutionError::toString(ExecState*) const
     54{
     55    return "JavaScript execution terminated.";
     56}
    6257
    63     virtual UString toString(ExecState*) const { return "JavaScript execution exceeded timeout."; }
    64 };
    6558
    6659JSObject* createInterruptedExecutionException(JSGlobalData* globalData)
     
    6861    return InterruptedExecutionError::create(*globalData);
    6962}
    70 
    71 class TerminatedExecutionError : public JSNonFinalObject {
    72 private:
    73     TerminatedExecutionError(JSGlobalData& globalData)
    74         : JSNonFinalObject(globalData, globalData.terminatedExecutionErrorStructure.get())
    75     {
    76     }
    77 
    78 public:
    79     typedef JSNonFinalObject Base;
    80 
    81     static TerminatedExecutionError* create(JSGlobalData& globalData)
    82     {
    83         TerminatedExecutionError* error = new (allocateCell<TerminatedExecutionError>(globalData.heap)) TerminatedExecutionError(globalData);
    84         error->finishCreation(globalData);
    85         return error;
    86     }
    87 
    88     virtual ComplType exceptionType() const { return Terminated; }
    89 
    90     virtual UString toString(ExecState*) const { return "JavaScript execution terminated."; }
    91 };
    9263
    9364JSObject* createTerminatedExecutionException(JSGlobalData* globalData)
  • trunk/Source/JavaScriptCore/runtime/ExceptionHelpers.h

    r75408 r94811  
    3030#define ExceptionHelpers_h
    3131
    32 #include "JSValue.h"
     32#include "JSObject.h"
    3333
    3434namespace JSC {
    3535
    36     class CodeBlock;
    37     class ExecState;
    38     class Identifier;
    39     class JSGlobalData;
    40     class JSGlobalObject;
    41     class JSNotAnObjectErrorStub;
    42     class JSObject;
    43     class Node;
    44     struct Instruction;
    45    
    46     JSObject* createInterruptedExecutionException(JSGlobalData*);
    47     JSObject* createTerminatedExecutionException(JSGlobalData*);
    48     JSObject* createStackOverflowError(ExecState*);
    49     JSObject* createStackOverflowError(JSGlobalObject*);
    50     JSObject* createOutOfMemoryError(JSGlobalObject*);
    51     JSObject* createUndefinedVariableError(ExecState*, const Identifier&);
    52     JSObject* createNotAnObjectError(ExecState*, JSValue);
    53     JSObject* createInvalidParamError(ExecState*, const char* op, JSValue);
    54     JSObject* createNotAConstructorError(ExecState*, JSValue);
    55     JSObject* createNotAFunctionError(ExecState*, JSValue);
    56     JSObject* createErrorForInvalidGlobalAssignment(ExecState*, const UString&);
     36JSObject* createInterruptedExecutionException(JSGlobalData*);
     37JSObject* createTerminatedExecutionException(JSGlobalData*);
     38JSObject* createStackOverflowError(ExecState*);
     39JSObject* createStackOverflowError(JSGlobalObject*);
     40JSObject* createOutOfMemoryError(JSGlobalObject*);
     41JSObject* createUndefinedVariableError(ExecState*, const Identifier&);
     42JSObject* createNotAnObjectError(ExecState*, JSValue);
     43JSObject* createInvalidParamError(ExecState*, const char* op, JSValue);
     44JSObject* createNotAConstructorError(ExecState*, JSValue);
     45JSObject* createNotAFunctionError(ExecState*, JSValue);
     46JSObject* createErrorForInvalidGlobalAssignment(ExecState*, const UString&);
    5747
    58     JSObject* throwOutOfMemoryError(ExecState*);
    59     JSObject* throwStackOverflowError(ExecState*);
     48JSObject* throwOutOfMemoryError(ExecState*);
     49JSObject* throwStackOverflowError(ExecState*);
     50
     51
     52class InterruptedExecutionError : public JSNonFinalObject {
     53private:
     54    InterruptedExecutionError(JSGlobalData& globalData)
     55        : JSNonFinalObject(globalData, globalData.interruptedExecutionErrorStructure.get())
     56    {
     57    }
     58
     59    virtual UString toString(ExecState*) const;
     60
     61public:
     62    typedef JSNonFinalObject Base;
     63
     64    static InterruptedExecutionError* create(JSGlobalData& globalData)
     65    {
     66        InterruptedExecutionError* error = new (allocateCell<InterruptedExecutionError>(globalData.heap)) InterruptedExecutionError(globalData);
     67        error->finishCreation(globalData);
     68        return error;
     69    }
     70
     71    static Structure* createStructure(JSGlobalData& globalData, JSGlobalObject* globalObject, JSValue prototype)
     72    {
     73        return Structure::create(globalData, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount, &s_info);
     74    }
     75
     76    static JS_EXPORTDATA const ClassInfo s_info;
     77};
     78
     79class TerminatedExecutionError : public JSNonFinalObject {
     80private:
     81    TerminatedExecutionError(JSGlobalData& globalData)
     82        : JSNonFinalObject(globalData, globalData.terminatedExecutionErrorStructure.get())
     83    {
     84    }
     85
     86    virtual UString toString(ExecState*) const;
     87
     88public:
     89    typedef JSNonFinalObject Base;
     90
     91    static TerminatedExecutionError* create(JSGlobalData& globalData)
     92    {
     93        TerminatedExecutionError* error = new (allocateCell<TerminatedExecutionError>(globalData.heap)) TerminatedExecutionError(globalData);
     94        error->finishCreation(globalData);
     95        return error;
     96    }
     97
     98    static Structure* createStructure(JSGlobalData& globalData, JSGlobalObject* globalObject, JSValue prototype)
     99    {
     100        return Structure::create(globalData, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount, &s_info);
     101    }
     102
     103    static JS_EXPORTDATA const ClassInfo s_info;
     104};
    60105
    61106} // namespace JSC
  • trunk/Source/JavaScriptCore/runtime/JSGlobalData.cpp

    r94599 r94811  
    217217    debuggerActivationStructure.set(*this, DebuggerActivation::createStructure(*this, 0, jsNull()));
    218218    activationStructure.set(*this, JSActivation::createStructure(*this, 0, jsNull()));
    219     interruptedExecutionErrorStructure.set(*this, JSNonFinalObject::createStructure(*this, 0, jsNull()));
    220     terminatedExecutionErrorStructure.set(*this, JSNonFinalObject::createStructure(*this, 0, jsNull()));
     219    interruptedExecutionErrorStructure.set(*this, InterruptedExecutionError::createStructure(*this, 0, jsNull()));
     220    terminatedExecutionErrorStructure.set(*this, TerminatedExecutionError::createStructure(*this, 0, jsNull()));
    221221    staticScopeStructure.set(*this, JSStaticScopeObject::createStructure(*this, 0, jsNull()));
    222222    strictEvalActivationStructure.set(*this, StrictEvalActivation::createStructure(*this, 0, jsNull()));
  • trunk/Source/JavaScriptCore/runtime/JSObject.h

    r94701 r94811  
    2727#include "ClassInfo.h"
    2828#include "CommonIdentifiers.h"
    29 #include "Completion.h"
    3029#include "CallFrame.h"
    3130#include "JSCell.h"
     
    219218        bool isFrozen(JSGlobalData& globalData) { return m_structure->isFrozen(globalData); }
    220219        bool isExtensible() { return m_structure->isExtensible(); }
    221 
    222         virtual ComplType exceptionType() const { return Throw; }
    223220
    224221        void allocatePropertyStorage(size_t oldSize, size_t newSize);
  • trunk/Source/JavaScriptGlue/ChangeLog

    r94644 r94811  
     12011-09-08  Sam Weinig  <sam@webkit.org>
     2
     3        Remove the Completion object from JSC, I have never liked it
     4        https://bugs.webkit.org/show_bug.cgi?id=67755
     5
     6        Reviewed by Gavin Barraclough.
     7
     8        * JSRun.cpp:
     9        (JSRun::Evaluate):
     10        (JSRun::CheckSyntax):
     11        * JSRun.h:
     12        * JavaScriptGlue.cpp:
     13        (JSRunEvaluate):
     14
    1152011-09-07  Sheriff Bot  <webkit.review.bot@gmail.com>
    216
  • trunk/Source/JavaScriptGlue/JSRun.cpp

    r94644 r94811  
    6868}
    6969
    70 Completion JSRun::Evaluate()
     70JSValue JSRun::Evaluate(JSValue* expception)
    7171{
    72     return JSC::evaluate(fGlobalObject->globalExec(), fGlobalObject->globalScopeChain(), makeSource(fSource));
     72    return JSC::evaluate(fGlobalObject->globalExec(), fGlobalObject->globalScopeChain(), makeSource(fSource), JSValue(), expception);
    7373}
    7474
    7575bool JSRun::CheckSyntax()
    7676{
    77     return JSC::checkSyntax(fGlobalObject->globalExec(), makeSource(fSource)).complType() != Throw;
     77    return JSC::checkSyntax(fGlobalObject->globalExec(), makeSource(fSource));
    7878}
  • trunk/Source/JavaScriptGlue/JSRun.h

    r94599 r94811  
    6262        UString GetSource() const;
    6363        JSGlobalObject* GlobalObject() const;
    64         Completion Evaluate();
     64        JSValue Evaluate(JSValue* exception);
    6565        bool CheckSyntax();
    6666        JSFlags Flags() const;
  • trunk/Source/JavaScriptGlue/JavaScriptGlue.cpp

    r52856 r94811  
    293293    {
    294294        JSGlueAPIEntry entry;
    295         Completion completion = ptr->Evaluate();
    296         if (completion.isValueCompletion())
    297         {
    298             result = (JSObjectRef)KJSValueToJSObject(completion.value(), ptr->GlobalObject()->globalExec());
    299         }
    300 
    301         if (completion.complType() == Throw)
    302         {
     295       
     296        JSValue evaluationException;
     297        JSValue returnValue = ptr->Evaluate(&evaluationException);
     298       
     299        if (evaluationException)
     300        {
     301            result = (JSObjectRef)KJSValueToJSObject(evaluationException, ptr->GlobalObject()->globalExec());
     302           
    303303            JSFlags flags = ptr->Flags();
    304304            if (flags & kJSFlagDebug)
     
    311311                }
    312312            }
     313        }
     314        else
     315        {
     316            result = (JSObjectRef)KJSValueToJSObject(returnValue, ptr->GlobalObject()->globalExec());
    313317        }
    314318    }
  • trunk/Source/WebCore/ChangeLog

    r94810 r94811  
     12011-09-08  Sam Weinig  <sam@webkit.org>
     2
     3        Remove the Completion object from JSC, I have never liked it
     4        https://bugs.webkit.org/show_bug.cgi?id=67755
     5
     6        Reviewed by Gavin Barraclough.
     7
     8        * bindings/js/JSDOMBinding.cpp:
     9        (WebCore::reportException):
     10        * bindings/js/JSEventListener.cpp:
     11        (WebCore::JSEventListener::handleEvent):
     12        * bindings/js/JSInjectedScriptManager.cpp:
     13        (WebCore::InjectedScriptManager::createInjectedScript):
     14        * bindings/js/JSMainThreadExecState.h:
     15        (WebCore::JSMainThreadExecState::evaluate):
     16        * bindings/js/ScriptController.cpp:
     17        (WebCore::ScriptController::evaluateInWorld):
     18        * bindings/js/WorkerScriptController.cpp:
     19        (WebCore::WorkerScriptController::evaluate):
     20        * bindings/objc/WebScriptObject.mm:
     21        (-[WebScriptObject evaluateWebScript:]):
     22        * bridge/NP_jsobject.cpp:
     23        (_NPN_Evaluate):
     24        * bridge/jni/jni_jsobject.mm:
     25        (JavaJSObject::eval):
     26
    1272011-09-08  Adam Barth  <abarth@webkit.org>
    228
  • trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp

    r91194 r94811  
    5858#include <runtime/DateInstance.h>
    5959#include <runtime/Error.h>
     60#include <runtime/ExceptionHelpers.h>
    6061#include <runtime/JSFunction.h>
    6162
     
    171172void reportException(ExecState* exec, JSValue exception)
    172173{
    173     if (exception.isObject() && asObject(exception)->exceptionType() == Terminated)
     174    if (exception.inherits(&TerminatedExecutionError::s_info))
    174175        return;
    175176
  • trunk/Source/WebCore/bindings/js/JSEventListener.cpp

    r93913 r94811  
    2727#include "JSMainThreadExecState.h"
    2828#include "WorkerContext.h"
     29#include <runtime/ExceptionHelpers.h>
    2930#include <runtime/JSLock.h>
    3031#include <wtf/RefCountedLeakCounter.h>
     
    134135#if ENABLE(WORKERS)
    135136        if (scriptExecutionContext->isWorkerContext()) {
    136             bool terminatorCausedException = (exec->hadException() && exec->exception().isObject() && asObject(exec->exception())->exceptionType() == Terminated);
     137            bool terminatorCausedException = (exec->hadException() && exec->exception().inherits(&TerminatedExecutionError::s_info));
    137138            if (terminatorCausedException || globalData.terminator.shouldTerminate())
    138139                static_cast<WorkerContext*>(scriptExecutionContext)->script()->forbidExecution();
  • trunk/Source/WebCore/bindings/js/JSInjectedScriptManager.cpp

    r90124 r94811  
    5252ScriptObject InjectedScriptManager::createInjectedScript(const String& source, ScriptState* scriptState, long id)
    5353{
     54    JSLock lock(SilenceAssertionsOnly);
     55
    5456    SourceCode sourceCode = makeSource(stringToUString(source));
    55     JSLock lock(SilenceAssertionsOnly);
    5657    JSDOMGlobalObject* globalObject = static_cast<JSDOMGlobalObject*>(scriptState->lexicalGlobalObject());
    5758    JSValue globalThisValue = scriptState->globalThisValue();
    58     Completion comp = JSMainThreadExecState::evaluate(scriptState, globalObject->globalScopeChain(), sourceCode, globalThisValue);
    59     if (comp.complType() != JSC::Normal && comp.complType() != JSC::ReturnValue)
     59
     60    JSValue evaluationException;
     61    JSValue evaluationReturnValue = JSMainThreadExecState::evaluate(scriptState, globalObject->globalScopeChain(), sourceCode, globalThisValue, &evaluationException);
     62    if (evaluationException)
    6063        return ScriptObject();
    61     JSValue functionValue = comp.value();
     64
     65    JSValue functionValue = evaluationReturnValue;
    6266    CallData callData;
    6367    CallType callType = getCallData(functionValue, callData);
  • trunk/Source/WebCore/bindings/js/JSMainThreadExecState.h

    r91641 r94811  
    2828
    2929#include "JSDOMBinding.h"
     30#include <runtime/Completion.h>
    3031#ifndef NDEBUG
    3132#include <wtf/MainThread.h>
     
    5253    };
    5354
    54     static JSC::Completion evaluate(JSC::ExecState* exec, JSC::ScopeChainNode* chain, const JSC::SourceCode& source, JSC::JSValue thisValue)
     55    static JSC::JSValue evaluate(JSC::ExecState* exec, JSC::ScopeChainNode* chain, const JSC::SourceCode& source, JSC::JSValue thisValue, JSC::JSValue* exception)
    5556    {
    5657        JSMainThreadExecState currentState(exec);
    57         return JSC::evaluate(exec, chain, source, thisValue);
     58        return JSC::evaluate(exec, chain, source, thisValue, exception);
    5859    };
    5960
  • trunk/Source/WebCore/bindings/js/ScriptController.cpp

    r94364 r94811  
    139139    InspectorInstrumentationCookie cookie = InspectorInstrumentation::willEvaluateScript(m_frame, sourceURL, sourceCode.startLine());
    140140
     141    JSValue evaluationException;
     142
    141143    exec->globalData().timeoutChecker.start();
    142     Completion comp = JSMainThreadExecState::evaluate(exec, exec->dynamicGlobalObject()->globalScopeChain(), jsSourceCode, shell);
     144    JSValue returnValue = JSMainThreadExecState::evaluate(exec, exec->dynamicGlobalObject()->globalScopeChain(), jsSourceCode, shell, &evaluationException);
    143145    exec->globalData().timeoutChecker.stop();
    144146
    145147    InspectorInstrumentation::didEvaluateScript(cookie);
    146148
    147     if (comp.complType() == Normal || comp.complType() == ReturnValue) {
     149    if (evaluationException) {
     150        reportException(exec, evaluationException);
    148151        m_sourceURL = savedSourceURL;
    149         return ScriptValue(exec->globalData(), comp.value());
    150     }
    151 
    152     if (comp.complType() == Throw || comp.complType() == Interrupted)
    153         reportException(exec, comp.value());
     152        return ScriptValue();
     153    }
    154154
    155155    m_sourceURL = savedSourceURL;
    156     return ScriptValue();
     156    return ScriptValue(exec->globalData(), returnValue);
    157157}
    158158
  • trunk/Source/WebCore/bindings/js/WorkerScriptController.cpp

    r94701 r94811  
    4141#include <interpreter/Interpreter.h>
    4242#include <runtime/Completion.h>
    43 #include <runtime/Completion.h>
     43#include <runtime/ExceptionHelpers.h>
    4444#include <runtime/Error.h>
    4545#include <runtime/JSLock.h>
     
    132132
    133133    ExecState* exec = m_workerContextWrapper->globalExec();
     134
     135    JSValue evaluationException;
     136
    134137    m_workerContextWrapper->globalData().timeoutChecker.start();
    135     Completion comp = JSC::evaluate(exec, exec->dynamicGlobalObject()->globalScopeChain(), sourceCode.jsSourceCode(), m_workerContextWrapper.get());
     138    JSValue returnValue = JSC::evaluate(exec, exec->dynamicGlobalObject()->globalScopeChain(), sourceCode.jsSourceCode(), m_workerContextWrapper.get(), &evaluationException);
    136139    m_workerContextWrapper->globalData().timeoutChecker.stop();
    137140
    138 
    139     ComplType completionType = comp.complType();
    140 
    141     if (completionType == Terminated || m_workerContextWrapper->globalData().terminator.shouldTerminate()) {
     141    if ((evaluationException && evaluationException.inherits(&TerminatedExecutionError::s_info)) ||  m_workerContextWrapper->globalData().terminator.shouldTerminate()) {
    142142        forbidExecution();
    143143        return ScriptValue();
    144144    }
    145145
    146     if (completionType == Normal || completionType == ReturnValue)
    147         return ScriptValue(*m_globalData, comp.value());
    148 
    149     if (completionType == Throw) {
     146    if (evaluationException) {
    150147        String errorMessage;
    151148        int lineNumber = 0;
     
    154151            *exception = ScriptValue(*m_globalData, throwError(exec, createError(exec, errorMessage.impl())));
    155152        else
    156             *exception = ScriptValue(*m_globalData, comp.value());
     153            *exception = ScriptValue(*m_globalData, evaluationException);
    157154    }
    158     return ScriptValue();
     155
     156    return ScriptValue(*m_globalData, returnValue);
     157
    159158}
    160159
  • trunk/Source/WebCore/bindings/objc/WebScriptObject.mm

    r93026 r94811  
    326326    ASSERT(!exec->hadException());
    327327
    328     JSValue result;
    329328    JSLock lock(SilenceAssertionsOnly);
    330329   
    331330    [self _rootObject]->globalObject()->globalData().timeoutChecker.start();
    332     Completion completion = JSMainThreadExecState::evaluate([self _rootObject]->globalObject()->globalExec(), [self _rootObject]->globalObject()->globalScopeChain(), makeSource(String(script)), JSC::JSValue());
     331    JSValue returnValue = JSMainThreadExecState::evaluate(exec, [self _rootObject]->globalObject()->globalScopeChain(), makeSource(String(script)), JSC::JSValue(), 0);
    333332    [self _rootObject]->globalObject()->globalData().timeoutChecker.stop();
    334     ComplType type = completion.complType();
    335    
    336     if (type == Normal) {
    337         result = completion.value();
    338         if (!result)
    339             result = jsUndefined();
    340     } else
    341         result = jsUndefined();
    342    
    343     if (exec->hadException()) {
    344         addExceptionToConsole(exec);
    345         result = jsUndefined();
    346         exec->clearException();
    347     }
    348    
    349     id resultObj = [WebScriptObject _convertValueToObjcValue:result originRootObject:[self _originRootObject] rootObject:[self _rootObject]];
     333
     334    id resultObj = [WebScriptObject _convertValueToObjcValue:returnValue originRootObject:[self _originRootObject] rootObject:[self _rootObject]];
    350335   
    351336    _didExecute(self);
  • trunk/Source/WebCore/bridge/NP_jsobject.cpp

    r91195 r94811  
    275275        String scriptString = convertNPStringToUTF16(s);
    276276        RefPtr<JSGlobalData> globalData(&exec->globalData());
     277       
    277278        globalData->timeoutChecker.start();
    278         Completion completion = JSC::evaluate(rootObject->globalObject()->globalExec(), rootObject->globalObject()->globalScopeChain(), makeSource(scriptString), JSC::JSValue());
     279        JSValue returnValue = JSC::evaluate(rootObject->globalObject()->globalExec(), rootObject->globalObject()->globalScopeChain(), makeSource(scriptString), JSC::JSValue());
    279280        globalData->timeoutChecker.stop();
    280         ComplType type = completion.complType();
    281        
    282         JSValue result;
    283         if (type == Normal) {
    284             result = completion.value();
    285             if (!result)
    286                 result = jsUndefined();
    287         } else
    288             result = jsUndefined();
    289 
    290         convertValueToNPVariant(exec, result, variant);
     281
     282        convertValueToNPVariant(exec, returnValue, variant);
    291283        exec->clearException();
    292284        return true;
  • trunk/Source/WebCore/bridge/jni/jni_jsobject.mm

    r92693 r94811  
    307307{
    308308    LOG(LiveConnect, "JavaJSObject::eval script = %s", JavaString(script).utf8());
    309    
    310     JSValue result;
    311309
    312310    JSLock lock(SilenceAssertionsOnly);
     
    317315
    318316    rootObject->globalObject()->globalData().timeoutChecker.start();
    319     Completion completion = JSC::evaluate(rootObject->globalObject()->globalExec(), rootObject->globalObject()->globalScopeChain(), makeSource(JavaString(script).impl()), JSC::JSValue());
     317    JSValue result = JSC::evaluate(rootObject->globalObject()->globalExec(), rootObject->globalObject()->globalScopeChain(), makeSource(JavaString(script).impl()));
    320318    rootObject->globalObject()->globalData().timeoutChecker.stop();
    321     ComplType type = completion.complType();
    322    
    323     if (type == Normal) {
    324         result = completion.value();
    325         if (!result)
    326             result = jsUndefined();
    327     } else
    328         result = jsUndefined();
    329    
    330     return convertValueToJObject (result);
     319
     320    return convertValueToJObject(result);
    331321}
    332322
  • trunk/Source/WebKit/mac/ChangeLog

    r94644 r94811  
     12011-09-08  Sam Weinig  <sam@webkit.org>
     2
     3        Remove the Completion object from JSC, I have never liked it
     4        https://bugs.webkit.org/show_bug.cgi?id=67755
     5
     6        Reviewed by Gavin Barraclough.
     7
     8        * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
     9        (WebKit::NetscapePluginInstanceProxy::evaluate):
     10
    1112011-09-07  Sheriff Bot  <webkit.review.bot@gmail.com>
    212
  • trunk/Source/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm

    r93732 r94811  
    4242#import "WebUIDelegatePrivate.h"
    4343#import "WebViewInternal.h"
     44#import <JavaScriptCore/Completion.h>
    4445#import <JavaScriptCore/Error.h>
    4546#import <JavaScriptCore/JSLock.h>
     
    876877
    877878    UserGestureIndicator gestureIndicator(allowPopups ? DefinitelyProcessingUserGesture : PossiblyProcessingUserGesture);
    878     Completion completion = JSC::evaluate(exec, globalObject->globalScopeChain(), makeSource(script));
    879 
     879   
     880    JSValue result = JSC::evaluate(exec, globalObject->globalScopeChain(), makeSource(script));
     881   
    880882    globalObject->globalData().timeoutChecker.stop();
    881     ComplType type = completion.complType();
    882 
    883     JSValue result;
    884     if (type == Normal)
    885         result = completion.value();
    886    
    887     if (!result)
    888         result = jsUndefined();
    889883   
    890884    marshalValue(exec, result, resultData, resultLength);
  • trunk/Source/WebKit/qt/Api/qwebelement.cpp

    r94516 r94811  
    3434#include "HTMLElement.h"
    3535#if USE(JSC)
     36#include "Completion.h"
    3637#include "JSGlobalObject.h"
    3738#include "JSHTMLElement.h"
     
    790791    JSC::ScopeChainNode* scopeChain = state->dynamicGlobalObject()->globalScopeChain();
    791792    JSC::UString script(reinterpret_cast_ptr<const UChar*>(scriptSource.data()), scriptSource.length());
    792     JSC::Completion completion = JSC::evaluate(state, scopeChain, JSC::makeSource(script), thisValue);
    793     if ((completion.complType() != JSC::ReturnValue) && (completion.complType() != JSC::Normal))
     793
     794    JSC::JSValue evaluationException;
     795    JSC::JSValue evaluationResult = JSC::evaluate(state, scopeChain, JSC::makeSource(script), thisValue, &evaluationException);
     796    if (evaluationException)
    794797        return QVariant();
    795798
    796     JSC::JSValue result = completion.value();
    797     if (!result)
    798         return QVariant();
    799 
    800799    int distance = 0;
    801     return JSC::Bindings::convertValueToQVariant(state, result, QMetaType::Void, &distance);
     800    return JSC::Bindings::convertValueToQVariant(state, evaluationResult, QMetaType::Void, &distance);
    802801#elif USE(V8)
    803802    notImplemented();
  • trunk/Source/WebKit/qt/ChangeLog

    r94685 r94811  
     12011-09-08  Sam Weinig  <sam@webkit.org>
     2
     3        Remove the Completion object from JSC, I have never liked it
     4        https://bugs.webkit.org/show_bug.cgi?id=67755
     5
     6        Reviewed by Gavin Barraclough.
     7
     8        * Api/qwebelement.cpp:
     9        (QWebElement::evaluateJavaScript):
     10
    1112011-09-05  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
    212
  • trunk/Source/WebKit2/ChangeLog

    r94804 r94811  
     12011-09-08  Sam Weinig  <sam@webkit.org>
     2
     3        Remove the Completion object from JSC, I have never liked it
     4        https://bugs.webkit.org/show_bug.cgi?id=67755
     5
     6        Reviewed by Gavin Barraclough.
     7
     8        * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
     9        (WebKit::NPRuntimeObjectMap::evaluate):
     10
    1112011-09-08  Anders Carlsson  <andersca@apple.com>
    212
  • trunk/Source/WebKit2/Platform/CoreIPC/Connection.cpp

    r93905 r94811  
    466466        // We didn't find a sync reply yet, keep waiting.
    467467#if PLATFORM(WIN)
    468         timedOut = !m_syncMessageState->waitWhileDispatchingSentWin32Messages(absoluteTime, m_client->windowsToReceiveSentMessagesWhileWaitingForSyncReply());
     468        timedOut = !m_syncMessageState->wait\oluteTime, m_client->windowsToReceiveSentMessagesWhileWaitingForSyncReply());
    469469#else
    470470
  • trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp

    r93555 r94811  
    3232#include "PluginView.h"
    3333#include "WebProcess.h"
     34#include <JavaScriptCore/Completion.h>
    3435#include <JavaScriptCore/Error.h>
    3536#include <JavaScriptCore/JSLock.h>
     
    189190
    190191    globalObject->globalData().timeoutChecker.start();
    191     Completion completion = JSC::evaluate(exec, globalObject->globalScopeChain(), makeSource(UString(scriptString.impl())), thisValue);
     192    JSValue resultValue = JSC::evaluate(exec, globalObject->globalScopeChain(), makeSource(UString(scriptString.impl())), thisValue);
    192193    globalObject->globalData().timeoutChecker.stop();
    193194
    194     ComplType completionType = completion.complType();
    195 
    196     JSValue resultValue;
    197     if (completionType == Normal) {
    198         resultValue = completion.value();
    199         if (!resultValue)
    200             resultValue = jsUndefined();
    201     } else
    202         resultValue = jsUndefined();
    203 
    204     exec->clearException();
    205    
    206195    convertJSValueToNPVariant(exec, resultValue, *result);
    207196    return true;
Note: See TracChangeset for help on using the changeset viewer.