diff options
author | Ben Murdoch <benm@google.com> | 2010-07-22 15:37:06 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2010-07-27 10:20:25 +0100 |
commit | 967717af5423377c967781471ee106e2bb4e11c8 (patch) | |
tree | 1e701dc0a12f7f07cce1df4a7681717de77a211b /WebCore/bindings/objc | |
parent | dcc30a9fca45f634b1d3a12b276d3a0ccce99fc3 (diff) | |
download | external_webkit-967717af5423377c967781471ee106e2bb4e11c8.zip external_webkit-967717af5423377c967781471ee106e2bb4e11c8.tar.gz external_webkit-967717af5423377c967781471ee106e2bb4e11c8.tar.bz2 |
Merge WebKit at r63859 : Initial merge by git.
Change-Id: Ie8096c63ec7c991c9a9cba8bdd9c3b74a3b8ed62
Diffstat (limited to 'WebCore/bindings/objc')
-rw-r--r-- | WebCore/bindings/objc/WebScriptObject.mm | 21 | ||||
-rw-r--r-- | WebCore/bindings/objc/WebScriptObjectPrivate.h | 10 |
2 files changed, 31 insertions, 0 deletions
diff --git a/WebCore/bindings/objc/WebScriptObject.mm b/WebCore/bindings/objc/WebScriptObject.mm index 3f224f1..37874ac 100644 --- a/WebCore/bindings/objc/WebScriptObject.mm +++ b/WebCore/bindings/objc/WebScriptObject.mm @@ -433,6 +433,27 @@ static void getListFromNSArray(ExecState *exec, NSArray *array, RootObject* root _didExecute(self); } +- (BOOL)hasWebScriptKey:(NSString *)key +{ + if (![self _isSafeScript]) + return NO; + + ExecState* exec = [self _rootObject]->globalObject()->globalExec(); + ASSERT(!exec->hadException()); + + JSLock lock(SilenceAssertionsOnly); + BOOL result = [self _imp]->hasProperty(exec, Identifier(exec, stringToUString(String(key)))); + + if (exec->hadException()) { + addExceptionToConsole(exec); + exec->clearException(); + } + + _didExecute(self); + + return result; +} + - (NSString *)stringRepresentation { if (![self _isSafeScript]) { diff --git a/WebCore/bindings/objc/WebScriptObjectPrivate.h b/WebCore/bindings/objc/WebScriptObjectPrivate.h index 3a424ce..5da1dde 100644 --- a/WebCore/bindings/objc/WebScriptObjectPrivate.h +++ b/WebCore/bindings/objc/WebScriptObjectPrivate.h @@ -59,6 +59,16 @@ namespace WebCore { - (JSC::Bindings::RootObject*)_originRootObject; @end +@interface WebScriptObject (StagedForPublic) +/*! + @method hasWebScriptKey: + @param name The name of the property to check for. + @discussion Checks for the existence of the property on the object in the script environment. + @result Returns YES if the property exists, NO otherwise. + */ +- (BOOL)hasWebScriptKey:(NSString *)name; +@end + @interface WebScriptObjectPrivate : NSObject { @public |