Changeset 63763 in webkit
- Timestamp:
- Jul 20, 2010 12:23:58 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 5 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r63758 r63763 1 2010-07-20 Joseph Pecoraro <joepeck@webkit.org> 2 3 Reviewed by Geoffrey Garen. 4 5 WebScriptObject Should Allow Safely Checking For Key Existence 6 https://bugs.webkit.org/show_bug.cgi?id=42613 7 8 * platform/mac/fast/objc/script-tests/TEMPLATE.html: Added. 9 * platform/mac/fast/objc/script-tests/webScriptObject-hasWebScriptKey.js: Added. 10 * platform/mac/fast/objc/webScriptObject-hasWebScriptKey-expected.txt: Added. 11 * platform/mac/fast/objc/webScriptObject-hasWebScriptKey.html: Added. 12 1 13 2010-07-20 Stephen White <senorblanco@chromium.org> 2 14 -
trunk/WebCore/ChangeLog
r63762 r63763 1 2010-07-20 Joseph Pecoraro <joepeck@webkit.org> 2 3 Reviewed by Geoffrey Garen. 4 5 WebScriptObject Should Allow Safely Checking For Key Existence 6 https://bugs.webkit.org/show_bug.cgi?id=42613 7 8 Test: platform/mac/fast/objc/webScriptObject-hasWebScriptKey.html 9 10 Add private API "hasWebScriptKey" to check for key existence in 11 a WebScriptObject. Like JavaScript's `in` syntax. This is intended 12 to be made public eventually. 13 14 * bindings/objc/WebScriptObject.mm: 15 (-[WebScriptObject hasWebScriptKey:]): 16 * bindings/objc/WebScriptObjectPrivate.h: 17 1 18 2010-07-20 Adam Barth <abarth@webkit.org> 2 19 -
trunk/WebCore/bindings/objc/WebScriptObject.mm
r60631 r63763 434 434 } 435 435 436 - (BOOL)hasWebScriptKey:(NSString *)key 437 { 438 if (![self _isSafeScript]) 439 return NO; 440 441 ExecState* exec = [self _rootObject]->globalObject()->globalExec(); 442 ASSERT(!exec->hadException()); 443 444 JSLock lock(SilenceAssertionsOnly); 445 BOOL result = [self _imp]->hasProperty(exec, Identifier(exec, stringToUString(String(key)))); 446 447 if (exec->hadException()) { 448 addExceptionToConsole(exec); 449 exec->clearException(); 450 } 451 452 _didExecute(self); 453 454 return result; 455 } 456 436 457 - (NSString *)stringRepresentation 437 458 { -
trunk/WebCore/bindings/objc/WebScriptObjectPrivate.h
r43122 r63763 60 60 @end 61 61 62 @interface WebScriptObject (StagedForPublic) 63 /*! 64 @method hasWebScriptKey: 65 @param name The name of the property to check for. 66 @discussion Checks for the existence of the property on the object in the script environment. 67 @result Returns YES if the property exists, NO otherwise. 68 */ 69 - (BOOL)hasWebScriptKey:(NSString *)name; 70 @end 71 62 72 @interface WebScriptObjectPrivate : NSObject 63 73 { -
trunk/WebKitTools/ChangeLog
r63754 r63763 1 2010-07-20 Joseph Pecoraro <joepeck@webkit.org> 2 3 Reviewed by Geoffrey Garen. 4 5 WebScriptObject Should Allow Safely Checking For Key Existence 6 https://bugs.webkit.org/show_bug.cgi?id=42613 7 8 Normal ObjCController workflow for a WebScriptObject test. 9 10 * DumpRenderTree/mac/ObjCController.m: 11 (+[ObjCController isSelectorExcludedFromWebScript:]): 12 (+[ObjCController webScriptNameForSelector:]): 13 (-[ObjCController testHasWebScriptKey:]): 14 1 15 2010-07-20 Chris Marrin <cmarrin@apple.com> 2 16 -
trunk/WebKitTools/DumpRenderTree/mac/ObjCController.m
r53151 r63763 37 37 #import <wtf/Assertions.h> 38 38 39 // Remove this once hasWebScriptKey has been made public. 40 @interface WebScriptObject (StagedForPublic) 41 - (BOOL)hasWebScriptKey:(NSString *)name; 42 @end 43 39 44 static void* runJavaScriptThread(void* arg) 40 45 { … … 67 72 || aSelector == @selector(storeWebScriptObject:) 68 73 || aSelector == @selector(testValueForKey) 74 || aSelector == @selector(testHasWebScriptKey:) 69 75 || aSelector == @selector(testArray) 70 76 ) … … 93 99 if (aSelector == @selector(testValueForKey)) 94 100 return @"testValueForKey"; 101 if (aSelector == @selector(testHasWebScriptKey:)) 102 return @"testHasWebScriptKey"; 95 103 if (aSelector == @selector(testArray)) 96 104 return @"testArray"; … … 167 175 } 168 176 177 - (BOOL)testHasWebScriptKey:(NSString *)key 178 { 179 ASSERT(storedWebScriptObject); 180 return [storedWebScriptObject hasWebScriptKey:key]; 181 } 182 169 183 - (BOOL)testWrapperRoundTripping:(WebScriptObject *)webScriptObject 170 184 {
Note: See TracChangeset
for help on using the changeset viewer.