Commit 80b420ae authored by ggaren's avatar ggaren
Browse files

Reviewed by John, mocked by Darin.

        
        - Changed JSEvaluate to take a JSObjectRef instead of a JSValueRef as
        "this," since "this" must be an object.

        * API/JSContextRef.cpp:
        (JSEvaluate):
        * API/JSContextRef.h:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@15212 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent ab28d0b7
......@@ -71,15 +71,15 @@ JSObjectRef JSContextGetGlobalObject(JSContextRef context)
return toRef(exec->dynamicInterpreter()->globalObject());
}
JSValueRef JSEvaluate(JSContextRef context, JSStringBufferRef script, JSValueRef thisValue, JSStringBufferRef sourceURL, int startingLineNumber, JSValueRef* exception)
JSValueRef JSEvaluate(JSContextRef context, JSStringBufferRef script, JSObjectRef thisObject, JSStringBufferRef sourceURL, int startingLineNumber, JSValueRef* exception)
{
JSLock lock;
ExecState* exec = toJS(context);
JSValue* jsThisValue = toJS(thisValue);
JSObject* jsThisObject = toJS(thisObject);
UString::Rep* scriptRep = toJS(script);
UString::Rep* sourceURLRep = toJS(sourceURL);
// Interpreter::evaluate sets thisValue to the global object if it is NULL
Completion completion = exec->dynamicInterpreter()->evaluate(UString(sourceURLRep), startingLineNumber, UString(scriptRep), jsThisValue);
// Interpreter::evaluate sets "this" to the global object if it is NULL
Completion completion = exec->dynamicInterpreter()->evaluate(UString(sourceURLRep), startingLineNumber, UString(scriptRep), jsThisObject);
if (completion.complType() == Throw) {
if (exception)
......
......@@ -49,13 +49,13 @@ void JSContextClearException(JSContextRef context);
Evaluates a string of JavaScript
@param context execution context to use
@param script a character buffer containing the JavaScript to evaluate
@param thisValue object to use as "this," or NULL to use the global object as "this"
@param thisObject the object to use as "this," or NULL to use the global object as "this."
@param sourceURL URL to the file containing the JavaScript, or NULL - this is only used for error reporting
@param startingLineNumber the JavaScript's starting line number in the file located at sourceURL - this is only used for error reporting
@param exception pointer to a JSValueRef in which to store an uncaught exception, if any; can be NULL
@result result of evaluation, or NULL if an uncaught exception was thrown
*/
JSValueRef JSEvaluate(JSContextRef context, JSStringBufferRef script, JSValueRef thisValue, JSStringBufferRef sourceURL, int startingLineNumber, JSValueRef* exception);
JSValueRef JSEvaluate(JSContextRef context, JSStringBufferRef script, JSObjectRef thisObject, JSStringBufferRef sourceURL, int startingLineNumber, JSValueRef* exception);
/*!
@function JSCheckSyntax
......
2006-07-07 Geoffrey Garen <ggaren@apple.com>
Reviewed by John, mocked by Darin.
- Changed JSEvaluate to take a JSObjectRef instead of a JSValueRef as
"this," since "this" must be an object.
* API/JSContextRef.cpp:
(JSEvaluate):
* API/JSContextRef.h:
2006-07-07 Geoffrey Garen <ggaren@apple.com>
 
Reviewed by John.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment