Changeset 150831 in webkit
- Timestamp:
- May 28, 2013 2:18:44 PM (11 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/API/JSValue.mm
r150199 r150831 972 972 _context = [context retain]; 973 973 m_value = value; 974 JSValueProtect([_context JSGlobalContextRef], m_value); 974 975 return self; 975 976 } … … 1089 1090 - (void)dealloc 1090 1091 { 1092 JSValueUnprotect([_context JSGlobalContextRef], m_value); 1091 1093 [_context release]; 1092 1094 _context = nil; -
trunk/Source/JavaScriptCore/API/tests/testapi.mm
r149401 r150831 803 803 [TinyDOMNode clearSharedVirtualMachine]; 804 804 } 805 806 @autoreleasepool { 807 JSContext *context = [[JSContext alloc] init]; 808 JSValue *o = [JSValue valueWithNewObjectInContext:context]; 809 o[@"foo"] = @"foo"; 810 JSSynchronousGarbageCollectForDebugging([context JSGlobalContextRef]); 811 812 checkResult(@"JSValue correctly protected its internal value", [[o[@"foo"] toString] isEqualToString:@"foo"]); 813 } 805 814 } 806 815 -
trunk/Source/JavaScriptCore/ChangeLog
r150767 r150831 1 2013-05-28 Mark Hahnenberg <mhahnenberg@apple.com> 2 3 r150199 is very wrong 4 https://bugs.webkit.org/show_bug.cgi?id=116876 5 6 JSValue needs to protect its internal JSValueRef. 7 8 Reviewed by Darin Adler. 9 10 * API/JSValue.mm: 11 (-[JSValue initWithValue:inContext:]): 12 (-[JSValue dealloc]): 13 * API/tests/testapi.mm: Added a simple test to make sure that we protect the 14 underlying JavaScript value across garbage collections. 15 1 16 2013-05-27 Patrick Gansterer <paroga@webkit.org> 2 17
Note: See TracChangeset
for help on using the changeset viewer.