Commit 5fa163a4 authored by bdash's avatar bdash

2007-01-18 Mark Rowe <mrowe@apple.com>

        Reviewed by Tim H.

        Fix for http://bugs.webkit.org/show_bug.cgi?id=7926
        Bug 7926: Crash using -callWebScriptMethod to access offsetTop property

        * bindings/objc/WebScriptObject.mm:
        (-[WebScriptObject callWebScriptMethod:withArguments:]): Bail out early if function value is an immediate,
        or if the function object is not callable.


git-svn-id: svn://svn.chromium.org/blink/trunk@18973 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent e6b43e3b
2007-01-18 Mark Rowe <mrowe@apple.com>
Reviewed by Tim H.
Fix for http://bugs.webkit.org/show_bug.cgi?id=7926
Bug 7926: Crash using -callWebScriptMethod to access offsetTop property
* bindings/objc/WebScriptObject.mm:
(-[WebScriptObject callWebScriptMethod:withArguments:]): Bail out early if function value is an immediate,
or if the function object is not callable.
2007-01-18 Sam Weinig <sam@webkit.org> 2007-01-18 Sam Weinig <sam@webkit.org>
Reviewed by Maciej. Reviewed by Maciej.
......
...@@ -181,13 +181,15 @@ static List listFromNSArray(ExecState *exec, NSArray *array) ...@@ -181,13 +181,15 @@ static List listFromNSArray(ExecState *exec, NSArray *array)
Identifier identifier(v->toString(exec)); Identifier identifier(v->toString(exec));
JSValue *func = [self _imp]->get(exec, identifier); JSValue *func = [self _imp]->get(exec, identifier);
if (!func || func->isUndefined()) { if (!func || !func->isObject())
// Maybe throw an exception here? // Maybe throw an exception here?
return 0; return 0;
}
// Call the function object. // Call the function object.
JSObject *funcImp = static_cast<JSObject*>(func); JSObject *funcImp = static_cast<JSObject*>(func);
if (!funcImp->implementsCall())
return 0;
JSObject *thisObj = const_cast<JSObject*>([self _imp]); JSObject *thisObj = const_cast<JSObject*>([self _imp]);
List argList = listFromNSArray(exec, args); List argList = listFromNSArray(exec, args);
JSValue *result = funcImp->call(exec, thisObj, argList); JSValue *result = funcImp->call(exec, thisObj, argList);
......
Markdown is supported
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