Changeset 94811 in webkit for trunk/Source/JavaScriptCore/API
- Timestamp:
- Sep 8, 2011, 3:38:44 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/API/JSBase.cpp
r91401 r94811 30 30 #include "APICast.h" 31 31 #include "APIShims.h" 32 #include "Completion.h"33 32 #include "OpaqueJSString.h" 34 33 #include "SourceCode.h" … … 53 52 JSGlobalObject* globalObject = exec->dynamicGlobalObject(); 54 53 SourceCode source = makeSource(script->ustring(), sourceURL->ustring(), startingLineNumber); 55 Completion completion = evaluate(globalObject->globalExec(), globalObject->globalScopeChain(), source, jsThisObject);56 54 57 if (completion.complType() == Throw) { 55 JSValue evaluationException; 56 JSValue returnValue = evaluate(globalObject->globalExec(), globalObject->globalScopeChain(), source, jsThisObject, &evaluationException); 57 58 if (evaluationException) { 58 59 if (exception) 59 *exception = toRef(exec, completion.value());60 *exception = toRef(exec, evaluationException); 60 61 return 0; 61 62 } 62 63 63 if ( completion.value())64 return toRef(exec, completion.value());65 64 if (returnValue) 65 return toRef(exec, returnValue); 66 66 67 // happens, for example, when the only statement is an empty (';') statement 67 68 return toRef(exec, jsUndefined()); … … 74 75 75 76 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) { 78 82 if (exception) 79 *exception = toRef(exec, completion.value());83 *exception = toRef(exec, syntaxException); 80 84 return false; 81 85 } 82 86 83 87 return true; 84 88 }
Note:
See TracChangeset
for help on using the changeset viewer.