3 2006-07-21 Geoffrey Garen <ggaren@apple.com>
7 <rdar://problem/4507265> REGRESSION: overlays don't work on HousingMaps.com (Google Maps-based site)
9 - Added support for strings that masquerade as undefined. Currently used
10 by WebCore to implement undetectable style.filter.
12 The name is a little long, but it's only used in one line of code, so I
13 thought clarity should win over brevity.
16 * JavaScriptCore.xcodeproj/project.pbxproj:
18 * kjs/string_object.h:
19 (KJS::StringInstanceThatMasqueradesAsUndefined::StringInstanceThatMasqueradesAsUndefined):
20 (KJS::StringInstanceThatMasqueradesAsUndefined::masqueradeAsUndefined):
21 (KJS::StringInstanceThatMasqueradesAsUndefined::toBoolean):
25 2006-07-20 Steve Falkenburg <sfalken@apple.com>
30 (KJS::escapeStringForPrettyPrinting):
32 2006-07-19 Anders Carlsson <acarlsson@apple.com>
36 <rdar://problem/4620655> REGRESSION(10.4.7-10.5): preview button for a blogger.com post doesn't work
38 * kjs/nodes2string.cpp:
39 (StringNode::streamTo):
40 Return the escaped string.
42 (RegExpNode::streamTo):
43 Use the correct syntax.
46 (KJS::escapeStringForPrettyPrinting):
48 Add escape function which escapes a string for pretty-printing so it can be parsed again.
50 * wtf/unicode/icu/UnicodeIcu.h:
51 (WTF::Unicode::isPrintableChar):
54 2006-07-18 Maciej Stachowiak <mjs@apple.com>
56 Reviewed by Adele Peterson.
58 <rdar://problem/4589530> REGRESSION: null character in JS string causes parse error (works in Tiger and in other browsers)
67 2006-07-18 Tim Omernick <timo@apple.com>
69 Reviewed by Tim Hatcher.
71 Removed a misleading comment; we recently added support for the NPNVPluginElementNPObject
78 2006-07-18 Timothy Hatcher <timothy@apple.com>
80 Made the following headers public:
89 * JavaScriptCore.xcodeproj/project.pbxproj:
91 2006-07-17 Geoffrey Garen <ggaren@apple.com>
95 - Added automatic prototype creation for classes.
97 A class stores a weak reference to a prototype, which is cleared when
98 the prototype is garbage collected, to avoid a reference cycle.
100 We now have an attributes field in JSClassDefinition, that currently is
101 used only to override automatic prototype creation when you want to manage your
102 own prototypes, but can be extended in the future for other nefarious purposes.
104 Similarly, we have JSObjectMake and JSObjectMakeWithPrototype, the latter
105 allowing you to manage your own prototypes.
107 JSObjectMakeConstructor is more interesting now, able to make a constructor
108 on your behalf if you just give it a class.
110 - Removed bogus old code from minidom.js.
112 - Tweaked the headerdocs.
114 - Added more GC testing, which caught some leaks, and tested more funny
115 edge cases in lookup, which caught a lookup bug. Removed some testing
116 we used to do with MyObject because it was redundant with the new, cool
119 While fixing the lookup bug I retracted this change:
121 "If a static setProperty callback returns 'false', to indicate that the
122 property was not set, we no longer forward the set request up the class
123 chain, because that's almost certainly not what the programmer expected."
125 Returning false when setting a static property is a little silly, but you can see
126 it being useful when shadowing a base class's static properties, and, regardless
127 of usefullness, this is the defined behavior of the setProperty callback.
129 - Plus a little ASCII art, for the kids.
131 2006-07-17 Timothy Hatcher <timothy@apple.com>
135 <rdar://problem/4634874> WebScriptObject and WebUndefined are no longer defined by WebKit
137 Moves WebScriptObject and WebUndefined up to WebCore.
138 This change does create an upwards-dependancy on WebScriptObject existing
139 in the loaded process, but this code path in JavaScriptCore does not get used
140 unless it is through WebKit/WebCore. Moving all of the binding code out of
141 JavaScriptCore might make sense in the future.
143 * JavaScriptCore.exp:
144 * JavaScriptCore.xcodeproj/project.pbxproj:
145 * bindings/objc/WebScriptObject.h: Replaced.
146 * bindings/objc/WebScriptObject.mm: Removed.
147 * bindings/objc/WebScriptObjectPrivate.h: Removed.
148 * bindings/objc/objc_class.h:
149 * bindings/objc/objc_instance.h:
150 * bindings/objc/objc_instance.mm:
151 (ObjcInstance::~ObjcInstance):
152 * bindings/objc/objc_runtime.h:
153 * bindings/objc/objc_runtime.mm:
154 (convertValueToObjcObject):
155 * bindings/objc/objc_utility.mm:
156 (KJS::Bindings::convertValueToObjcValue):
157 (KJS::Bindings::convertObjcValueToValue):
158 (KJS::Bindings::createObjcInstanceForValue):
160 2006-07-17 Darin Adler <darin@apple.com>
162 * API/JSBase.h: Fix comment formatting where things used to be lined up but
163 are now ragged. Got rid of spaces that attempted to line things up.
164 * API/JSObjectRef.h: Ditto. Also add missing periods for a couple of comments.
166 2006-07-17 Geoffrey Garen <ggaren@apple.com>
170 - Removed the exception parameter from the initialize callback and, by extension,
171 JSObjectMake. We have never had a need for exceptions when iniitializing,
172 so the parameter seemed likely to "get in the way."
174 Also, an exception in JavaScript is thrown in response to input --
175 "invalid URL", "index not a number", etc., so it's the job of the
176 constructor function, not the initialize method, to throw.
178 If initialize *really* wants to throw, it can communicate the throw to
179 the constructor through the constructed object's private data (e.g., set
180 it to NULL, signaling to the consntructor that initialization failed.)
182 - Added JSObjectMakeWithData, which enables a constructor to set private
183 data on an object *before* it has been initialized. That way, the initialize
184 methods can properly operate on the data.
186 * API/JSNode.c: Moved ref into the initialize method, for better encapsulation,
187 now that it's possible.
188 * API/JSNodeList.c: ditto
190 (main): Do more aggressive garbage collection to test ref/deref and
192 * API/minidom.js: store childNodes in a temporary so it doesn't get re-created
193 like a thousand times. This makes debugging ref/deref easier
195 2006-07-17 Geoffrey Garen <ggaren@apple.com>
199 - Changed the initialize callback to run from least derived class (parent
200 class) to most derived class. This enables C++ style initialization,
201 and derived class overriding of member data.
203 - Added excpetion propopgation to JSObjectMake, to support initialize
204 exceptions, and generally round out our policy of making function
205 signatures as long as possible.
207 * API/JSCallbackObject.h: Use ExecState instead of ContextRef, cuz we're
210 2006-07-17 Geoffrey Garen <ggaren@apple.com>
214 - Changed JSObjectMakeConstructor to JSObjectMakeConstructorWithCallback,
215 to match JSObjectMakeFunctionWithCallback.
217 - Added prototype parameter, so the generated constructor
218 automatically works with hasInstance / instanceof
220 - Moved hasInstance implementation from InternalFunctionImp to JSObject
221 so that subclasses can inherit it without inheriting function-related baggage.
222 More refactoring here would be good, but this seems like a good short-term
225 (KJS::JSCallbackFunction::implementsHasInstance): override and return false,
226 because callback functions aren't constructors.
228 2006-07-17 Maciej Stachowiak <mjs@apple.com>
232 - add a JSContextRef parameter to all JSValueRef, JSObjectRef, and JSContextRef operations;
233 except JSObject{Get,Set}PrivateData which can be assumed to be simple pure accessors.
235 Also renamed the parameter "context" to "ctx" because it makes the code read better with this pervasive
236 but usually uninteresting parameter.
240 (JSCheckScriptSyntax):
243 * API/JSCallbackObject.cpp:
244 (KJS::JSCallbackObject::JSCallbackObject):
245 (KJS::JSCallbackObject::init):
246 (KJS::JSCallbackObject::getOwnPropertySlot):
247 (KJS::JSCallbackObject::put):
248 (KJS::JSCallbackObject::deleteProperty):
249 (KJS::JSCallbackObject::toNumber):
250 (KJS::JSCallbackObject::toString):
251 * API/JSContextRef.cpp:
252 (JSGlobalContextCreate):
253 (JSGlobalContextRetain):
254 (JSGlobalContextRelease):
255 (JSContextGetGlobalObject):
256 * API/JSContextRef.h:
258 (JSNodePrototype_appendChild):
259 (JSNodePrototype_removeChild):
260 (JSNodePrototype_replaceChild):
261 (JSNode_getNodeType):
262 (JSNode_getFirstChild):
265 (JSNodeListPrototype_item):
267 (JSNodeList_getProperty):
268 (JSNodeList_prototype):
269 * API/JSObjectRef.cpp:
271 (JSObjectMakeFunctionWithCallback):
272 (JSObjectMakeConstructor):
273 (JSObjectMakeFunction):
274 (JSObjectGetPrototype):
275 (JSObjectSetPrototype):
276 (JSObjectHasProperty):
277 (JSObjectGetProperty):
278 (JSObjectSetProperty):
279 (JSObjectGetPropertyAtIndex):
280 (JSObjectSetPropertyAtIndex):
281 (JSObjectDeleteProperty):
282 (JSObjectIsFunction):
283 (JSObjectCallAsFunction):
284 (JSObjectIsConstructor):
285 (JSObjectCallAsConstructor):
286 (JSObjectCopyPropertyNames):
288 * API/JSStringRef.cpp:
289 * API/JSValueRef.cpp:
291 (JSValueIsUndefined):
297 (JSValueIsObjectOfClass):
299 (JSValueIsStrictEqual):
300 (JSValueIsInstanceOfConstructor):
301 (JSValueMakeUndefined):
303 (JSValueMakeBoolean):
308 (JSValueToStringCopy):
316 (MyObject_getProperty):
317 (MyObject_deleteProperty):
318 (MyObject_callAsFunction):
319 (MyObject_callAsConstructor):
320 (MyObject_convertToType):
321 (print_callAsFunction):
324 2006-07-16 Geoffrey Garen <ggaren@apple.com>
326 Approved by Maciej, RS by Beth.
328 JSObjectMakeFunction -> JSObjectMakeFunctionWithCallback
329 JSObjectMakeFunctionWithBody -> JSObjectMakeFunction
331 because the latter is more common, and more fundamental, than the former.
336 * API/JSCallbackObject.cpp:
337 (KJS::JSCallbackObject::getOwnPropertySlot):
338 (KJS::JSCallbackObject::put):
339 (KJS::JSCallbackObject::deleteProperty):
340 (KJS::JSCallbackObject::getPropertyNames):
341 (KJS::JSCallbackObject::staticValueGetter):
342 (KJS::JSCallbackObject::staticFunctionGetter):
343 * API/JSClassRef.cpp:
344 (OpaqueJSClass::OpaqueJSClass):
345 (OpaqueJSClass::~OpaqueJSClass):
347 * API/JSObjectRef.cpp:
349 (JSObjectMakeFunctionWithCallback):
350 (JSObjectMakeFunction):
351 (OpaqueJSPropertyNameArray::OpaqueJSPropertyNameArray):
352 (JSObjectCopyPropertyNames):
359 * JavaScriptCore.exp:
361 2006-07-16 Geoffrey Garen <ggaren@apple.com>
365 Replace __JS with OpaqueJS because the former, while used by CF, is
366 a prefix that's triply-reserved by the compiler. (_* is reserved in global
367 names, _[A-Z] is reserved in all names, and __ is reserved in all names
370 Opaque is an alternative used by other Mac OS X framewokrs.
375 * API/JSCallbackObject.cpp:
376 (KJS::JSCallbackObject::getOwnPropertySlot):
377 (KJS::JSCallbackObject::put):
378 (KJS::JSCallbackObject::deleteProperty):
379 (KJS::JSCallbackObject::getPropertyNames):
380 (KJS::JSCallbackObject::staticValueGetter):
381 (KJS::JSCallbackObject::staticFunctionGetter):
382 * API/JSClassRef.cpp:
383 (OpaqueJSClass::OpaqueJSClass):
384 (OpaqueJSClass::~OpaqueJSClass):
386 * API/JSObjectRef.cpp:
388 (OpaqueJSPropertyNameArray::OpaqueJSPropertyNameArray):
389 (JSObjectCopyPropertyNames):
391 2006-07-16 Darin Adler <darin@apple.com>
393 - try to fix Windows build
395 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
396 Added some recently added files, removed some recently removed.
398 2006-07-16 Geoffrey Garen <ggaren@apple.com>
402 - Change getProperty* to return undefined, rather than NULL, for missing
403 properties, since that's what the spec says. Also added exception out
404 parameters to the *Index functions, because they can call through to the
405 regular functions, which can throw for custom objects.
407 * API/JSObjectRef.cpp:
408 (JSObjectGetProperty):
409 (JSObjectGetPropertyAtIndex):
410 (JSObjectSetPropertyAtIndex):
415 2006-07-16 Geoffrey Garen <ggaren@apple.com>
419 - Properly document and handle NULL callbacks for static properties. We
420 throw an exception in any case other than a ReadOnly property with a NULL
421 setProperty callback, because a NULL callback almost certainly indicates
422 a programming error. Also throw an exception if hasProperty returns true
423 for a property that getProperty can't get.
425 - If a static setProperty callback returns 'false', to indicate that the
426 property was not set, we no longer forward the set request up the class
427 chain, because that's almost certainly not what the programmer expected.
429 * API/JSCallbackObject.cpp:
430 (KJS::JSCallbackObject::getOwnPropertySlot):
431 (KJS::JSCallbackObject::put):
432 (KJS::JSCallbackObject::staticValueGetter):
433 (KJS::JSCallbackObject::staticFunctionGetter):
434 (KJS::JSCallbackObject::callbackGetter):
438 (MyObject_hasProperty):
441 2006-07-16 Geoffrey Garen <ggaren@apple.com>
445 - Added names to functions.
447 - Removed GetPrivate/SetPrivate from callbackFunctions and callbackConstructors.
448 The private data idiom is that a JS object stores its native implementation
449 as private data. For functions and constructors, the native implementation is nothing
450 more than the callback they already store, so supporting private data, too,
451 confuses the idiom. If you *really* want, you can still create a custom
452 function with private data.
454 * API/JSCallbackConstructor.cpp:
455 * API/JSCallbackConstructor.h:
456 * API/JSCallbackFunction.cpp:
457 (KJS::JSCallbackFunction::JSCallbackFunction):
458 * API/JSCallbackFunction.h:
459 * API/JSCallbackObject.cpp:
460 (KJS::JSCallbackObject::staticFunctionGetter):
461 * API/JSObjectRef.cpp:
462 (JSObjectMakeFunction):
463 (JSObjectMakeFunctionWithBody):
464 (JSObjectGetPrivate):
465 (JSObjectSetPrivate):
472 2006-07-15 Maciej Stachowiak <mjs@apple.com>
476 - switch property lists to be vector+set of Identifiers instead of list of References
478 This has the following benefits:
480 - no duplicates in property lists
481 - simplifies API calls
482 - probably more efficient, since linked list is gone
483 - entirely removed Reference, ReferenceList and ProtectedReference types from the API
485 * kjs/PropertyNameArray.cpp: Added.
486 (KJS::PropertyNameArray::add): Check set, if not already there, add to
488 * kjs/PropertyNameArray.h: Added.
489 (KJS::PropertyNameArray::PropertyNameArray): Newly added type, combines
490 a set and a vector to make a unique but ordered list of identifiers.
491 (KJS::PropertyNameArray::begin): ditto
492 (KJS::PropertyNameArray::end): ditto
493 (KJS::PropertyNameArray::size): ditto
494 (KJS::PropertyNameArray::operator[]): ditto
495 * kjs/array_instance.h:
496 * kjs/array_object.cpp:
497 (ArrayInstance::getPropertyNames): renamed from getPropertyList, updated
498 for PropertyNameArray
499 (ArrayInstance::setLength): updated for PropertyNameArray
500 (ArrayInstance::pushUndefinedObjectsToEnd): ditto
502 (ForInNode::execute): updated for PropertyNameArray
505 (KJS::JSObject::getPropertyNames): renamed from getPropertyList, updated
506 for PropertyNameArray
508 * kjs/property_map.cpp:
509 (KJS::PropertyMap::getEnumerablePropertyNames): updated for PropertyNameArray
510 (KJS::PropertyMap::getSparseArrayPropertyNames): ditto
511 * kjs/property_map.h:
512 * kjs/protected_reference.h: Removed.
513 * kjs/reference.cpp: Removed.
514 * kjs/reference.h: Removed.
515 * kjs/reference_list.cpp: Removed.
516 * kjs/reference_list.h: Removed.
517 * kjs/scope_chain.cpp:
518 (KJS::ScopeChain::print): Use PropertyNamesArray instead of ReferenceList.
519 * kjs/string_object.cpp:
520 (StringInstance::getPropertyNames): Updated for new approach.
521 * kjs/string_object.h:
524 (toJS): Added overload for PropertyNameAccumulatorRef / PropertyNameArray*
527 * API/JSCallbackObject.cpp:
528 (KJS::JSCallbackObject::getPropertyNames): Fixed for new API.
529 * API/JSCallbackObject.h:
530 * API/JSObjectRef.cpp:
531 (__JSPropertyNameArray::__JSPropertyNameArray): Type used for a publicly vended
532 JSPropertyNameArrayRef.
533 (JSObjectCopyPropertyNames): New API call - renamed / refactored from
534 JSObjectCreatePropertyList
535 (JSPropertyNameArrayRetain): new retain call for JSPropertyNameArray.
536 (JSPropertyNameArrayRelease): new release call for - " -.
537 (JSPropertyNameArrayGetCount): Instead of having to use a stateful enumerator you
538 can now get the count and items in any order.
539 (JSPropertyNameArrayGetNameAtIndex): See above.
540 (JSPropertyNameAccumulatorAddName): What you add properties to is now an opaque
542 * API/JSObjectRef.h: Prototyped new functions, removed old ones
543 * JavaScriptCore.exp: Updated exported symbols.
544 * JavaScriptCore.xcodeproj/project.pbxproj: Added new files, removed old.
546 (MyObject_getPropertyNames): Renamed / fixed callback to fit new paradigm.
547 (main): Updated for new API.
549 2006-07-15 Darin Adler <darin@apple.com>
551 - oops, missed a few more arrays that had to be const
554 (JSNodePrototype_appendChild): Added const.
555 (JSNodePrototype_removeChild): Ditto.
556 (JSNodePrototype_replaceChild): Ditto.
557 (JSNode_construct): Ditto.
559 (JSNodeListPrototype_item): Ditto.
560 * API/JSObjectRef.cpp:
561 (JSObjectMakeFunctionWithBody): Ditto.
562 (JSObjectCallAsFunction): Ditto.
563 (JSObjectCallAsConstructor): Ditto.
567 (MyObject_callAsFunction): Ditto.
568 (MyObject_callAsConstructor): Ditto.
569 (print_callAsFunction): Ditto.
570 (myConstructor_callAsConstructor): Ditto.
572 2006-07-15 Darin Adler <darin@apple.com>
576 * API/JSNode.h: Made an array parameter const.
577 * API/JSObjectRef.h: Made array parameters const. Fixed a comment.
579 2006-07-15 Geoffrey Garen <ggaren@apple.com>
583 - JSObjectMakeFunctionWithBody includes a function name and named parameters now.
585 * API/JSObjectRef.cpp:
586 (JSObjectMakeFunctionWithBody):
589 (assertEqualsAsUTF8String): More informative failure reporting.
590 (main): Test more function cases.
592 2006-07-15 Geoffrey Garen <ggaren@apple.com>
596 - Moved the arguments passed to JSClassCreate into a single structure,
597 called JSClassDefinition. This will enable easier structure
598 migration/versioning in the future, if necessary.
600 - Added support for class names.
602 - kJSClassDefinitionNull replaces kJSObjectCallbacksNone.
604 - JSClass is becoming a fairly complex struct, so I migrated all of its
605 implementation other than reference counting to the sruct.
607 - Also moved JSClass* functions in the API to JSObjectRef.cpp, since they're
608 declared in JSObjectRef.h
610 - Also added some more informative explanation to the class structure doc.
612 2006-07-15 Darin Adler <darin@apple.com>
616 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8395
617 <rdar://problem/4613467>
618 REGRESSION: RegEx seems broken for hex escaped non breaking space
620 Test: fast/js/regexp-extended-characters-more.html
623 (match): Got rid of utf16Length local variable to guarantee there's no
624 extra stack usage in recursive calls. Fixed two places in the PCRE_UTF16
625 code that were using the length variable, which is the UTF-8 length of
626 a character in the pattern, to move in the UTF-16 subject string. Instead
627 they hardcode lengths of 1 and 2 since the code already handles BMP
628 characters and surrogate pairs separately. Also fixed some DPRINTF so
629 I could compile with DEBUG on.
630 (pcre_exec): Changed a place that was checking for multibyte characters
631 in the subject string to use ISMIDCHAR. Instead it was using hardcoded
632 logic that was right for UTF-8 but wrong for UTF-16.
634 * pcre/pcre_compile.c: (pcre_compile2): Fixed a DPRINTF so I could compile
637 2006-07-14 Geoffrey Garen <ggaren@apple.com>
641 Global replace in the API of argc/argv with argumentCount/arguments.
643 2006-07-14 Geoffrey Garen <ggaren@apple.com>
647 - Finalized exception handling in the API.
649 setProperty can throw because it throws for built-in arrays. getProperty
650 and deleteProperty can throw because setProperty can throw and we want
651 to be consistent, and also because they seem like "actions." callAsFunction,
652 callAsConstructor, and hasInstance can throw, because they caan throw for
655 toBoolean can't throw because it's defined that way in the spec.
657 - Documented that toBoolean and toObject can't be overridden by custom
658 objects because they're defined that way in the spec.
660 === Safari-521.17 ===
662 2006-07-14 Geoffrey Garen <ggaren@apple.com>
666 - Implemented ref-counting of JSContexts by splitting into two datatypes:
667 JSGlobalContext, which you can create/retain/release, and JSContext, which
670 Internally, you retain a JSGlobalContext/ExecState by retaining its
671 interpreter, which, in the case of a global ExecState, owns it.
673 - Also made ~Interpreter() protected to catch places where Interpreter
674 is manually deleted. (Can't make it private because some crazy fool
675 decided it would be a good idea to subclass Interpreter in other frameworks.
679 (toJS): Added cast for new JSGlobalContext
680 * API/JSStringRef.h: Changed vague "you must" language to more specific
681 (but, ultimately, equally vague) "behavior is undefined if you don't"
683 (KJS::Interpreter::Interpreter): Factored more common initialization into
686 (KJS::Interpreter::ref): new
687 (KJS::Interpreter::deref): new
688 (KJS::Interpreter::refCount): new
690 (doIt): Ref-count the interpreter.
692 2006-07-14 Maciej Stachowiak <mjs@apple.com>
696 - removed bool return value from JSObjectSetProperty, since it is inefficient and
697 also doesn't work quite right
698 - added JSObjectGetPropertyAtIndex and JSObjectSetPropertyAtIndex
700 * API/JSObjectRef.cpp:
701 (JSObjectSetProperty): Removed return value and canPut stuff.
702 (JSObjectGetPropertyAtIndex): Added.
703 (JSObjectSetPropertyAtIndex): Added.
704 * API/JSObjectRef.h: Prototyped and documented new functions.
706 2006-07-14 Geoffrey Garen <ggaren@apple.com>
710 Moved JSCheckScriptSyntax, JSEvaluateScript, and JSGarbageCollect into
711 JSBase.h/.cpp. They don't belong in the value-specific or context-specific
712 files because they're not part of the value or context implementations.
715 * API/JSContextRef.cpp:
716 (JSContextGetGlobalObject):
717 * API/JSContextRef.h:
718 * API/JSValueRef.cpp:
721 * JavaScriptCore.xcodeproj/project.pbxproj:
723 2006-07-13 Timothy Hatcher <timothy@apple.com>
727 Moved JavaScriptCore to be a public framework.
729 * JavaScriptCore.xcodeproj/project.pbxproj:
731 2006-07-13 Mark Rowe <opendarwin.org@bdash.net.nz>
733 Reviewed by Geoffrey.
735 http://bugzilla.opendarwin.org/show_bug.cgi?id=9742
736 Bug 9742: REGRESSION: WebKit hangs when loading <http://www.vtbook.com>
739 (KJS::JSValue::getUInt32): Only types tagged as numeric can be converted to UInt32.
741 2006-07-13 Geoffrey Garen <ggaren@apple.com>
745 - Renamed JSEvaluate -> JSEvaluateScript, JSCheckSyntax -> JSCheckScriptSyntax
746 - Added exception out parameters to JSValueTo* and JSValueIsEqual because
748 - Removed JSObjectGetDescription because it's useless and vague, and
749 JSValueToString/JSValueIsObjectOfClass do a better job, anyway
750 - Clarified comments about "IsFunction/Constructor" to indicate that they
751 are true of all functions/constructors, not just those created by JSObjectMake*
753 2006-07-12 Geoffrey Garen <ggaren@apple.com>
757 Finished previously approved JSInternalString -> JSString conversion
758 by renaming the files.
760 * API/JSCallbackObject.cpp:
761 * API/JSInternalStringRef.cpp: Removed.
762 * API/JSInternalStringRef.h: Removed.
763 * API/JSStringRef.cpp: Added.
764 * API/JSStringRef.h: Added.
765 * API/JavaScriptCore.h:
766 * JavaScriptCore.xcodeproj/project.pbxproj:
768 2006-07-12 Geoffrey Garen <ggaren@apple.com>
772 - Removed context and exception parameters from JSObjectGetPropertyEnumerator,
773 removing the spurious use of ExecState inside JavaScriptCore that made
774 us think this was necessary in the first place.
776 (StringInstance::getPropertyList): Use getString instead of toString because
777 we know we're dealing with a string -- we put it there in the first place.
778 While we're at it, store the string's size instead of retrieving it each time
779 through the loop, to avoid the unnecessary killing of puppies.
780 * kjs/string_object.h:
782 2006-07-12 Maciej Stachowiak <mjs@apple.com>
786 - add handling of hasInstance callback for API objects
788 * API/JSCallbackObject.cpp:
789 (KJS::JSCallbackObject::implementsHasInstance): Check if callback is present.
790 (KJS::JSCallbackObject::hasInstance): Invoke appropriate callback.
791 * API/JSCallbackObject.h:
792 * API/JSClassRef.cpp:
795 (MyObject_hasInstance): Test case; should match what construct would do.
798 2006-07-11 Geoffrey Garen <ggaren@apple.com>
802 - Implemented a vast number of renames and comment clarifications
803 suggested during API review.
805 JSInternalString -> JSString
806 JS*Make -> JSValueMake*, JSObjectMake*
808 JSValueIsInstanceOf -> JSValueIsInstanceOfConstructor (reads strangely well in client code)
809 JSGC*Protect -> JSValue*Protect
810 JS*Callback -> JSObject*Callback
811 JSGetPropertyListCallback -> JSObjectAddPropertiesToListCallback
812 JSPropertyEnumeratorGetNext -> JSPropertyEnumeratorGetNextName
814 JSStringCreateWithUTF8CString, JSStringGetUTF8CString,
815 JSStringGetMaximumUTF8CStringSize JSStringIsEqualToUTF8CString,
816 JSStringCreateWithCFString, JSStringCopyCFString, JSStringCreateWithCharacters.
818 - Changed functions taking a JSValue out arg and returning a bool indicating
819 whether it was set to simply return a JSValue or NULL.
821 - Removed JSStringGetCharacters because it's more documentation than code,
822 and it's just a glorified memcpy built on existing API functionality.
824 - Moved standard library includes into the headers that actually require them.
826 - Standardized use of the phrase "Create Rule."
828 - Removed JSLock from make functions that don't allocate.
830 - Added exception handling to JSValueToBoolean, since we now allow
831 callback objects to throw exceptions upon converting to boolean.
833 - Renamed JSGCCollect to JSGarbageCollect.
835 2006-07-10 Geoffrey Garen <ggaren@apple.com>
839 - Changed public header includes to the <JavaScriptCore/ style.
840 - Changed instances of 'buffer' to 'string' since we decided on
841 JSInternalString instead of JSStringBuffer.
843 * API/JSContextRef.h:
844 * API/JSInternalStringRef.cpp:
846 (JSInternalStringRetain):
847 (JSInternalStringRelease):
848 (JSValueCopyStringValue):
849 (JSInternalStringGetLength):
850 (JSInternalStringGetCharactersPtr):
851 (JSInternalStringGetCharacters):
852 (JSInternalStringGetMaxLengthUTF8):
853 (JSInternalStringGetCharactersUTF8):
854 (CFStringCreateWithJSInternalString):
855 * API/JSInternalStringRef.h:
857 (JSNodePrototype_appendChild):
858 (JSNode_getNodeType):
859 * API/JSObjectRef.cpp:
860 (JSObjectCallAsConstructor):
862 * API/JavaScriptCore.h:
867 (MyObject_getPropertyList):
868 (myConstructor_callAsConstructor):
869 (main): I noticed that we were prematurely releasing some string buffers,
870 so I moved their release calls to the end of main(). I got rid of 'Buf' in *Buf
871 (sometimes changing to 'IString', when necessary to differentiate a variable)
872 to match the buffer->string change.
874 === Safari-521.16 ===
876 2006-07-10 Darin Adler <darin@apple.com>
878 * kjs/value.cpp: (KJS::JSValue::toInt32Inline): Added inline keyword one more place.
881 2006-07-10 Darin Adler <darin@apple.com>
883 - fix the release build
887 (KJS::JSValue::toInt32Inline): Move the code here to an inline.
888 (KJS::JSValue::toInt32): Call the inline from both overloaded toInt32 functions.
890 2006-07-10 David Kilzer <ddkilzer@kilzer.net>
894 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9179
895 Implement select.options.add() method
897 * JavaScriptCore.exp: Added overloaded KJS::JSValue::toInt32() method.
898 * JavaScriptCore.xcodeproj/project.pbxproj: Altered attributes metadata for
899 kjs/value.h to make it available as a forwarded header.
901 (KJS::lookupPut): Extracted a lookupPut() method from the existing lookupPut() method.
902 The new method returns a boolean value if no entry is found in the lookup table.
904 (KJS::JSValue::toInt32): Overloaded toInt32() method with boolean "Ok" argument.
905 * kjs/value.h: Ditto.
907 2006-07-10 Geoffrey Garen <ggaren@apple.com>
909 No review necessary. Removed bogus file I accidentally checked in before.
911 * API/JSInternalSringRef.h: Removed.
913 2006-07-10 Geoffrey Garen <ggaren@apple.com>
917 Added exception out parameter to API object callbacks, removed semi-bogus
918 JSContext(.*)Exception functions.
920 To make these calls syntactically simple, I added an exceptionSlot()
921 method to the ExecState class, which provides a JSValue** slot in which to
922 store a JSValue* exception.
926 * API/JSCallbackConstructor.cpp:
927 (KJS::JSCallbackConstructor::construct):
928 * API/JSCallbackFunction.cpp:
929 (KJS::JSCallbackFunction::callAsFunction):
930 * API/JSCallbackObject.cpp:
931 (KJS::JSCallbackObject::init):
932 (KJS::JSCallbackObject::getOwnPropertySlot):
933 (KJS::JSCallbackObject::put):
934 (KJS::JSCallbackObject::deleteProperty):
935 (KJS::JSCallbackObject::construct):
936 (KJS::JSCallbackObject::callAsFunction):
937 (KJS::JSCallbackObject::getPropertyList):
938 (KJS::JSCallbackObject::toBoolean):
939 (KJS::JSCallbackObject::toNumber):
940 (KJS::JSCallbackObject::toString):
941 (KJS::JSCallbackObject::staticValueGetter):
942 (KJS::JSCallbackObject::callbackGetter):
943 * API/JSContextRef.cpp:
945 * API/JSContextRef.h:
947 (JSNodePrototype_appendChild):
948 (JSNodePrototype_removeChild):
949 (JSNodePrototype_replaceChild):
950 (JSNode_getNodeType):
951 (JSNode_getChildNodes):
952 (JSNode_getFirstChild):
956 (JSNodeListPrototype_item):
958 (JSNodeList_getProperty):
963 (MyObject_initialize):
964 (MyObject_hasProperty):
965 (MyObject_getProperty):
966 (MyObject_setProperty):
967 (MyObject_deleteProperty):
968 (MyObject_getPropertyList):
969 (MyObject_callAsFunction):
970 (MyObject_callAsConstructor):
971 (MyObject_convertToType):
972 (print_callAsFunction):
973 (myConstructor_callAsConstructor):
975 * JavaScriptCore.exp:
977 (KJS::ExecState::exceptionHandle):
979 2006-07-10 Geoffrey Garen <ggaren@apple.com>
983 Improved type safety by implementing opaque JSValue/JSObject typing through
984 abuse of 'const', not void*. Also fixed an alarming number of bugs
985 exposed by this new type safety.
987 I made one design change in JavaScriptCore, which is that the JSObject
988 constructor should take a JSValue* as its prototype argument, not a JSObject*,
989 since we allow the prototype to be any JSValue*, including jsNull(), for
995 * API/JSCallbackConstructor.cpp:
996 (KJS::JSCallbackConstructor::construct):
997 * API/JSCallbackFunction.cpp:
998 (KJS::JSCallbackFunction::callAsFunction):
999 * API/JSCallbackObject.cpp:
1000 (KJS::JSCallbackObject::JSCallbackObject):
1001 (KJS::JSCallbackObject::getOwnPropertySlot):
1002 (KJS::JSCallbackObject::put):
1003 (KJS::JSCallbackObject::construct):
1004 (KJS::JSCallbackObject::callAsFunction):
1005 (KJS::JSCallbackObject::staticFunctionGetter):
1006 * API/JSCallbackObject.h:
1007 * API/JSContextRef.cpp:
1010 (JSNodePrototype_appendChild):
1011 (JSNodePrototype_removeChild):
1012 (JSNodePrototype_replaceChild):
1013 * API/JSObjectRef.cpp:
1015 (JSFunctionMakeWithBody):
1016 (JSObjectGetProperty):
1017 (JSObjectCallAsFunction):
1018 (JSObjectCallAsConstructor):
1019 * API/JSObjectRef.h:
1024 (KJS::JSObject::JSObject):
1026 2006-07-10 Geoffrey Garen <ggaren@apple.com>
1028 Approved by Maciej, Darin.
1030 Renamed JSStringBufferRef to JSInternalStringRef. "Internal string" means the
1031 JavaScript engine's internal string representation, which is the most
1032 low-level and efficient representation to use when interfacing with JavaScript.
1038 * API/JSCallbackObject.cpp:
1039 (KJS::JSCallbackObject::getOwnPropertySlot):
1040 (KJS::JSCallbackObject::put):
1041 (KJS::JSCallbackObject::deleteProperty):
1042 (KJS::JSCallbackObject::staticValueGetter):
1043 (KJS::JSCallbackObject::callbackGetter):
1044 * API/JSContextRef.cpp:
1047 * API/JSContextRef.h:
1048 * API/JSInternalStringRef.cpp: Added.
1050 (JSInternalStringCreate):
1051 (JSInternalStringCreateUTF8):
1052 (JSInternalStringRetain):
1053 (JSInternalStringRelease):
1054 (JSValueCopyStringValue):
1055 (JSInternalStringGetLength):
1056 (JSInternalStringGetCharactersPtr):
1057 (JSInternalStringGetCharacters):
1058 (JSInternalStringGetMaxLengthUTF8):
1059 (JSInternalStringGetCharactersUTF8):
1060 (JSInternalStringIsEqual):
1061 (JSInternalStringIsEqualUTF8):
1062 (JSInternalStringCreateCF):
1063 (CFStringCreateWithJSInternalString):
1064 * API/JSInternalStringRef.h: Added.
1066 (JSNodePrototype_appendChild):
1067 (JSNode_getNodeType):
1068 (JSNode_getChildNodes):
1069 (JSNode_getFirstChild):
1071 (JSNodeList_length):
1072 (JSNodeList_getProperty):
1073 * API/JSObjectRef.cpp:
1074 (JSFunctionMakeWithBody):
1075 (JSObjectGetDescription):
1076 (JSObjectHasProperty):
1077 (JSObjectGetProperty):
1078 (JSObjectSetProperty):
1079 (JSObjectDeleteProperty):
1080 (JSPropertyEnumeratorGetNext):
1081 (JSPropertyListAdd):
1082 * API/JSObjectRef.h:
1083 * API/JSStringBufferRef.cpp: Removed.
1084 * API/JSStringBufferRef.h: Removed.
1086 * API/JavaScriptCore.h:
1091 (assertEqualsAsUTF8String):
1092 (assertEqualsAsCharactersPtr):
1093 (assertEqualsAsCharacters):
1094 (MyObject_hasProperty):
1095 (MyObject_getProperty):
1096 (MyObject_setProperty):
1097 (MyObject_deleteProperty):
1098 (MyObject_getPropertyList):
1099 (print_callAsFunction):
1100 (myConstructor_callAsConstructor):
1102 * JavaScriptCore.exp:
1103 * JavaScriptCore.xcodeproj/project.pbxproj:
1105 2006-07-08 Tim Omernick <timo@apple.com>
1109 Added an OpenGL drawing model to the Netscape Plug-in API.
1113 2006-07-08 Timothy Hatcher <timothy@apple.com>
1117 Moved KJS_GetCreatedJavaVMs to jni_utility.cpp.
1118 Switched KJS_GetCreatedJavaVMs over to use dlopen and dlsym
1119 now that NSAddImage, NSLookupSymbolInImage and NSAddressOfSymbol
1120 are deprecated in Leopard.
1122 * JavaScriptCore.exp:
1123 * JavaScriptCore.xcodeproj/project.pbxproj:
1124 * bindings/jni/jni_utility.cpp:
1125 (KJS::Bindings::KJS_GetCreatedJavaVMs):
1126 * bindings/softlinking.c: Removed.
1127 * bindings/softlinking.h: Removed.
1129 2006-07-08 Geoffrey Garen <ggaren@apple.com>
1133 - Make JSObjectGetProperty return a JSValue or NULL, like JSEvaluate does.
1135 * API/JSObjectRef.cpp:
1136 (JSObjectGetProperty):
1137 * API/JSObjectRef.h:
1141 2006-07-08 Geoffrey Garen <ggaren@apple.com>
1143 Style change -- no review necessary.
1145 Use 0 instead of NULL in API .cpp files, to match our style guidelines.
1147 * API/JSContextRef.cpp:
1149 * API/JSObjectRef.cpp:
1150 (JSFunctionMakeWithBody):
1151 (JSObjectCallAsFunction):
1152 (JSObjectCallAsConstructor):
1153 * API/JSValueRef.cpp:
1156 2006-07-08 Geoffrey Garen <ggaren@apple.com>
1160 - Added ability to pass NULL for thisObject when calling JSObjectCallAsFunction,
1161 to match JSEvaluate.
1163 * API/JSObjectRef.cpp:
1164 (JSObjectCallAsFunction):
1165 * API/JSObjectRef.h:
1169 === Safari-521.15 ===
1171 2006-07-07 Geoffrey Garen <ggaren@apple.com>
1175 - Standardized which functions take a JSContext as an argument. The rule is:
1176 if you might execute JavaScript, you take a JSContext, otherwise you don't.
1178 The FIXME in JSObjectRef.h requires refactoring some parts of Interpreter,
1179 but not API changes, so I'm putting it off until later.
1181 * API/JSCallbackObject.cpp:
1182 (KJS::JSCallbackObject::JSCallbackObject):
1183 (KJS::JSCallbackObject::init):
1184 * API/JSCallbackObject.h:
1185 * API/JSContextRef.cpp:
1187 * API/JSContextRef.h:
1188 * API/JSObjectRef.cpp:
1190 (JSPropertyEnumeratorGetNext):
1191 * API/JSObjectRef.h:
1193 (MyObject_initialize):
1195 * JavaScriptCore.exp:
1196 * kjs/array_object.cpp:
1197 (ArrayInstance::setLength):
1198 (ArrayInstance::pushUndefinedObjectsToEnd):
1200 (ForInNode::execute):
1201 * kjs/reference.cpp:
1202 (KJS::Reference::getPropertyName):
1203 (KJS::Reference::getValue):
1205 * kjs/scope_chain.cpp:
1206 (KJS::ScopeChain::print):
1208 2006-07-06 Geoffrey Garen <ggaren@apple.com>
1214 - Headerdoc finished
1217 - Added a JSContextRef argument to many functions, because you need a
1218 JSContextRef for doing virtually anything. I expect to add this argument
1219 to even more functions in a future patch.
1221 - Removed the globalObjectPrototype argument to JSContextCreate because
1222 you can't create an object until you have a context, so it's impossible
1223 to pass a prototype object to JSContextCreate. That's OK because (1) there's
1224 no reason to give the global object a prototype and (2) if you really want
1225 to, you can just use a separate call to JSObjectSetPrototype.
1227 - Removed the JSClassRef argument to JSClassCreate because it was unnecessary,
1228 and you need to be able to make the global object's class before you've
1229 created a JSContext.
1231 - Added an optional exception parameter to JSFunctionMakeWithBody because anything
1232 less would be uncivilized.
1234 - Made the return value parameter to JSObjectGetProperty optional to match
1235 all other return value parameters in the API.
1237 - Made JSObjectSetPrivate/JSObjectGetPrivate work on JSCallbackFunctions
1238 and JSCallbackConstructors. You could use an abstract base class or strategic
1239 placement of m_privateData in the class structure to implement this, but
1240 the former seemed like overkill, and the latter seemed too dangerous.
1242 - Fixed a bug where JSPropertyEnumeratorGetNext would skip the first property.
1245 - Reversed the logic of the JSChar #ifdef to avoid confusing headerdoc
1247 - Removed function names from @function declarations because headeroc
1248 can parse them automatically, and I wanted to rule out manual mismatch.
1250 - Changed Error::create to take a const UString& instead of a UString*
1251 because it was looking at me funny.
1253 - Renamed JSStringBufferCreateWithCFString to JSStringBufferCreateCF
1254 because the latter is more concise and it matches JSStringBufferCreateUTF8.
1256 * API/JSCallbackObject.cpp:
1257 (KJS::JSCallbackObject::getOwnPropertySlot):
1258 (KJS::JSCallbackObject::put):
1259 (KJS::JSCallbackObject::deleteProperty):
1260 (KJS::JSCallbackObject::getPropertyList):
1261 (KJS::JSCallbackObject::toBoolean):
1262 (KJS::JSCallbackObject::toNumber):
1263 (KJS::JSCallbackObject::toString):
1264 * API/JSClassRef.cpp:
1266 * API/JSContextRef.cpp:
1268 (JSContextSetException):
1269 * API/JSContextRef.h:
1271 (JSNodePrototype_class):
1274 (JSNodeListPrototype_class):
1276 * API/JSObjectRef.cpp:
1277 (JSObjectGetProperty):
1278 (JSObjectGetPrivate):
1279 (JSObjectSetPrivate):
1280 (JSObjectCallAsFunction):
1281 (JSObjectCallAsConstructor):
1282 (JSPropertyEnumeratorGetNext):
1283 * API/JSObjectRef.h:
1284 * API/JSStringBufferRef.cpp:
1285 (JSStringBufferCreateCF):
1286 * API/JSStringBufferRef.h:
1287 * API/JSValueRef.cpp:
1288 (JSValueIsInstanceOf):
1294 (MyObject_hasProperty):
1295 (MyObject_setProperty):
1296 (MyObject_deleteProperty):
1297 (MyObject_getPropertyList):
1298 (MyObject_convertToType):
1301 * JavaScriptCore.exp:
1303 2006-07-07 Geoffrey Garen <ggaren@apple.com>
1307 - Fixed a few crashes resulting from NULL parameters to JSClassCreate.
1309 * API/JSClassRef.cpp:
1312 * API/testapi.c: Added test for NULL parameters.
1315 2006-07-07 Geoffrey Garen <ggaren@apple.com>
1317 Reviewed by John, mocked by Darin.
1319 - Changed JSEvaluate to take a JSObjectRef instead of a JSValueRef as
1320 "this," since "this" must be an object.
1322 * API/JSContextRef.cpp:
1324 * API/JSContextRef.h:
1326 2006-07-07 Geoffrey Garen <ggaren@apple.com>
1333 * JavaScriptCore.xcodeproj/project.pbxproj:
1335 2006-07-05 Geoffrey Garen <ggaren@apple.com>
1339 Renamed JSCharBufferRef, which was universally unpopular, to JSStringBufferRef,
1340 which, hopefully, will be less unpopular.
1346 * API/JSCallbackObject.cpp:
1347 (KJS::JSCallbackObject::getOwnPropertySlot):
1348 (KJS::JSCallbackObject::put):
1349 (KJS::JSCallbackObject::deleteProperty):
1350 (KJS::JSCallbackObject::staticValueGetter):
1351 (KJS::JSCallbackObject::callbackGetter):
1352 * API/JSCharBufferRef.cpp: Removed.
1353 * API/JSCharBufferRef.h: Removed.
1354 * API/JSContextRef.cpp:
1357 * API/JSContextRef.h:
1359 (JSNodePrototype_appendChild):
1360 (JSNode_getNodeType):
1361 (JSNode_getChildNodes):
1362 (JSNode_getFirstChild):
1364 (JSNodeList_length):
1365 (JSNodeList_getProperty):
1366 * API/JSObjectRef.cpp:
1367 (JSFunctionMakeWithBody):
1368 (JSObjectGetDescription):
1369 (JSObjectHasProperty):
1370 (JSObjectGetProperty):
1371 (JSObjectSetProperty):
1372 (JSObjectDeleteProperty):
1373 (JSPropertyEnumeratorGetNext):
1374 (JSPropertyListAdd):
1375 * API/JSObjectRef.h:
1376 * API/JSStringBufferRef.cpp: Added.
1378 (JSStringBufferCreate):
1379 (JSStringBufferCreateUTF8):
1380 (JSStringBufferRetain):
1381 (JSStringBufferRelease):
1382 (JSValueCopyStringValue):
1383 (JSStringBufferGetLength):
1384 (JSStringBufferGetCharactersPtr):
1385 (JSStringBufferGetCharacters):
1386 (JSStringBufferGetMaxLengthUTF8):
1387 (JSStringBufferGetCharactersUTF8):
1388 (JSStringBufferIsEqual):
1389 (JSStringBufferIsEqualUTF8):
1390 (JSStringBufferCreateWithCFString):
1391 (CFStringCreateWithJSStringBuffer):
1392 * API/JSStringBufferRef.h: Added.
1394 * API/JavaScriptCore.h:
1399 (assertEqualsAsUTF8String):
1400 (assertEqualsAsCharactersPtr):
1401 (assertEqualsAsCharacters):
1402 (MyObject_hasProperty):
1403 (MyObject_getProperty):
1404 (MyObject_setProperty):
1405 (MyObject_deleteProperty):
1406 (MyObject_getPropertyList):
1407 (print_callAsFunction):
1408 (myConstructor_callAsConstructor):
1410 * JavaScriptCore.exp:
1411 * JavaScriptCore.xcodeproj/project.pbxproj:
1413 2006-07-05 Geoffrey Garen <ggaren@apple.com>
1417 Moved some code around for more logical file separation.
1420 * API/JSContextRef.h:
1421 * API/JSObjectRef.cpp:
1422 * API/JSValueRef.cpp:
1426 2006-07-03 Geoffrey Garen <ggaren@apple.com>
1430 Implemented JSFunctionMakeWithBody, which parses a script as a function body
1431 in the global scope, and returns the resulting anonymous function.
1433 I also removed private data from JSCallbackFunction. It never worked,
1434 since JSCallbackFunction doesn't inherit from JSCallbackObject.
1436 * API/JSCallbackConstructor.cpp: Removed.
1437 * API/JSCallbackConstructor.h: Removed.
1438 * API/JSCallbackFunction.cpp:
1439 (KJS::JSCallbackFunction::JSCallbackFunction):
1440 (KJS::JSCallbackFunction::implementsConstruct):
1441 (KJS::JSCallbackFunction::construct):
1442 (KJS::JSCallbackFunction::implementsCall):
1443 (KJS::JSCallbackFunction::callAsFunction):
1444 * API/JSCallbackFunction.h:
1445 * API/JSCallbackObject.cpp:
1446 (KJS::JSCallbackObject::staticFunctionGetter):
1447 * API/JSObjectRef.cpp:
1449 (JSFunctionMakeWithCallbacks):
1450 * API/JSObjectRef.h:
1456 * JavaScriptCore.exp: Programmatically added all symbols exported by
1457 API object files, and sorted results
1458 * JavaScriptCore.xcodeproj/project.pbxproj:
1460 2006-07-03 Geoffrey Garen <ggaren@apple.com>
1464 - Return syntax error in JSCheckSyntax through a JSValueRef* exception
1468 * API/JSContextRef.cpp:
1472 * JavaScriptCore.exp:
1473 * kjs/interpreter.cpp:
1474 (KJS::Interpreter::checkSyntax):
1475 * kjs/interpreter.h:
1477 2006-07-04 Darin Adler <darin@apple.com>
1481 * wtf/MathExtras.h: Oops. Added missing #endif.
1483 2006-07-04 Bjoern Graf <bjoern.graf@gmail.com>
1486 Tweaked a bit by Darin.
1488 - http://bugzilla.opendarwin.org/show_bug.cgi?id=9678
1489 work around MSVCRT's fmod function returning NaN for fmod(x, infinity) instead of x
1491 * wtf/MathExtras.h: Added include of <float.h>.
1492 (isinf): Fix to return false for NAN.
1493 (wtf_fmod): Added. An inline that works around the bug.
1496 * kjs/number_object.cpp:
1497 * kjs/operations.cpp:
1499 Added includes of MathExtras.h to all files using fmod.
1501 * JavaScriptCore.xcodeproj/project.pbxproj: Let Xcode 2.3 have its way with
1504 2006-07-01 Geoffrey Garen <ggaren@apple.com>
1508 - Refined value conversions in the API:
1509 - failed toNumber returns NaN
1510 - failed toObject returns NULL
1511 - failed toString returns empty string
1513 - Refined excpetion handling in the API:
1514 - failed value conversions do not throw exceptions
1515 - uncaught exceptions in JSEvaluate, JSObjectCallAsFunction, and
1516 JSObjectCallAsConstructor are returned through a JSValueRef* exception
1518 - removed JSContextHasException, because JSContextGetException does
1522 * API/JSCharBufferRef.cpp:
1523 (JSValueCopyStringValue):
1524 * API/JSContextRef.cpp:
1526 * API/JSContextRef.h:
1527 * API/JSNodeList.c: Added test code demonstrating how you would use
1528 toNumber, and why you probably don't need toUInt32, etc.
1529 (JSNodeListPrototype_item):
1530 (JSNodeList_getProperty):
1531 * API/JSObjectRef.cpp:
1533 (JSObjectCallAsFunction):
1534 (JSObjectCallAsConstructor):
1535 * API/JSObjectRef.h:
1536 * API/JSValueRef.cpp:
1542 (main): Added tests for new rules, and call to JSGCProtect to fix Intel
1544 * JavaScriptCore.exp:
1546 2006-07-03 Darin Adler <darin@apple.com>
1548 - Rolled out HashMap implementation of NPRuntime, at least temporarily.
1550 Fixes hang in the bindings section of layout tests seen on the
1553 This code was using HashMap<const char*, PrivateIdentifier*>.
1554 But that hashes based on pointer identity, not string value.
1555 The default hash for any pointer type is to hash based on the pointer.
1556 And WTF doesn't currently have a string hash for char*.
1557 We'll need to fix that before re-landing this patch.
1559 (Formatting was also incorrect -- extra spaces in parentheses.)
1561 * bindings/npruntime.cpp: Rolled out last change.
1563 2006-07-02 Justin Haygood <jhaygood@spsu.edu>
1565 Reviewed, tweaked, landed by ggaren.
1567 - Port NPRuntime from CFDictionary to HashMap.
1569 * bindings/npruntime.cpp:
1570 (getStringIdentifierDictionary):
1571 (getIntIdentifierDictionary):
1572 (_NPN_GetStringIdentifier):
1573 (_NPN_GetIntIdentifier):
1574 * bindings/npruntime.h:
1576 2006-07-01 Geoffrey Garen <ggaren@apple.com>
1580 - Fixed <rdar://problem/4611197> REGRESSION: Liveconnect with Java test
1581 fails at http://www-sor.inria.fr/~dedieu/notes/liveconnect/simple_example.html
1583 * JavaScriptCore.exp: Export symbols used by liveconnect
1585 2006-06-29 Geoffrey Garen <ggaren@apple.com>
1589 - Phase 2 in the JS API.
1591 - Added support for specifying static tables of values -- this should
1592 obviate the need for using complicated callbacks for most lookups.
1594 - API objects are now created with classes (JSClassRef) -- in order to support
1595 static values, and in order to prevent API objects from storing their
1596 data inline, and thus falling into the oversized (read: slow and prone to
1597 giving Maciej the frowny face) heap.
1599 - Added two specialized JSObject subclasses -- JSCallbackFunction and JSCallbackConstructor --
1600 to allow JSFunctionMake and JSConstructorMake to continue to work with
1601 the new class model. Another solution to this problem would be to create
1602 a custom class object for each function and constructor you make. This
1603 solution is more code but also more efficient.
1605 - Substantially beefed up the minidom example to demonstrate and test a
1606 lot of these techniques. Its output is still pretty haphazard, though.
1608 - Gave the <kjs/ preface to some includes -- I'm told this matters to
1609 building on some versions of Linux.
1611 - Implemented JSValueIsInstanceOf and JSValueIsObjectOfClass
1613 - Removed GetDescription callback. Something in the class datastructure
1614 should take care of this.
1617 * API/JSCallbackConstructor.cpp: Added.
1619 (KJS::JSCallbackConstructor::JSCallbackConstructor):
1620 (KJS::JSCallbackConstructor::implementsConstruct):
1621 (KJS::JSCallbackConstructor::construct):
1622 (KJS::JSCallbackConstructor::setPrivate):
1623 (KJS::JSCallbackConstructor::getPrivate):
1624 * API/JSCallbackConstructor.h: Added.
1625 (KJS::JSCallbackConstructor::classInfo):
1626 * API/JSCallbackFunction.cpp: Added.
1628 (KJS::JSCallbackFunction::JSCallbackFunction):
1629 (KJS::JSCallbackFunction::implementsCall):
1630 (KJS::JSCallbackFunction::callAsFunction):
1631 (KJS::JSCallbackFunction::setPrivate):
1632 (KJS::JSCallbackFunction::getPrivate):
1633 * API/JSCallbackFunction.h: Added.
1634 (KJS::JSCallbackFunction::classInfo):
1635 * API/JSCallbackObject.cpp:
1637 (KJS::JSCallbackObject::JSCallbackObject):
1638 (KJS::JSCallbackObject::init):
1639 (KJS::JSCallbackObject::~JSCallbackObject):
1640 (KJS::JSCallbackObject::className):
1641 (KJS::JSCallbackObject::getOwnPropertySlot):
1642 (KJS::JSCallbackObject::put):
1643 (KJS::JSCallbackObject::deleteProperty):
1644 (KJS::JSCallbackObject::implementsConstruct):
1645 (KJS::JSCallbackObject::construct):
1646 (KJS::JSCallbackObject::implementsCall):
1647 (KJS::JSCallbackObject::callAsFunction):
1648 (KJS::JSCallbackObject::getPropertyList):
1649 (KJS::JSCallbackObject::toBoolean):
1650 (KJS::JSCallbackObject::toNumber):
1651 (KJS::JSCallbackObject::toString):
1652 (KJS::JSCallbackObject::inherits):
1653 (KJS::JSCallbackObject::staticValueGetter):
1654 (KJS::JSCallbackObject::staticFunctionGetter):
1655 (KJS::JSCallbackObject::callbackGetter):
1656 * API/JSCallbackObject.h:
1657 * API/JSCharBufferRef.cpp:
1658 * API/JSClassRef.cpp: Added.
1662 * API/JSClassRef.h: Added.
1663 (StaticValueEntry::StaticValueEntry):
1664 (StaticFunctionEntry::StaticFunctionEntry):
1665 (__JSClass::__JSClass):
1666 * API/JSContextRef.cpp:
1669 * API/JSContextRef.h:
1670 * API/JSNode.c: Added.
1671 (JSNodePrototype_appendChild):
1672 (JSNodePrototype_removeChild):
1673 (JSNodePrototype_replaceChild):
1674 (JSNodePrototype_class):
1675 (JSNode_getNodeType):
1676 (JSNode_getChildNodes):
1677 (JSNode_getFirstChild):
1683 * API/JSNode.h: Added.
1684 * API/JSNodeList.c: Added.
1685 (JSNodeListPrototype_item):
1686 (JSNodeListPrototype_class):
1687 (JSNodeList_length):
1688 (JSNodeList_getProperty):
1689 (JSNodeList_finalize):
1691 (JSNodeList_prototype):
1693 * API/JSNodeList.h: Added.
1694 * API/JSObjectRef.cpp:
1697 (JSConstructorMake):
1698 (__JSPropertyEnumerator::__JSPropertyEnumerator):
1699 (JSObjectCreatePropertyEnumerator):
1700 (JSPropertyEnumeratorGetNext):
1701 (JSPropertyEnumeratorRetain):
1702 (JSPropertyEnumeratorRelease):
1703 * API/JSObjectRef.h:
1704 (__JSObjectCallbacks::):
1705 * API/JSValueRef.cpp:
1706 (JSValueIsObjectOfClass):
1707 (JSValueIsInstanceOf):
1709 * API/Node.c: Added.
1713 (Node_replaceChild):
1716 * API/Node.h: Added.
1717 * API/NodeList.c: Added.
1723 * API/NodeList.h: Added.
1727 (createStringWithContentsOfFile):
1730 (assertEqualsAsCharacters):
1731 (MyObject_getProperty):
1733 (myConstructor_callAsConstructor):
1736 * JavaScriptCore.xcodeproj/project.pbxproj:
1738 2006-06-26 Kevin Ollivier <kevino@theolliviers.com>
1740 Reviewed and tweaked by Darin.
1742 - Compile fixes for wx port / gcc 4.0.2
1744 * kjs/array_object.cpp:
1745 Added missing headers.
1748 gcc needs class prototypes before defining those classes as friend classes
1750 2006-06-30 Mike Emmel <mike.emmel@gmail.com>
1754 Compilation fixes for Linux/Gdk.
1756 * JavaScriptCore/kjs/interpreter.cpp: added include of signal.h
1757 * JavaScriptCore/kjs/ExecState.h: added missing class declaration
1758 * JavaScriptCore/kjs/ExecState.cpp: case wrong on include of context.h
1759 * JavaScriptCore/JavaScriptCoreSources.bkl: added Context.cpp and ExecState.cpp
1761 === Safari-521.14 ===
1763 2006-06-29 Maciej Stachowiak <mjs@apple.com>
1767 - add headerdoc comments to some of the new JS API headers
1772 2006-06-28 Timothy Hatcher <timothy@apple.com>
1774 Prefer the Stabs debugging symbols format until DWARF bugs are fixed.
1776 * JavaScriptCore.xcodeproj/project.pbxproj:
1778 2006-06-27 Timothy Hatcher <timothy@apple.com>
1782 <rdar://problem/4448350> Deprecated ObjC language API used in JavaScriptCore, WebCore, WebKit and WebBrowser
1784 Switch to the new ObjC 2 API, ifdefed the old code around OBJC_API_VERSION so it still works on Tiger.
1785 Removed the use of the old stringWithCString, switched to the new Tiger version that accepts an encoding.
1786 Lots of code style cleanup.
1788 * JavaScriptCore.xcodeproj/project.pbxproj:
1789 * bindings/objc/objc_class.h:
1790 * bindings/objc/objc_class.mm:
1791 (KJS::Bindings::ObjcClass::~ObjcClass):
1792 (KJS::Bindings::_createClassesByIsAIfNecessary):
1793 (KJS::Bindings::ObjcClass::classForIsA):
1794 (KJS::Bindings::ObjcClass::name):
1795 (KJS::Bindings::ObjcClass::methodsNamed):
1796 (KJS::Bindings::ObjcClass::fieldNamed):
1797 (KJS::Bindings::ObjcClass::fallbackObject):
1798 * bindings/objc/objc_header.h:
1799 * bindings/objc/objc_instance.h:
1800 * bindings/objc/objc_instance.mm:
1801 (ObjcInstance::ObjcInstance):
1802 (ObjcInstance::~ObjcInstance):
1803 (ObjcInstance::operator=):
1804 (ObjcInstance::begin):
1805 (ObjcInstance::end):
1806 (ObjcInstance::getClass):
1807 (ObjcInstance::invokeMethod):
1808 (ObjcInstance::invokeDefaultMethod):
1809 (ObjcInstance::setValueOfField):
1810 (ObjcInstance::supportsSetValueOfUndefinedField):
1811 (ObjcInstance::setValueOfUndefinedField):
1812 (ObjcInstance::getValueOfField):
1813 (ObjcInstance::getValueOfUndefinedField):
1814 (ObjcInstance::defaultValue):
1815 (ObjcInstance::stringValue):
1816 (ObjcInstance::numberValue):
1817 (ObjcInstance::booleanValue):
1818 (ObjcInstance::valueOf):
1819 * bindings/objc/objc_runtime.h:
1820 * bindings/objc/objc_runtime.mm:
1821 (ObjcMethod::ObjcMethod):
1823 (ObjcMethod::getMethodSignature):
1824 (ObjcMethod::setJavaScriptName):
1827 (ObjcField::valueFromInstance):
1828 (convertValueToObjcObject):
1829 (ObjcField::setValueToInstance):
1830 (ObjcArray::operator=):
1831 (ObjcArray::setValueAt):
1832 (ObjcArray::valueAt):
1833 (ObjcFallbackObjectImp::ObjcFallbackObjectImp):
1834 (ObjcFallbackObjectImp::callAsFunction):
1835 (ObjcFallbackObjectImp::defaultValue):
1837 2006-06-28 Anders Carlsson <acarlsson@apple.com>
1841 http://bugzilla.opendarwin.org/show_bug.cgi?id=8636
1842 REGRESSION: JavaScript access to Java applet causes hang (_webViewURL not implemented)
1844 * bindings/jni/jni_objc.mm:
1845 (KJS::Bindings::dispatchJNICall):
1846 Just pass nil as the calling URL. This will cause the Java plugin to use the URL of the page
1847 containing the applet (which is what we used to do).
1849 2006-06-27 Timothy Hatcher <timothy@apple.com>
1853 <rdar://problem/4406785> Add an export file to TOT JavaScriptCore like the Safari-2-0-branch
1855 * JavaScriptCore.exp: Added.
1856 * JavaScriptCore.xcodeproj/project.pbxproj:
1858 2006-06-25 Geoffrey Garen <ggaren@apple.com>
1862 - Added JSConstructorMake to match JSFunctionMake, along with test code.
1864 [ I checked in the ChangeLog before without the actual files. ]
1866 * API/JSObjectRef.cpp:
1867 (JSConstructorMake):
1868 * API/JSObjectRef.h:
1870 (myConstructor_callAsConstructor):
1874 * JavaScriptCore.xcodeproj/project.pbxproj: Moved testapi.c to the testapi
1875 target -- this was an oversight in my earlier check-in.
1877 2006-06-25 Timothy Hatcher <timothy@apple.com>
1881 Bug 9574: Drosera should show inline scripts within the original HTML
1882 http://bugzilla.opendarwin.org/show_bug.cgi?id=9574
1884 Pass the starting line number and error message to the debugger.
1887 (Debugger::sourceParsed):
1890 (KJS::GlobalFuncImp::callAsFunction):
1891 * kjs/function_object.cpp:
1892 (FunctionObjectImp::construct):
1893 * kjs/interpreter.cpp:
1894 (KJS::Interpreter::evaluate):
1896 2006-06-24 Alexey Proskuryakov <ap@nypop.com>
1898 Rubber-stamped by Eric.
1900 Add a -h (do not follow symlinks) option to ln in derived sources build script (without it,
1901 a symlink was created inside the source directory on second build).
1903 * JavaScriptCore.xcodeproj/project.pbxproj:
1905 2006-06-24 David Kilzer <ddkilzer@kilzer.net>
1907 Reviewed by Timothy.
1909 * Info.plist: Fixed copyright to include 2003-2006.
1911 2006-06-24 Alexey Proskuryakov <ap@nypop.com>
1915 - http://bugzilla.opendarwin.org/show_bug.cgi?id=9418
1916 WebKit will not build when Space exists in path
1918 * JavaScriptCore.xcodeproj/project.pbxproj: Enclose search paths in quotes; create symlinks to
1919 avoid passing paths with spaces to make.
1921 2006-06-23 Timothy Hatcher <timothy@apple.com>
1925 Adding more operator[] overloads for long and short types.
1928 (WTF::Vector::operator[]):
1930 === JavaScriptCore-521.13 ===
1932 2006-06-22 Alexey Proskuryakov <ap@nypop.com>
1936 - http://bugzilla.opendarwin.org/show_bug.cgi?id=9539
1937 Another case error preventing build
1939 * API/JSObjectRef.cpp: Changed "identifier.h" to "Identifier.h"
1941 2006-06-22 David Kilzer <ddkilzer@kilzer.net>
1945 http://bugzilla.opendarwin.org/show_bug.cgi?id=9539
1946 Another case error preventing build
1948 * API/APICast.h: Changed "UString.h" to "ustring.h".
1950 2006-06-21 Geoffrey Garen <ggaren@apple.com>
1952 Fixed release build, fixed accidental infinite recursion due to
1953 last minute global replace gone awry.
1958 (assertEqualsAsBoolean):
1959 (assertEqualsAsNumber):
1960 (assertEqualsAsUTF8String):
1961 (assertEqualsAsCharactersPtr):
1962 * JavaScriptCore.xcodeproj/project.pbxproj:
1964 2006-06-21 Geoffrey Garen <ggaren@apple.com>
1968 - First cut at C API to JavaScript. Includes a unit test, 'testapi.c',
1969 and the outline of a test app, 'minidom.c'.
1971 Includes one change to JSC internals: Rename propList to getPropertyList and have it
1972 take its target property list by reference so that subclasses can
1973 add properties to the list before calling through to their superclasses.
1975 Also, I just ran prepare-ChangeLog in about 10 seconds, and I would like
1976 to give a shout-out to that.
1978 * API/APICast.h: Added.
1981 * API/JSBase.h: Added.
1982 * API/JSCallbackObject.cpp: Added.
1984 (KJS::JSCallbackObject::JSCallbackObject):
1985 (KJS::JSCallbackObject::~JSCallbackObject):
1986 (KJS::JSCallbackObject::className):
1987 (KJS::JSCallbackObject::getOwnPropertySlot):
1988 (KJS::JSCallbackObject::put):
1989 (KJS::JSCallbackObject::deleteProperty):
1990 (KJS::JSCallbackObject::implementsConstruct):
1991 (KJS::JSCallbackObject::construct):
1992 (KJS::JSCallbackObject::implementsCall):
1993 (KJS::JSCallbackObject::callAsFunction):
1994 (KJS::JSCallbackObject::getPropertyList):
1995 (KJS::JSCallbackObject::toBoolean):
1996 (KJS::JSCallbackObject::toNumber):
1997 (KJS::JSCallbackObject::toString):
1998 (KJS::JSCallbackObject::setPrivate):
1999 (KJS::JSCallbackObject::getPrivate):
2000 (KJS::JSCallbackObject::cachedValueGetter):
2001 (KJS::JSCallbackObject::callbackGetter):
2002 * API/JSCallbackObject.h: Added.
2003 (KJS::JSCallbackObject::classInfo):
2004 * API/JSCharBufferRef.cpp: Added.
2006 (JSCharBufferCreate):
2007 (JSCharBufferCreateUTF8):
2008 (JSCharBufferRetain):
2009 (JSCharBufferRelease):
2010 (JSValueCopyStringValue):
2011 (JSCharBufferGetLength):
2012 (JSCharBufferGetCharactersPtr):
2013 (JSCharBufferGetCharacters):
2014 (JSCharBufferGetMaxLengthUTF8):
2015 (JSCharBufferGetCharactersUTF8):
2016 (JSCharBufferIsEqual):
2017 (JSCharBufferIsEqualUTF8):
2018 (JSCharBufferCreateWithCFString):
2019 (CFStringCreateWithJSCharBuffer):
2020 * API/JSCharBufferRef.h: Added.
2021 * API/JSContextRef.cpp: Added.
2024 (JSContextGetGlobalObject):
2027 (JSContextHasException):
2028 (JSContextGetException):
2029 (JSContextClearException):
2030 (JSContextSetException):
2031 * API/JSContextRef.h: Added.
2032 * API/JSObjectRef.cpp: Added.
2036 (JSObjectGetDescription):
2037 (JSObjectGetPrototype):
2038 (JSObjectSetPrototype):
2039 (JSObjectHasProperty):
2040 (JSObjectGetProperty):
2041 (JSObjectSetProperty):
2042 (JSObjectDeleteProperty):
2043 (JSObjectGetPrivate):
2044 (JSObjectSetPrivate):
2045 (JSObjectIsFunction):
2046 (JSObjectCallAsFunction):
2047 (JSObjectIsConstructor):
2048 (JSObjectCallAsConstructor):
2049 (__JSPropertyListEnumerator::__JSPropertyListEnumerator):
2050 (JSObjectCreatePropertyEnumerator):
2051 (JSPropertyEnumeratorGetNext):
2052 (JSPropertyEnumeratorRetain):
2053 (JSPropertyEnumeratorRelease):
2054 (JSPropertyListAdd):
2055 * API/JSObjectRef.h: Added.
2056 * API/JSValueRef.cpp: Added.
2058 (JSValueIsUndefined):
2065 (JSValueIsStrictEqual):
2075 * API/JSValueRef.h: Added.
2076 * API/JavaScriptCore.h: Added.
2077 * API/minidom.c: Added.
2079 * API/minidom.html: Added.
2080 * API/minidom.js: Added.
2081 * API/testapi.c: Added.
2082 (assertEqualsAsBoolean):
2083 (assertEqualsAsNumber):
2084 (assertEqualsAsUTF8String):
2085 (assertEqualsAsCharactersPtr):
2086 (assertEqualsAsCharacters):
2087 (MyObject_initialize):
2088 (MyObject_copyDescription):
2089 (MyObject_hasProperty):
2090 (MyObject_getProperty):
2091 (MyObject_setProperty):
2092 (MyObject_deleteProperty):
2093 (MyObject_getPropertyList):
2094 (MyObject_callAsFunction):
2095 (MyObject_callAsConstructor):
2096 (MyObject_convertToType):
2097 (MyObject_finalize):
2098 (print_callAsFunction):
2100 (createStringWithContentsOfFile):
2101 * API/testapi.js: Added.
2103 * JavaScriptCore.xcodeproj/project.pbxproj:
2104 * bindings/npruntime_impl.h:
2105 * kjs/array_instance.h:
2106 * kjs/array_object.cpp:
2107 (ArrayInstance::getPropertyList):
2108 * kjs/interpreter.cpp:
2109 (KJS::Interpreter::evaluate):
2111 (ForInNode::execute):
2113 (KJS::JSObject::put):
2114 (KJS::JSObject::canPut):
2115 (KJS::JSObject::deleteProperty):
2116 (KJS::JSObject::propertyIsEnumerable):
2117 (KJS::JSObject::getPropertyAttributes):
2118 (KJS::JSObject::getPropertyList):
2120 * kjs/property_map.cpp:
2121 (KJS::PropertyMap::get):
2122 * kjs/property_map.h:
2123 * kjs/scope_chain.cpp:
2124 (KJS::ScopeChain::print):
2125 * kjs/string_object.cpp:
2126 (StringInstance::getPropertyList):
2127 * kjs/string_object.h:
2129 (KJS::UString::Rep::ref):
2131 2006-06-20 Timothy Hatcher <timothy@apple.com>
2135 Make sure we clear the exception before returning so
2136 that future calls will not fail because of an earlier
2137 exception state. Assert on entry that the WebScriptObject
2138 is working with an ExecState that dose not have an exception.
2139 Document that evaluateWebScript and callWebScriptMethod return
2140 WebUndefined when an exception is thrown.
2142 * bindings/objc/WebScriptObject.h:
2143 * bindings/objc/WebScriptObject.mm:
2144 (-[WebScriptObject callWebScriptMethod:withArguments:]):
2145 (-[WebScriptObject evaluateWebScript:]):
2146 (-[WebScriptObject setValue:forKey:]):
2147 (-[WebScriptObject valueForKey:]):
2148 (-[WebScriptObject removeWebScriptKey:]):
2149 (-[WebScriptObject webScriptValueAtIndex:]):
2150 (-[WebScriptObject setWebScriptValueAtIndex:value:]):
2152 2006-06-19 Anders Carlsson <acarlsson@apple.com>
2156 * kjs/interpreter.cpp:
2157 (KJS::TimeoutChecker::pauseTimeoutCheck):
2158 (KJS::TimeoutChecker::resumeTimeoutCheck):
2159 Fix argument order in setitimer calls.
2161 2006-06-18 Anders Carlsson <acarlsson@apple.com>
2165 * kjs/interpreter.cpp:
2166 (KJS::TimeoutChecker::pauseTimeoutCheck):
2167 Do nothing if the timeout check hasn't been started.
2169 (KJS::TimeoutChecker::resumeTimeoutCheck):
2170 Do nothing if the timeout check hasn't been started.
2171 Use the right signal handler when unblocking.
2173 (KJS::Interpreter::handleTimeout):
2174 pause/resume the timeout check around the call to
2175 shouldInterruptScript().
2177 2006-06-16 Ben Goodger <beng@google.com>
2181 http://bugzilla.opendarwin.org/show_bug.cgi?id=9491
2182 Windows build breaks in interpreter.cpp
2184 * kjs/interpreter.cpp
2185 (KJS::TimeoutChecker::pauseTimeoutCheck):
2186 (KJS::TimeoutChecker::resumeTimeoutCheck):
2187 Make sure to only assert equality with s_executingInterpreter when it
2188 is being used (i.e. when HAVE(SYS_TIME_H) == true)
2190 2006-06-17 David Kilzer <ddkilzer@kilzer.net>
2194 http://bugzilla.opendarwin.org/show_bug.cgi?id=9477
2195 REGRESSION: fast/dom/replaceChild.html crashes on WebKit ToT in debug build
2198 (KJS::FunctionImp::callAsFunction): Refetch the debugger after executing the function
2199 in case the WebFrame it was running in has since been destroyed.
2201 2006-06-17 David Kilzer <ddkilzer@kilzer.net>
2205 http://bugzilla.opendarwin.org/show_bug.cgi?id=9476
2206 REGRESSION: Reproducible crash after closing window after viewing
2207 css2.1/t0803-c5501-imrgn-t-00-b-ag.html
2210 (Debugger::detach): Call setDebugger(0) for all interpreters removed from
2211 the 'attached to a debugger' list.
2213 2006-06-17 Anders Carlsson <acarlsson@apple.com>
2215 Reviewed by Maciej and Geoff.
2217 http://bugzilla.opendarwin.org/show_bug.cgi?id=7080
2218 Provide some way to stop a JavaScript infinite loop
2222 Add Interrupted completion type.
2225 (KJS::FunctionImp::callAsFunction):
2226 (KJS::GlobalFuncImp::callAsFunction):
2227 Only set the exception on the new ExecState if the current one has had one.
2229 * kjs/interpreter.cpp:
2230 (KJS::TimeoutChecker::startTimeoutCheck):
2231 (KJS::TimeoutChecker::stopTimeoutCheck):
2232 (KJS::TimeoutChecker::alarmHandler):
2233 (KJS::TimeoutChecker::pauseTimeoutCheck):
2234 (KJS::TimeoutChecker::resumeTimeoutCheck):
2235 New TimeoutChecker class which handles setting Interpreter::m_timedOut flag after a given
2236 period of time. This currently only works on Unix platforms where setitimer and signals are used.
2238 (KJS::Interpreter::Interpreter):
2239 Initialize new member variables.
2241 (KJS::Interpreter::~Interpreter):
2242 Destroy the timeout checker.
2244 (KJS::Interpreter::startTimeoutCheck):
2245 (KJS::Interpreter::stopTimeoutCheck):
2246 (KJS::Interpreter::pauseTimeoutCheck):
2247 (KJS::Interpreter::resumeTimeoutCheck):
2248 Call the timeout checker.
2250 (KJS::Interpreter::handleTimeout):
2251 Called on timeout. Resets the m_timedOut flag and calls shouldInterruptScript.
2253 * kjs/interpreter.h:
2254 (KJS::Interpreter::setTimeoutTime):
2255 New function for setting the timeout time.
2257 (KJS::Interpreter::shouldInterruptScript):
2258 New function. The idea is that this should be overridden by subclasses in order to for example
2259 pop up a dialog asking the user if the script should be interrupted.
2261 (KJS::Interpreter::checkTimeout):
2262 New function which checks the m_timedOut flag and calls handleTimeout if it's set.
2265 (DoWhileNode::execute):
2266 (WhileNode::execute):
2268 Call Interpreter::checkTimeout after each iteration of the loop.
2270 2006-06-15 Timothy Hatcher <timothy@apple.com>
2272 Reviewed by Geoff and Darin.
2274 Prefer the DWARF debugging symbols format for use in Xcode 2.3.
2276 * JavaScriptCore.xcodeproj/project.pbxproj:
2278 2006-06-14 Geoffrey Garen <ggaren@apple.com>
2282 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=9438
2283 Someone broke ToT: cannot build
2285 * JavaScriptCore.xcodeproj/project.pbxproj:
2286 * bindings/runtime_root.h: Changed "Interpreter.h" to "interpreter.h"
2288 2006-06-12 Geoffrey Garen <ggaren@apple.com>
2292 * bindings/objc/WebScriptObject.mm:
2293 (+[WebScriptObject throwException:]): Restore assignment I accidentally
2294 deleted in previous commit
2296 2006-06-12 Geoffrey Garen <ggaren@apple.com>
2298 Reviewed by TimO, Maciej.
2300 - Merged InterpreterImp code into Interpreter, which implements
2301 all interpreter functionality now. This is part of my continuing quest
2302 to create an external notion of JS "execution context" that is unified and simple --
2303 something to replace the mix of Context, ContextImp, ExecState, Interpreter,
2304 InterpreterImp, and JSRun.
2306 All tests pass. Leaks test has not regressed from its baseline ~207 leaks
2307 with ~3460 leaked nodes.
2309 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2310 * JavaScriptCore.xcodeproj/project.pbxproj:
2311 * bindings/NP_jsobject.cpp:
2312 * bindings/objc/WebScriptObject.mm:
2313 (+[WebScriptObject throwException:]):
2314 * bindings/runtime_root.cpp:
2315 * bindings/runtime_root.h:
2317 (KJS::Context::Context):
2318 * kjs/ExecState.cpp: Added.
2319 (KJS::ExecState::lexicalInterpreter):
2320 * kjs/ExecState.h: Added.
2321 (KJS::ExecState::dynamicInterpreter):
2322 * kjs/SavedBuiltins.h: Added.
2323 * kjs/bool_object.cpp:
2324 (BooleanPrototype::BooleanPrototype):
2325 * kjs/collector.cpp:
2326 (KJS::Collector::collect):
2327 (KJS::Collector::numInterpreters):
2333 (KJS::FunctionImp::callAsFunction):
2334 (KJS::GlobalFuncImp::callAsFunction):
2335 * kjs/function_object.cpp:
2336 (FunctionObjectImp::construct):
2339 * kjs/interpreter.cpp:
2340 (KJS::interpreterMap):
2341 (KJS::Interpreter::Interpreter):
2342 (KJS::Interpreter::init):
2343 (KJS::Interpreter::~Interpreter):
2344 (KJS::Interpreter::globalObject):
2345 (KJS::Interpreter::initGlobalObject):
2346 (KJS::Interpreter::globalExec):
2347 (KJS::Interpreter::checkSyntax):
2348 (KJS::Interpreter::evaluate):
2349 (KJS::Interpreter::builtinObject):
2350 (KJS::Interpreter::builtinFunction):
2351 (KJS::Interpreter::builtinArray):
2352 (KJS::Interpreter::builtinBoolean):
2353 (KJS::Interpreter::builtinString):
2354 (KJS::Interpreter::builtinNumber):
2355 (KJS::Interpreter::builtinDate):
2356 (KJS::Interpreter::builtinRegExp):
2357 (KJS::Interpreter::builtinError):
2358 (KJS::Interpreter::builtinObjectPrototype):
2359 (KJS::Interpreter::builtinFunctionPrototype):
2360 (KJS::Interpreter::builtinArrayPrototype):
2361 (KJS::Interpreter::builtinBooleanPrototype):
2362 (KJS::Interpreter::builtinStringPrototype):
2363 (KJS::Interpreter::builtinNumberPrototype):
2364 (KJS::Interpreter::builtinDatePrototype):
2365 (KJS::Interpreter::builtinRegExpPrototype):
2366 (KJS::Interpreter::builtinErrorPrototype):
2367 (KJS::Interpreter::builtinEvalError):
2368 (KJS::Interpreter::builtinRangeError):
2369 (KJS::Interpreter::builtinReferenceError):
2370 (KJS::Interpreter::builtinSyntaxError):
2371 (KJS::Interpreter::builtinTypeError):
2372 (KJS::Interpreter::builtinURIError):
2373 (KJS::Interpreter::builtinEvalErrorPrototype):
2374 (KJS::Interpreter::builtinRangeErrorPrototype):
2375 (KJS::Interpreter::builtinReferenceErrorPrototype):
2376 (KJS::Interpreter::builtinSyntaxErrorPrototype):
2377 (KJS::Interpreter::builtinTypeErrorPrototype):
2378 (KJS::Interpreter::builtinURIErrorPrototype):
2379 (KJS::Interpreter::mark):
2380 (KJS::Interpreter::interpreterWithGlobalObject):
2381 (KJS::Interpreter::saveBuiltins):
2382 (KJS::Interpreter::restoreBuiltins):
2383 * kjs/interpreter.h:
2384 (KJS::Interpreter::setCompatMode):
2385 (KJS::Interpreter::compatMode):
2386 (KJS::Interpreter::firstInterpreter):
2387 (KJS::Interpreter::nextInterpreter):
2388 (KJS::Interpreter::prevInterpreter):
2389 (KJS::Interpreter::debugger):
2390 (KJS::Interpreter::setDebugger):
2391 (KJS::Interpreter::setContext):
2392 (KJS::Interpreter::context):
2394 (StatementNode::hitStatement):
2395 (RegExpNode::evaluate):
2398 2006-06-12 Geoffrey Garen <ggaren@apple.com>
2402 - Have *.lut.h files #include lookup.h to eliminate surprising header
2403 include order dependency.
2405 * DerivedSources.make:
2406 * kjs/array_object.cpp:
2407 * kjs/date_object.cpp:
2408 * kjs/date_object.h:
2409 (KJS::DateProtoFunc::):
2411 * kjs/math_object.cpp:
2412 * kjs/number_object.cpp:
2413 * kjs/regexp_object.cpp:
2414 * kjs/string_object.cpp:
2416 2006-06-10 Geoffrey Garen <ggaren@apple.com>
2418 - http://bugzilla.opendarwin.org/show_bug.cgi?id=8515
2419 Linux porting compile bug
2421 Fix by Mike Emmel, Reviewed by Darin.
2423 * JavaScriptCoreSources.bkl:
2427 2006-06-09 Geoffrey Garen <ggaren@apple.com>
2429 Build fix -- I think :).
2431 * JavaScriptCore.xcodeproj/project.pbxproj:
2434 2006-06-09 Geoffrey Garen <ggaren@apple.com>
2436 Reviewed by Eric (yay!).
2438 - Removed Context wrapper for ContextImp, renamed ContextImp to Context,
2439 split Context into its own file -- Context.cpp -- renamed _var to m_var,
2440 change ' *' to '* '.
2442 * JavaScriptCore.xcodeproj/project.pbxproj:
2443 * kjs/Context.cpp: Added.
2444 (KJS::Context::Context):
2445 (KJS::Context::~Context):
2446 (KJS::Context::mark):
2448 (KJS::Context::scopeChain):
2449 (KJS::Context::variableObject):
2450 (KJS::Context::setVariableObject):
2451 (KJS::Context::thisValue):
2452 (KJS::Context::callingContext):
2453 (KJS::Context::activationObject):
2454 (KJS::Context::currentBody):
2455 (KJS::Context::function):
2456 (KJS::Context::arguments):
2457 (KJS::Context::pushScope):
2458 (KJS::Context::seenLabels):
2460 (KJS::FunctionImp::callAsFunction):
2461 (KJS::FunctionImp::processParameters):
2462 (KJS::FunctionImp::argumentsGetter):
2463 (KJS::GlobalFuncImp::callAsFunction):
2465 (KJS::InterpreterImp::evaluate):
2467 (KJS::InterpreterImp::setContext):
2468 (KJS::InterpreterImp::context):
2469 * kjs/interpreter.cpp:
2470 * kjs/interpreter.h:
2471 (KJS::ExecState::context):
2472 (KJS::ExecState::ExecState):
2476 (ThisNode::evaluate):
2477 (ResolveNode::evaluate):
2478 (FunctionCallResolveNode::evaluate):
2479 (PostfixResolveNode::evaluate):
2480 (DeleteResolveNode::evaluate):
2481 (TypeOfResolveNode::evaluate):
2482 (PrefixResolveNode::evaluate):
2483 (AssignResolveNode::evaluate):
2484 (VarDeclNode::evaluate):
2485 (VarDeclNode::processVarDecls):
2486 (DoWhileNode::execute):
2487 (WhileNode::execute):
2489 (ForInNode::execute):
2490 (ContinueNode::execute):
2491 (BreakNode::execute):
2492 (ReturnNode::execute):
2493 (WithNode::execute):
2494 (SwitchNode::execute):
2495 (LabelNode::execute):
2497 (FuncDeclNode::processFuncDecl):
2498 (FuncExprNode::evaluate):
2500 2006-06-07 Geoffrey Garen <ggaren@apple.com>
2502 Removed API directory I prematurely/accidentally added.
2506 2006-06-05 Mitz Pettel <opendarwin.org@mitzpettel.com>
2508 Reviewed and landed by Geoff.
2510 - fix a regression in ecma_3/String/regress-104375.js
2512 * kjs/string_object.cpp:
2513 (substituteBackreferences): If a 2-digit back reference is out of range,
2514 parse it as a 1-digit reference (followed by the other digit). This matches
2517 2006-06-05 Geoffrey Garen <ggaren@apple.com>
2520 Darin already reviewed this change on the branch. See <rdar://problem/4317701>.
2522 - Fixed <rdar://problem/4291345> PCRE overflow in Safari JavaScriptCore
2524 No test case because there's no behavior change.
2526 * pcre/pcre_compile.c:
2527 (read_repeat_counts): Check for integer overflow / out of bounds
2529 2006-06-05 Geoffrey Garen <ggaren@apple.com>
2533 - Changed CString length from int to size_t. We sould probably do this
2534 for UString, too. (Darin, if you're reading this: Maciej said so.)
2539 (KJS::CString::CString):
2542 (KJS::CString::size):
2544 2006-06-04 Geoffrey Garen <ggaren@apple.com>
2548 - http://bugzilla.opendarwin.org/show_bug.cgi?id=9304
2549 Minor cleanup in JavaScriptCore
2551 * kjs/value.h: Removed redundant declarations
2553 2006-06-04 Darin Adler <darin@apple.com>
2557 - changed deleteAllValues so it can work on "const" collections
2558 Deleting the values affects the values, not the pointers in the
2559 collection, so it's legitimate to do it to a const collection,
2560 and a case of that actually came up in the XPath code.
2563 (WTF::deleteAllPairSeconds): Use const iterators.
2564 (WTF::deleteAllValues): Take const HashMap reference as a parameter.
2566 (WTF::deleteAllValues): Take const HashSet reference as a parameter,
2567 and use const iterators.
2569 (WTF::deleteAllValues): Take const Vector reference as a parameter.
2571 - added more functions that are present in <math.h> on some platforms,
2572 but not on others; moved here from various files in WebCore
2583 2006-06-02 Mitz Pettel <opendarwin.org@mitzpettel.com>
2587 - http://bugzilla.opendarwin.org/show_bug.cgi?id=9234
2588 Implement $&, $' and $` replacement codes in String.prototype.replace
2590 Test: fast/js/string-replace-3.html
2592 * kjs/string_object.cpp:
2593 (substituteBackreferences): Added support for $& (matched substring),
2594 $` (everything preceding matched substring), $' (everything following
2595 matched substring) and 2-digit back references, and cleaned up a little.
2597 2006-06-02 Adele Peterson <adele@apple.com>
2601 Set incremental linking to no. This seems to fix a build problem I was seeing
2602 where dftables couldn't find a dll.
2604 * JavaScriptCore.vcproj/dftables/dftables.vcproj:
2606 2006-05-26 Steve Falkenburg <sfalken@apple.com>
2610 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2612 === JavaScriptCore-521.11 ===
2614 2006-05-24 Geoffrey Garen <ggaren@apple.com>
2618 - JSC half of fix for <rdar://problem/4557926> TOT REGRESSSION: Crash
2619 occurs when attempting to view image in slideshow mode at
2620 http://d.smugmug.com/gallery/581716 ( KJS::IfNode::execute
2621 (KJS::ExecState*) + 312)
2623 On alternate threads, DOMObjects remain in the
2624 ScriptInterpreter's cache because they're not collected. So, they
2625 need an opportunity to mark their children.
2627 I'm not particularly happy with this solution because it fails to
2628 resolve many outstanding issues with the DOM object cache. Since none
2629 of those issues is a crasher or a serious compatibility concern,
2630 and since the behavior of other browsers is not much to go on in this
2631 case, I've filed <rdar://problem/4561439> about that, and I'm moving on
2634 * JavaScriptCore.xcodeproj/project.pbxproj:
2635 * kjs/collector.cpp:
2636 (KJS::Collector::collect):
2638 (KJS::InterpreterImp::mark):
2640 * kjs/interpreter.cpp:
2641 (KJS::Interpreter::mark):
2642 * kjs/interpreter.h:
2644 === JavaScriptCore-521.10 ===
2646 2006-05-22 Timothy Hatcher <timothy@apple.com>
2648 Reviewed by Eric, Kevin and Geoff.
2650 Merge open source build fixes. <rdar://problem/4555500>
2652 * kjs/collector.cpp: look at the rsp register in x86_64
2653 (KJS::Collector::markOtherThreadConservatively):
2654 * wtf/Platform.h: add x86_64 to the platform list
2656 2006-05-19 Anders Carlsson <acarlsson@apple.com>
2660 http://bugzilla.opendarwin.org/show_bug.cgi?id=8993
2661 Support function declaration in case statements
2663 * kjs/grammar.y: Get rid of StatementList and use SourceElements instead.
2666 (CaseClauseNode::evalStatements):
2667 (CaseClauseNode::processVarDecls):
2668 (CaseClauseNode::processFuncDecl):
2669 (ClauseListNode::processFuncDecl):
2670 (CaseBlockNode::processFuncDecl):
2671 (SwitchNode::processFuncDecl):
2673 (KJS::CaseClauseNode::CaseClauseNode):
2674 (KJS::ClauseListNode::ClauseListNode):
2675 (KJS::ClauseListNode::getClause):
2676 (KJS::ClauseListNode::getNext):
2677 (KJS::ClauseListNode::releaseNext):
2678 (KJS::SwitchNode::SwitchNode):
2679 Add processFuncDecl for the relevant nodes.
2681 * kjs/nodes2string.cpp:
2682 (CaseClauseNode::streamTo):
2683 next got renamed to source.
2685 2006-05-17 George Staikos <staikos@kde.org>
2687 Reviewed by Maciej, Alexey, and Eric.
2689 * pcre/pcre_compile.c:
2692 * wtf/UnusedParam.h:
2693 Use /**/ in .c files to compile with non-C99 and non-GCC compilers.
2696 Change include to <wtf/HashTraits.h> from "HashTraits.h" to avoid -I
2698 * wtf/unicode/qt4/UnicodeQt4.h:
2699 Use correct parentheses and correct mask for utf-32 support.
2701 2006-05-17 Alexey Proskuryakov <ap@nypop.com>
2705 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8870
2706 Crash typing in Yahoo auto-complete widget.
2708 Test: fast/js/regexp-stack-overflow.html
2710 * pcre/pcre-config.h: Define NO_RECURSE.
2712 2006-05-16 George Staikos <staikos@kde.org>
2716 Fix some warnings and strict compilation errors.
2721 2006-05-15 Alexey Proskuryakov <ap@nypop.com>
2723 * make-generated-sources.sh: Changed to be executable and removed
2724 text in the file generated by "svn diff".
2726 2006-05-15 Geoffrey Garen <ggaren@apple.com>
2730 - Fixed <rdar://problem/4534904> please do not treat "debugger" as
2731 a reserved word while parsing JavaScript (and other ECMA reserved
2736 http://bugzilla.opendarwin.org/show_bug.cgi?id=6179
2737 We treat "char" as a reserved word in JavaScript and firefox/IE do
2740 (1) I unreserved most of the spec's "future reserved words" because
2741 they're not reserved in IE or FF. (Most, but not all, because IE
2742 somewhat randomly *does* reserve a few of them.)
2743 (2) I made 'debugger' a legitimate statement that acts like an empty
2744 statement because FF and IE support it.
2747 * kjs/keywords.table:
2749 2006-05-15 Tim Omernick <timo@apple.com>
2751 Reviewed by John Sullivan.
2753 Part of <rdar://problem/4466508> Add 64-bit support to the Netscape Plugin API
2755 Added to the Netscape Plugin API the concept of "plugin drawing models". The drawing model
2756 determines the kind of graphics context created by the browser for the plugin, as well as
2757 the Mac types of various Netscape Plugin API data structures.
2759 There is a drawing model to represent the old QuickDraw-based API. It is used by default
2760 if QuickDraw is available on the system, unless the plugin specifies another drawing model.
2762 The big change is the addition of the CoreGraphics drawing model. A plugin may request this
2763 drawing model to obtain access to a CGContextRef for drawing, instead of a QuickDraw CGrafPtr.
2766 Define NP_NO_QUICKDRAW when compiling 64-bit; there is no 64-bit QuickDraw.
2767 Added NPNVpluginDrawingModel, NPNVsupportsQuickDrawBool, and NPNVsupportsCoreGraphicsBool
2769 Added NPDrawingModel enumeration. Currently the only drawing models are QuickDraw and
2771 NPRegion's type now depends on the drawing model specified by the plugin.
2772 NP_Port is now only defined when QuickDraw is available.
2773 Added NP_CGContext, which is the type of the NPWindow's "window" member in CoreGraphics mode.
2775 2006-05-13 Kevin M. Ollivier <kevino@theolliviers.com>
2777 Reviewed by Darin, landed by ap.
2779 - http://bugzilla.opendarwin.org/show_bug.cgi?id=8528
2780 Bakefiles (and generated Makefiles) for wx and gdk ports
2782 * make-generated-sources.sh:
2783 Added script to configure environment to run DerivedSources.make
2785 * JavaScriptCoreSources.bkl:
2786 Added JavaScriptCore sources list for Bakefile.
2789 Bakefile used to generate JavaScriptCore project files
2790 (currently only used by wx and gdk ports)
2792 2006-05-09 Steve Falkenburg <sfalken@apple.com>
2795 Minor fixes to WTF headers.
2799 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Fix include dirs, paths to files.
2800 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj: Fix include dirs.
2801 * wtf/Assertions.h: include Platform.h to get definition for COMPILER()
2802 * wtf/Vector.h: include FastMalloc.h for definition of fastMalloc, fastFree
2804 2006-05-09 Maciej Stachowiak <mjs@apple.com>
2806 Rubber stamped by Anders.
2808 - renamed kxmlcore to wtf
2814 * JavaScriptCore.xcodeproj/project.pbxproj:
2815 * bindings/c/c_instance.cpp:
2816 * bindings/objc/WebScriptObject.mm:
2817 * kjs/JSImmediate.h:
2820 * kjs/array_object.cpp:
2821 * kjs/collector.cpp:
2822 (KJS::Collector::registerThread):
2826 (KJS::isStrWhiteSpace):
2828 * kjs/identifier.cpp:
2833 (Lexer::isWhiteSpace):
2834 (Lexer::isIdentStart):
2835 (Lexer::isIdentPart):
2839 * kjs/number_object.cpp:
2841 * kjs/property_map.cpp:
2842 * kjs/property_map.h:
2843 * kjs/string_object.cpp:
2844 (StringProtoFunc::callAsFunction):
2849 * kxmlcore: Removed.
2850 * kxmlcore/AlwaysInline.h: Removed.
2851 * kxmlcore/Assertions.cpp: Removed.
2852 * kxmlcore/Assertions.h: Removed.
2853 * kxmlcore/FastMalloc.cpp: Removed.
2854 * kxmlcore/FastMalloc.h: Removed.
2855 * kxmlcore/FastMallocInternal.h: Removed.
2856 * kxmlcore/Forward.h: Removed.
2857 * kxmlcore/HashCountedSet.h: Removed.
2858 * kxmlcore/HashFunctions.h: Removed.
2859 * kxmlcore/HashMap.h: Removed.
2860 * kxmlcore/HashSet.h: Removed.
2861 * kxmlcore/HashTable.cpp: Removed.
2862 * kxmlcore/HashTable.h: Removed.
2863 * kxmlcore/HashTraits.h: Removed.
2864 * kxmlcore/ListRefPtr.h: Removed.
2865 * kxmlcore/Noncopyable.h: Removed.
2866 * kxmlcore/OwnArrayPtr.h: Removed.
2867 * kxmlcore/OwnPtr.h: Removed.
2868 * kxmlcore/PassRefPtr.h: Removed.
2869 * kxmlcore/Platform.h: Removed.
2870 * kxmlcore/RefPtr.h: Removed.
2871 * kxmlcore/TCPageMap.h: Removed.
2872 * kxmlcore/TCSpinLock.h: Removed.
2873 * kxmlcore/TCSystemAlloc.cpp: Removed.
2874 * kxmlcore/TCSystemAlloc.h: Removed.
2875 * kxmlcore/UnusedParam.h: Removed.
2876 * kxmlcore/Vector.h: Removed.
2877 * kxmlcore/VectorTraits.h: Removed.
2878 * kxmlcore/unicode: Removed.
2879 * kxmlcore/unicode/Unicode.h: Removed.
2880 * kxmlcore/unicode/UnicodeCategory.h: Removed.
2881 * kxmlcore/unicode/icu: Removed.
2882 * kxmlcore/unicode/icu/UnicodeIcu.h: Removed.
2883 * kxmlcore/unicode/posix: Removed.
2884 * kxmlcore/unicode/qt3: Removed.
2885 * kxmlcore/unicode/qt4: Removed.
2886 * kxmlcore/unicode/qt4/UnicodeQt4.h: Removed.
2889 * wtf/Assertions.cpp:
2891 * wtf/FastMalloc.cpp:
2892 (WTF::TCMalloc_ThreadCache::Scavenge):
2895 (WTF::TCMallocGuard::TCMallocGuard):
2902 * wtf/FastMallocInternal.h:
2904 * wtf/HashCountedSet.h:
2905 * wtf/HashFunctions.h:
2908 * wtf/HashTable.cpp:
2912 * wtf/Noncopyable.h:
2913 * wtf/OwnArrayPtr.h:
2917 * wtf/TCSystemAlloc.cpp:
2918 (TCMalloc_SystemAlloc):
2920 * wtf/VectorTraits.h:
2921 * wtf/unicode/UnicodeCategory.h:
2922 * wtf/unicode/icu/UnicodeIcu.h:
2924 2006-05-08 Timothy Hatcher <timothy@apple.com>
2928 * bindings/npapi.h: do not define #pragma options align=mac68k if we are 64-bit
2930 2006-05-07 Darin Adler <darin@apple.com>
2932 Reviewed and landed by Maciej.
2934 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8765
2935 Random crashes on TOT since the form state change
2937 I haven't figured out how to construct a test for this, but this does seem to fix the
2938 problem; Mitz mentioned that a double-destroy was occurring in these functions.
2940 * kxmlcore/HashMap.h: (KXMLCore::HashMap::remove): Use RefCounter::deref instead of calling
2941 ~ValueType, because ~ValueType often results in a double-destroy, since the HashTable also
2942 destroys the element based on the storage type. The RefCounter template correctly does work
2943 only in cases where ValueType and ValueStorageType differ and this class is what's used
2944 elsewhere for the same purpose; I somehow missed this case when optimizing HashMap.
2945 * kxmlcore/HashSet.h: (KXMLCore::HashSet::remove): Ditto.
2947 2006-05-05 Darin Adler <darin@apple.com>
2949 - http://bugzilla.opendarwin.org/show_bug.cgi?id=8722
2950 IE compatibility fix in date parsing
2952 * kjs/date_object.cpp: (KJS::parseDate): Merged change that George Staikos provided
2953 from KDE 3.4.3 branch that allows day values of 0 and values that are > 1000.
2955 2006-05-04 Anders Carlsson <andersca@mac.com>
2959 http://bugzilla.opendarwin.org/show_bug.cgi?id=8734
2960 Would like a Vector::append that takes another Vector
2962 * kxmlcore/Vector.h:
2963 (KXMLCore::::append):
2964 New function that takes another array.
2966 2006-05-02 Steve Falkenburg <sfalken@apple.com>
2970 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: set NDEBUG for release build
2971 * kxmlcore/FastMalloc.cpp: Prevent USE_SYSTEM_MALLOC from being defined twice
2973 2006-05-02 Anders Carlsson <andersca@mac.com>
2977 * kxmlcore/HashMap.h:
2978 (KXMLCore::::operator):
2981 2006-05-01 Tim Omernick <timo@apple.com>
2983 Reviewed by Tim Hatcher.
2985 <rdar://problem/4476875> Support printing for embedded Netscape plugins
2988 Fixed struct alignment problem in our npapi.h. Structs must be 68k-aligned on both pre-Mac OS X
2989 and Mac OS X systems, as this is what plugins expect.
2991 2006-05-01 Timothy Hatcher <timothy@apple.com>
2995 <rdar://problem/4308243> 8F36 Regression: crash in malloc_consolidate if you use a .PAC file
2997 The original fix missed the oversized cell case. Added a test for "currentThreadIsMainThread ||
2998 imp->m_destructorIsThreadSafe" where we collect oversized cells.
3000 We don't have a way to test PAC files yet, so there's no test attached.
3002 * kjs/collector.cpp:
3003 (KJS::Collector::collect): test the thread when we collect oversized cells
3005 2006-05-01 Tim Omernick <timo@apple.com>
3009 <rdar://problem/4526114> REGRESSION (two days ago): LOG() just prints @ for NSObject substitutions
3011 * kxmlcore/Assertions.cpp:
3012 Changed sense of strstr("%@") check. I already made the same fix to the WebBrowser assertions.
3014 2006-04-28 Steve Falkenburg <sfalken@apple.com>
3018 Actually apply the change that was reviewed insted of checking it in with an #if 0 (oops).
3021 (main): Suppress C runtime alerts
3023 2006-04-28 Steve Falkenburg <sfalken@apple.com>
3027 Suppress error reporting dialog that blocks Javascript tests from completing.
3029 Real error is due to an overflow in the date/time handling functions that needs
3030 to be addressed, but this will prevent the hang running the Javascript tests
3031 on the build bot (along with the related changes).
3034 (main): Suppress C runtime alerts
3036 2006-04-27 Geoffrey Garen <ggaren@apple.com>
3040 - Minor fixups I discovered while working on the autogenerator.
3043 (findEntry): ASSERT that size is not 0, because otherwise we'll % by 0,
3044 compute a garbage address, and possibly crash.
3046 (cacheGlobalObject): Don't enumerate cached objects -- ideally, they
3047 would be hidden entirely.
3049 2006-04-21 Kevin M. Ollivier <kevino@theolliviers.com>
3053 - http://bugzilla.opendarwin.org/show_bug.cgi?id=8507
3054 Compilation fixes for building on gcc 4.0.2, and without precomp headers
3057 * kxmlcore/Assertions.cpp:
3058 * kxmlcore/FastMalloc.cpp:
3059 Added necessary headers to resolve compilation issues when not using
3060 precompiled headers.
3062 * kjs/value.h: Declare the JSCell class before friend declaration
3063 to resolve compilation issues with gcc 4.0.2.
3065 * kxmlcore/Platform.h: Set Unicode support to use ICU on platforms
3066 other than KDE (previously only defined for Win and Mac OS)
3068 2006-04-18 Eric Seidel <eseidel@apple.com>
3072 Fix "new Function()" to correctly use lexical scoping.
3073 Add ScopeChain::print() function for debugging.
3074 <rdar://problem/4067864> REGRESSION (125-407): JavaScript failure on PeopleSoft REN Server
3076 * kjs/function_object.cpp:
3077 (FunctionObjectImp::construct):
3078 * kjs/scope_chain.cpp:
3079 (KJS::ScopeChain::print):
3080 * kjs/scope_chain.h:
3082 2006-04-14 James G. Speth <speth@end.com>
3084 Reviewed by Timothy.
3086 Bug 8389: support for Cocoa bindings - binding an NSTreeController to the WebView's DOM
3087 http://bugzilla.opendarwin.org/show_bug.cgi?id=8389
3089 Adds a category to WebScriptObject with array accessors for KVC/KVO.
3091 If super valueForKey: fails it will call valueForUndefinedKey:, which is
3092 important because it causes the right behavior to happen with bindings using
3093 the "Raises for Not Applicable Keys" flag and the "Not Applicable Placeholder"
3095 * bindings/objc/WebScriptObject.mm:
3096 (-[WebScriptObject valueForKey:]):
3097 (-[WebScriptObject count]):
3098 (-[WebScriptObject objectAtIndex:]):
3099 (-[WebUndefined description]): return "undefined"
3101 2006-04-13 Geoffrey Garen <ggaren@apple.com>
3106 (KJS::InterpreterImp::initGlobalObject): Add the built-in object
3107 prototype to the end of the global object's prototype chain instead of
3108 just blowing away its existing prototype. We need to do this because
3109 the window object has a meaningful prototype now.
3111 2006-04-13 Maciej Stachowiak <mjs@apple.com>
3115 - fix testkjs to not show false-positive KJS::Node leaks in debug builds
3121 2006-04-11 Geoffrey Garen <ggaren@apple.com>
3125 Minor code cleanup -- passes all the JS tests.
3127 * kjs/object_object.cpp:
3128 (ObjectObjectImp::construct):
3129 (ObjectObjectImp::callAsFunction):
3131 2006-04-11 Darin Adler <darin@apple.com>
3133 - another attempt to fix Windows build -- Vector in Forward.h was not working
3135 * kxmlcore/Forward.h: Remove Vector.
3136 * kxmlcore/Vector.h: Add back default arguments, remove include of
3139 2006-04-11 Darin Adler <darin@apple.com>
3141 - try to fix Windows build -- HashForward.h was not working
3143 * kxmlcore/HashForward.h: Removed.
3145 * JavaScriptCore.xcodeproj/project.pbxproj: Remove HashForward.h.
3146 * kjs/collector.h: Remove use of HashForward.h.
3147 * kxmlcore/HashCountedSet.h: Remove include of HashForward.h, restore
3149 * kxmlcore/HashMap.h: Ditto.
3150 * kxmlcore/HashSet.h: Ditto.
3152 2006-04-11 David Harrison <harrison@apple.com>
3156 - fixed clean build, broken by Darin's check-in
3158 * kjs/date_object.cpp: Add needed include of lookup.h.
3159 * kjs/regexp_object.cpp: Move include of .lut.h file below other includes.
3161 2006-04-10 Darin Adler <darin@apple.com>
3163 Rubber-stamped by John Sullivan.
3165 - switched from a shell script to a makefile for generated files
3166 - removed lots of unneeded includes
3167 - added new Forward.h and HashForward.h headers that allow compiling with
3168 fewer unneeded templates
3170 * DerivedSources.make: Added.
3171 * generate-derived-sources: Removed.
3172 * JavaScriptCore.xcodeproj/project.pbxproj: Added new files, changed to use
3173 DerivedSources.make.
3175 * kxmlcore/Forward.h: Added.
3176 * kxmlcore/HashForward.h: Added.
3178 * kxmlcore/HashCountedSet.h: Include HashForward for default args.
3179 * kxmlcore/HashMap.h: Ditto.
3180 * kxmlcore/HashSet.h: Ditto.
3184 Moved KJS_MAX_STACK into the .cpp file.
3186 * bindings/NP_jsobject.cpp:
3187 * bindings/c/c_instance.h:
3188 * bindings/jni/jni_class.h:
3189 * bindings/jni/jni_runtime.h:
3190 * bindings/jni/jni_utility.h:
3191 * bindings/objc/WebScriptObject.mm:
3192 * bindings/objc/WebScriptObjectPrivate.h:
3193 * bindings/objc/objc_class.h:
3194 * bindings/objc/objc_class.mm:
3195 * bindings/objc/objc_instance.h:
3196 * bindings/objc/objc_instance.mm:
3197 * bindings/objc/objc_runtime.mm:
3198 * bindings/objc/objc_utility.mm:
3199 * bindings/runtime.h:
3200 * bindings/runtime_array.cpp:
3201 * bindings/runtime_array.h:
3202 * bindings/runtime_method.cpp:
3203 * bindings/runtime_method.h:
3204 * bindings/runtime_object.cpp:
3205 * bindings/runtime_root.h:
3206 * kjs/JSImmediate.cpp:
3208 * kjs/array_object.cpp:
3209 * kjs/array_object.h:
3210 * kjs/bool_object.cpp:
3211 * kjs/bool_object.h:
3215 * kjs/error_object.h:
3216 * kjs/function_object.h:
3219 * kjs/math_object.cpp:
3220 * kjs/math_object.h:
3223 * kjs/number_object.cpp:
3224 * kjs/number_object.h:
3225 * kjs/object_object.cpp:
3226 * kjs/operations.cpp:
3227 * kjs/protected_reference.h:
3229 * kjs/reference_list.h:
3230 * kjs/regexp_object.h:
3231 * kjs/string_object.cpp:
3232 * kjs/string_object.h:
3236 * kxmlcore/HashTable.h:
3237 * kxmlcore/ListRefPtr.h:
3238 * kxmlcore/TCPageMap.h:
3239 * kxmlcore/Vector.h:
3240 Removed unneeded header includes.
3242 2006-04-09 Geoffrey Garen <ggaren@apple.com>
3246 - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=8284
3247 prevent unnecessary entries in the "nodes with extra refs" hash table
3249 This patch switches manually RefPtr exchange with use of
3250 RefPtr::release to ensure that a node's ref count never tops 1
3251 (in the normal case).
3254 (BlockNode::BlockNode):
3255 (CaseBlockNode::CaseBlockNode):
3257 (KJS::ArrayNode::ArrayNode):
3258 (KJS::ObjectLiteralNode::ObjectLiteralNode):
3259 (KJS::ArgumentsNode::ArgumentsNode):
3260 (KJS::VarStatementNode::VarStatementNode):
3261 (KJS::ForNode::ForNode):
3262 (KJS::CaseClauseNode::CaseClauseNode):
3263 (KJS::FuncExprNode::FuncExprNode):
3264 (KJS::FuncDeclNode::FuncDeclNode):
3266 2006-04-08 Alexey Proskuryakov <ap@nypop.com>
3270 One more attempt - use reinterpret_cast, rather than static_cast.
3272 2006-04-08 Alexey Proskuryakov <ap@nypop.com>
3276 An attempt to fix Win32 build - ICU uses wchar_t on Windows, so we need a type cast.
3278 * kxmlcore/unicode/icu/UnicodeIcu.h:
3279 (KXMLCore::Unicode::toLower):
3280 (KXMLCore::Unicode::toUpper):
3282 2006-04-08 Alexey Proskuryakov <ap@nypop.com>
3286 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8264
3287 toLowerCase and toUpperCase don't honor special mappings
3289 Test: fast/js/string-capitalization.html
3291 * JavaScriptCore.xcodeproj/project.pbxproj: Added KXMLCore::Unicode headers to the project.
3292 * icu/unicode/putil.h: Added (copied from WebCore).
3293 * icu/unicode/uiter.h: Ditto.
3294 * icu/unicode/ustring.h: Ditto.
3295 * kjs/string_object.cpp:
3296 (StringProtoFunc::callAsFunction): Use the new KXMLCore::Unicode::toUpper() and toLower().
3297 * kjs/ustring.cpp: Removed unused (and evil) UChar::toLower() and toUpper().
3298 * kjs/ustring.h: Ditto.
3300 * kxmlcore/unicode/Unicode.h: Corrected capitalization of the word Unicode.
3301 * kxmlcore/unicode/UnicodeCategory.h: Renamed include guard macro to match file name.
3303 * kxmlcore/unicode/icu/UnicodeIcu.h:
3304 (KXMLCore::Unicode::toLower): Work on strings, not individual characters. Use ICU root locale.
3305 (KXMLCore::Unicode::toUpper): Ditto.
3306 (KXMLCore::Unicode::isFormatChar): Use int32_t, which can hold a complete code point.
3307 (KXMLCore::Unicode::isSeparatorSpace): Ditto.
3308 (KXMLCore::Unicode::category): Ditto.
3309 * kxmlcore/unicode/qt4/UnicodeQt4.h:
3310 (KXMLCore::Unicode::toLower): Work on strings, not individual characters.
3311 (KXMLCore::Unicode::toUpper): Ditto.
3312 (KXMLCore::Unicode::isFormatChar): Use int32_t, which can hold a complete code point.
3313 (KXMLCore::Unicode::isSeparatorSpace): Ditto.
3314 (KXMLCore::Unicode::category): Ditto.
3316 * tests/mozilla/ecma/String/15.5.4.12-1.js: Corrected expected results.
3317 * tests/mozilla/ecma/String/15.5.4.12-5.js: Corrected expected results.
3319 2006-04-05 Darin Adler <darin@apple.com>
3321 - attempt to fix Windows build
3323 * kxmlcore/HashMap.h: (KXMLCore::HashMap::remove): Use (*it). instead of it->.
3324 * kxmlcore/HashSet.h: (KXMLCore::HashSet::remove): Ditto.
3326 2006-04-05 Darin Adler <darin@apple.com>
3328 - attempt to fix Windows build
3330 * os-win32/stdint.h: Add int8_t, uint8_t, int64_t.
3332 2006-04-05 Darin Adler <darin@apple.com>
3336 - fix memory leak introduced by the previous change
3338 * kxmlcore/HashTable.h: Specialize NeedsRef so that it correctly returns true when
3339 the value in question is a pair where one of the pair needs a ref and the other
3340 of the pair does not.
3342 2006-04-05 Darin Adler <darin@apple.com>
3346 - JavaScriptCore part of fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=8049
3347 StringImpl hash traits deleted value creates an init routine for WebCore
3348 <rdar://problem/4442248> REGRESSION: WebCore has init routines (8049)
3350 Change HashMap and HashSet implementation so they fold various types together.
3351 This allows us to implement maps and sets that use RefPtr<WebCore::StringImpl>
3352 and WebCore::String in terms of the underlying raw pointer type, and hence use
3353 -1 for the deleted value.
3355 * kxmlcore/HashTraits.h: Added a new type to HashTraits, StorageTraits, which is a
3356 type to be used when storing a value that has the same layout as the type itself.
3357 This is used only for non-key cases. In the case of keys, the hash function must also
3358 be considered. Moved emptyValue out of GenericHashTraitsBase into GenericHashTraits.
3359 Added a new bool to HashTraits, needsRef, which indicates whether the type needs
3360 explicit reference counting. If the type itself has needsRef true, but the storage
3361 type has needsRef false, then the HashSet or HashMap has to handle the reference
3362 counting explicitly. Added hash trait specializations for all signed integer values
3363 that give -1 as the deleted value. Gave all integers StorageTraits of the canonical
3364 integer type of the same size so int and long will share code. Gave all pointers and
3365 RefPtrs StorageTraits of the appropriately sized integer type. Removed redundant
3366 TraitType and emptyValue definitions in the pointer specialization for HashTraits.
3367 Added PairBaseHashTraits, which doesn't try to set up needsDestruction and deletedValue.
3368 Useful for types where we don't want to force the existence of deletedValue, such as
3369 the type of a pair in a HashMap which is not the actual storage type. Removed an
3370 unneeded parameter from the DeletedValueAssigner template. Added HashKeyStorageTraits
3371 template, which determines what type can be used to store a given hash key type with
3372 a given hash function, and specialized it for pointers and RefPtr so that pointer
3373 hash tables share an underlying HashTable that uses IntHash.
3375 * kxmlcore/HashTable.h: Added HashTableConstIteratorAdapter, HashTableIteratorAdapter,
3376 NeedsRef, RefCountManagerBase, RefCountManager, HashTableRefCountManagerBase, and
3377 HashTableRefCountManager. All are used by both HashSet and HashMap to handle hash
3378 tables where the type stored is not the same as the real value type.
3380 * kxmlcore/HashFunctions.h: Added a new struct named IntTypes that finds an
3381 integer type given a sizeof value. Renamed pointerHash to intHash and made it
3382 use overloading and take integer parameters. Added an IntHash struct which is
3383 a hash function that works for integers. Changed PtrHash to call IntHash with
3384 an appropriately sized integer. Made IntHash the default hash function for
3385 many integer types. Made PtrHash the default hash function for RefPtr as well
3386 as for raw pointers.
3388 * kxmlcore/HashSet.h: Changed implementation to use a separate "storage type"
3389 derived from the new traits. The HashTable will use the storage type and all
3390 necessary translation and ref/deref is done at the HashSet level. Also reorganized
3391 the file so that the HashSet is at the top and has no inline implementation inside
3392 it so it's easy to read the interface to HashSet.
3394 * kxmlcore/HashMap.h: Changed implementation to use a separate "storage type"
3395 derived from the new traits. The HashTable will use the storage type and all
3396 necessary translation and ref/deref is done at the HashMap level. Also reorganized
3397 the file so that the HashMap is at the top and has no inline implementation inside
3398 it so it's easy to read the interface to HashMap.
3400 * kxmlcore/HashMapPtrSpec.h: Removed. Superceded by optimizations in HashMap itself.
3402 * JavaScriptCore.xcodeproj/project.pbxproj: Remove HashMapPtrSpec.h, resort files,
3403 and also remove some unnecessary build settings from the aggregate target that
3404 generates derived sources.
3405 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Ditto.
3407 2006-04-04 Timothy Hatcher <timothy@apple.com>
3411 The Debug and Release frameworks are now built with install paths relative to the build products directory.
3412 This removes the need for other projects to build with -framework WebCore and -framework JavaScriptCore.
3414 * JavaScriptCore.xcodeproj/project.pbxproj:
3416 2006-04-04 Eric Seidel <eseidel@apple.com>
3421 Disable ASSERT redefinition warnings for now.
3423 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
3424 * kxmlcore/Assertions.h:
3426 2006-04-04 Bjrn Graf <bjoern.graf@gmail.com>
3428 Reviewed by ggaren & darin. Landed by eseidel.
3430 Integrate CURL version of gettimeofday
3431 http://bugzilla.opendarwin.org/show_bug.cgi?id=7399
3432 Disable crash report dialogs for testkjs.exe in Release mode
3433 http://bugzilla.opendarwin.org/show_bug.cgi?id=8113
3438 (StopWatch::getElapsedMS):
3442 2006-04-04 Eric Seidel <eseidel@apple.com>
3446 * kjs/number_object.cpp:
3447 (NumberProtoFunc::callAsFunction): remove trunc() to fix win32.
3449 2006-03-12 Maciej Stachowiak <mjs@apple.com>
3453 - fixed "toPrecision sometimes messes up the last digit on intel Macs"
3454 http://bugzilla.opendarwin.org/show_bug.cgi?id=7748
3456 * kjs/number_object.cpp:
3457 (intPow10): Compute integer powers of 10 using exponentiation by squaring.
3458 (NumberProtoFunc::callAsFunction): Use intPow10(n) in place of all pow(10.0, n),
3459 plus a bit of refactoring.
3461 2006-04-03 Darin Adler <darin@apple.com>
3463 - tweak config.h and Platform.h to try to get buildbot working
3464 (making some small changes at the same time)
3466 * kjs/config.h: Removed now-unneeded HAVE_ICU.
3467 * kxmlcore/Platform.h: Tweak how platform gets set up. Move all the
3468 USE stuff to the end.
3470 2006-04-03 George Staikos <staikos@opensource.apple.com>
3474 Fix Win32 build breakage from previous commit, remove unused forward.
3476 2006-04-03 George Staikos <staikos@opensource.apple.com>
3480 Implement a unicode abstraction layer to make JavaScriptCore much more
3481 easily ported to other platforms without having to take in libicu. Also
3482 makes the unicode related code easier to understand.
3484 2006-04-03 Timothy Hatcher <timothy@apple.com>
3488 Fixes <rdar://problem/4498338> JavaScriptCore fails to compile for ppc64
3489 Other 64 bit build fixes.
3491 * kjs/collector.cpp:
3492 (KJS::Collector::markOtherThreadConservatively): test for __DARWIN_UNIX03 and use __r1
3494 (Bigint::): cast PRIVATE_mem to unsigned to prevent warning
3495 * bindings/jni/jni_utility.cpp:
3496 (KJS::Bindings::getJavaVM): cast jniError to long to prevent format warning
3497 (KJS::Bindings::getJNIEnv): cast jniError to long to prevent format warning
3498 * bindings/runtime_root.cpp:
3499 (KJS::Bindings::addNativeReference): cast CFDictionaryGetValue to unsigned long to prevent warning
3500 (KJS::Bindings::removeNativeReference): cast CFDictionaryGetValue to unsigned long to prevent warning
3502 2006-03-31 Darin Adler <darin@apple.com>
3506 - <rdar://problem/4395622> API: WebScriptObject.h incorrectly reports that -isSelectorExcludedFromWebScript returns NO by default
3508 * bindings/objc/WebScriptObject.h: Fixed comment.
3510 2006-03-31 Eric Seidel <eseidel@apple.com>
3514 A bit more code cleanup.
3516 * bindings/c/c_utility.cpp:
3517 (KJS::Bindings::convertValueToNPVariant):
3518 * bindings/objc/objc_runtime.mm:
3519 (convertValueToObjcObject):
3520 * bindings/objc/objc_utility.mm:
3521 (KJS::Bindings::convertValueToObjcValue):
3523 (KJS::GlobalFuncImp::callAsFunction):
3524 * kjs/interpreter.cpp:
3525 (KJS::ExecState::lexicalInterpreter):
3526 * kjs/interpreter.h:
3527 * kjs/operations.cpp:
3530 2006-03-30 Eric Seidel <eseidel@apple.com>
3534 Small code-style update.
3536 * kjs/operations.cpp:
3549 2006-03-31 Anders Carlsson <andersca@mac.com>
3553 Make sure the GetterSetterImp objects are marked as well.
3556 (KJS::GetterSetterImp::mark):
3557 Call JSCell::mark().
3559 2006-03-30 Eric Seidel <eseidel@apple.com>
3563 * kjs/nodes.h: Some various small style fixes.
3565 2006-03-30 Eric Seidel <eseidel@apple.com>
3569 Clean-up style issues in node.h, remove redundant initializations.
3572 (KJS::StatementNode::evaluate):
3573 (KJS::ArrayNode::ArrayNode):
3574 (KJS::ObjectLiteralNode::ObjectLiteralNode):
3575 (KJS::ArgumentsNode::ArgumentsNode):
3576 (KJS::NewExprNode::NewExprNode):
3577 (KJS::CaseClauseNode::CaseClauseNode):
3578 (KJS::FuncDeclNode::FuncDeclNode):
3580 2006-03-30 Tim Omernick <timo@apple.com>
3584 <rdar://problem/4212626> REGRESSION: LIVECONNECT: JavaScript type for Java Strings is function,
3587 * bindings/runtime.h:
3588 (KJS::Bindings::Instance::implementsCall):
3589 New method. Returns false by default. Concrete subclasses can override this return true when
3590 the bound object may be called as a function.
3591 (KJS::Bindings::Instance::invokeDefaultMethod):
3592 Since bound objects are no longer treated as functions by default, we can return jsUndefined()
3593 here instead of in concrete subclasses that decide not to implement the default method
3596 * bindings/runtime_object.cpp:
3597 (RuntimeObjectImp::implementsCall):
3598 Don't assume that the bound object is a function; instead, let the object instance decide whether
3601 * bindings/c/c_instance.h:
3602 * bindings/c/c_instance.cpp:
3603 (KJS::Bindings::CInstance::implementsCall):
3604 The object is callable if its class has an invokeDefault function.
3606 * bindings/objc/objc_instance.h:
3607 * bindings/objc/objc_instance.mm:
3608 (ObjcInstance::implementsCall):
3609 The object is callable if the ObjC instance responds to -invokeDefaultMethodWithArguments:.
3611 * bindings/jni/jni_instance.h:
3612 * bindings/jni/jni_instance.cpp:
3613 Moved bogus invokeDefaultMethod() to superclass.
3615 2006-03-29 Geoffrey Garen <ggaren@apple.com>
3619 - JavaScriptCore side of fix for <rdar://problem/4308243> 8F36
3620 Regression: crash in malloc_consolidate if you use a .PAC file
3622 The crash was a result of threaded deallocation of thread-unsafe
3623 objects. Pure JS objects are thread-safe because all JS execution
3624 is synchronized through JSLock. However, JS objects that wrap WebCore
3625 objects are thread-unsafe because JS and WebCore execution are not
3626 synchronized. That unsafety comes into play when the collector
3627 deallocates a JS object that wraps a WebCore object, thus causing the
3628 WebCore object to be deallocated.
3630 The solution here is to have each JSCell know whether it is safe to
3631 collect on a non-main thread, and to avoid collecting unsafe cells
3632 when on a non-main thread.
3634 We don't have a way to test PAC files yet, so there's no test
3635 attached to this patch.
3637 * kjs/collector.cpp:
3638 (KJS::Collector::collect):
3639 (1) Added the test "currentThreadIsMainThread ||
3640 imp->m_destructorIsThreadSafe".
3643 (KJS::gcProtectNullTolerant):
3644 (KJS::gcUnprotectNullTolerant):
3646 (KJS::JSCell::JSCell): The bools here must be bitfields, otherwise
3647 m_destructorIsThreadSafe becomes another whole word, ruining the
3648 collector optimizations we've made based on the size of a JSObject.
3649 * kxmlcore/FastMalloc.cpp:
3650 (KXMLCore::currentThreadIsMainThread):
3651 (KXMLCore::fastMallocRegisterThread):
3652 * kxmlcore/FastMalloc.h:
3654 2006-03-28 Darin Adler <darin@apple.com>
3658 - change some code that resulted in init routines on Mac OS X -- if the framework has
3659 init routines it will use memory and slow down applications that link with WebKit
3660 even in cases where those applications don't use WebKit
3662 * kjs/date_object.cpp: Changed constants that were derived by multiplying other constants
3663 to use immediate numbers instead. Apparently, double constant expressions of the type we
3664 had here are evaluated at load time.
3666 * kjs/list.cpp: Can't use OwnArrayPtr in ListImp because of the global instances of
3667 ListImp, so go back to using a plain old pointer.
3668 (KJS::List::List): Set overflow to 0 when initializing ListImp.
3669 (KJS::List::release): Replace a clear call with a delete and explicit set to 0.
3670 (KJS::List::append): Use raw pointers, and do a delete [] instead of finessing it with
3671 a swap of OwnArrayPtr.
3672 (KJS::List::copyFrom): Remove now-unneeded get().
3673 (KJS::List::copyTail): Ditto.
3675 * kjs/ustring.cpp: Changed UString::Rep::empty initializer a bit so that it doesn't get
3676 a static initializer routine. Had to get rid of one level of constant to get the compiler
3677 to understand it could initialize without any code.
3679 - added a build step that checks for init routines
3681 * JavaScriptCore.xcodeproj/project.pbxproj: Deleted now-unused custom build rule that
3682 was replaced by the generate-derived-sources script a while back. Added a custom build
3683 phase that invokes the check-for-global-initializers script.
3685 2006-03-28 Timothy Hatcher <timothy@apple.com>
3689 fixes <rdar://problem/4458539> Unable to include Security(public) and WebKit(private) headers
3691 * bindings/npapi.h: added #defines after the #ifndefs
3693 2006-03-27 Maciej Stachowiak <mjs@apple.com>
3697 - fixed <rdar://problem/4489745> REGRESSION: Safari crashes at to display http://www.lgphilips-lcd.com/
3700 (Node::deref): take into account the case where the extra refcount table was never created
3702 2006-03-23 David Carson <dacarson@gmail.com>
3706 - JSObject in LiveConnect not working.
3707 http://bugzilla.opendarwin.org/show_bug.cgi?id=7917
3709 * bindings/jni_jsobject.cpp:
3710 (JavaJSObject::convertJObjectToValue): Was trying to retrieve the native pointer from the wrong base
3711 class, and the GetFieldID was using the wrong signature.
3713 2006-03-23 Darin Adler <darin@apple.com>
3719 * JavaScriptCore.xcodeproj/project.pbxproj: Change target name to JavaScriptCore (it was "include"!?).
3720 Also add -Y 3 option for linker.
3722 2006-03-23 Darin Adler <darin@apple.com>
3726 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7726
3727 REGRESSION: orbitz calendar fails (JavaScript function serialization/parsing)
3729 * kjs/object.h: Take function name, as well as source URL and line number, when
3730 using the special overloaded construct for making functions.
3731 * kjs/object.cpp: (KJS::JSObject::construct): Ditto.
3732 * kjs/function_object.h: Ditto.
3733 * kjs/function_object.cpp: (FunctionObjectImp::construct): Pass a name when
3734 constructing the function rather than null. Use "anonymous" when making a
3735 function using the default function constructor.
3737 * kjs/nodes2string.cpp: (FuncDeclNode::streamTo): Put a line break just before
3738 a function declaration.
3742 * kxmlcore/HashMapPtrSpec.h: Add missing needed friend declaration.
3744 2006-03-23 Darin Adler <darin@apple.com>
3748 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7805
3749 LEAK: method name leaks in KJS::Bindings::CInstance::invokeMethod
3751 * bindings/c/c_utility.h: Remove NPN_UTF16FromString declaration (not implemented).
3752 * bindings/c/c_utility.cpp:
3753 (KJS::Bindings::convertValueToNPVariant): Use DOUBLE_TO_NPVARIANT,
3754 BOOLEAN_TO_NPVARIANT, VOID_TO_NPVARIANT, NULL_TO_NPVARIANT, and
3755 OBJECT_TO_NPVARIANT. In the case of OBJECT, call _NPN_RetainObject in
3756 one case and remove a _NPN_ReleaseObject in another because this
3757 should return a retained value.
3758 (KJS::Bindings::convertNPVariantToValue): Use NPVARIANT_TO_BOOLEAN,
3759 NPVARIANT_TO_INT32, and NPVARIANT_TO_DOUBLE.
3761 * bindings/c/c_runtime.h: Removed implementations of CMethod::name and
3762 CField::name that called _NPN_UTF8FromIdentifier and hence leaked.
3763 * bindings/c/c_runtime.cpp:
3764 (KJS::Bindings::CMethod::name): Added. Returns the string from inside the
3766 (KJS::Bindings::CField::name): Added. Returns the string from inside the
3768 (KJS::Bindings::CField::valueFromInstance): Added call to _NPN_ReleaseVariantValue
3769 on the result of getProperty after using it to fix a storage leak.
3770 (KJS::Bindings::CField::setValueToInstance): Added call to _NPN_ReleaseVariantValue
3771 after pasing a value to setProperty now that the conversion function does a retain.
3773 * bindings/c/c_instance.cpp:
3774 (KJS::Bindings::CInstance::invokeMethod): Changed to use Vector for a local
3775 stack buffer. Removed special case for NPVARIANT_IS_VOID because the
3776 convertNPVariantToValue function handles that properly.
3777 (KJS::Bindings::CInstance::invokeDefaultMethod): Ditto.
3779 * bindings/NP_jsobject.h: Formatting changes only.
3780 * bindings/NP_jsobject.cpp:
3781 (jsDeallocate): Changed parameter type so we don't need a function cast.
3782 (_NPN_InvokeDefault): Use VOID_TO_NPVARIANT.
3783 (_NPN_Invoke): Use NULL_TO_NPVARIANT and VOID_TO_NPVARIANT.
3784 (_NPN_Evaluate): Use VOID_TO_NPVARIANT.
3785 (_NPN_GetProperty): Use NULL_TO_NPVARIANT and VOID_TO_NPVARIANT.
3787 * bindings/c/c_class.cpp: Formatting changes only.
3788 * bindings/c/c_class.h: Formatting changes only.
3790 * bindings/npruntime_priv.h: Removed obsolete and now-unused functions:
3791 NPN_VariantIsVoid, NPN_VariantIsNull, NPN_VariantIsUndefined,
3792 NPN_VariantIsBool, NPN_VariantIsInt32, NPN_VariantIsDouble,
3793 NPN_VariantIsString, NPN_VariantIsObject, NPN_VariantToBool,
3794 NPN_VariantToInt32, NPN_VariantToDouble, NPN_VariantToString,
3795 NPN_VariantToStringCopy, NPN_VariantToObject, NPN_InitializeVariantAsVoid,
3796 NPN_InitializeVariantAsNull, NPN_InitializeVariantAsUndefined,
3797 NPN_InitializeVariantWithBool, NPN_InitializeVariantWithInt32,
3798 NPN_InitializeVariantWithDouble, NPN_InitializeVariantWithString,
3799 NPN_InitializeVariantWithObject, and NPN_InitializeVariantWithVariant.
3800 * bindings/npruntime.cpp:
3801 (getIntIdentifierDictionary): Don't bother creating custom callbacks for the
3802 integer dictionary since the default behavior is fine for integers.
3804 2006-03-23 Mark Rowe <opendarwin.org@bdash.net.nz>
3806 Reviewed and landed by Maciej.
3808 - WebKit no longer builds with bison 2.1
3809 http://bugzilla.opendarwin.org/show_bug.cgi?id=7923
3811 * generate-derived-sources: Handle generated header named either grammar.cpp.h
3814 2006-03-22 Maciej Stachowiak <mjs@apple.com>
3818 * JavaScriptCore.xcodeproj/project.pbxproj:
3820 2006-03-21 Maciej Stachowiak <mjs@apple.com>
3822 * kjs/generate-derived-sources: Set executable property.
3824 2006-03-21 Maciej Stachowiak <mjs@apple.com>
3828 Ensure that generated source dependencies are handled properly, as follows:
3830 - Made an external script that generates the sources into a
3831 DerivedSources dir in the build products directory.
3832 - Added a new build target that builds all the generated sources
3833 if needed. Sadly it has to be a target, not a phase for Xcode to notice changes.
3834 - Added the DerivedSources dir in question to the include path.
3835 - Added the new DerivedSources dir and its contents to the project as build-relative.
3837 * JavaScriptCore.xcodeproj/project.pbxproj:
3838 * kjs/generate-derived-sources: Added. Based on the windows version - maybe someday they
3841 2006-03-11 Maciej Stachowiak <mjs@apple.com>
3845 - fixed "charAt layout test fails on intel macs; some NaNs are printed as -NaN"
3846 http://bugzilla.opendarwin.org/show_bug.cgi?id=7745
3849 (KJS::UString::from): Use "NaN" for all NaN values, regardless of sign.
3851 2006-03-16 Maciej Stachowiak <mjs@apple.com>
3855 - tweaks to my change to redo KJS::Node refcounting
3861 (Node::clearNewNodes):
3864 2006-03-16 Darin Adler <darin@apple.com>
3868 - fixed Vector so that you can pass a reference to something in the vector
3869 to the append or insert functions
3871 * kxmlcore/Vector.h:
3872 (KXMLCore::Vector::expandCapacity): Added new overloads that take a pointer to adjust
3873 and return the adjusted value of the pointer.
3874 (KXMLCore::Vector::append): Pass a pointer when expanding the vector, and use it when
3875 adding the new element. Makes the case where the element moves when the vector
3877 (KXMLCore::Vector::insert): Ditto.
3879 2006-03-15 Eric Seidel <eseidel@apple.com>
3885 * kjs/date_object.cpp:
3886 (KJS::DateProtoFunc::callAsFunction): use size() not "len()"
3888 2006-03-15 Eric Seidel <eseidel@apple.com>
3892 Fix CString copy constructor, fixes Date.parse("") on Win32.
3894 * kjs/date_object.cpp:
3895 (KJS::DateProtoFunc::callAsFunction):
3897 (KJS::CString::CString):
3898 (KJS::CString::operator=):
3900 2006-03-13 Maciej Stachowiak <mjs@apple.com>
3904 - KJS::Node and KJS::StatementNode are bigger than they need to be
3905 http://bugzilla.opendarwin.org/show_bug.cgi?id=7775
3907 The memory usage of Node was reduced by 2 machine words per node:
3909 - sourceURL was removed and only kept on FunctionBodyNode. The
3910 source URL can only be distinct per function or top-level program node,
3911 and you always have one.
3913 - refcount was removed and kept in a separate hashtable when
3914 greater than 1. newNodes set represents floating nodes with
3915 refcount of 0. This helps because almost all nodes have a refcount of 1
3916 for almost all of their lifetime.
3918 * bindings/runtime_method.cpp:
3919 (RuntimeMethod::RuntimeMethod): Pass null body, added FIXME.
3921 (KJS::clearNewNodes): New nodes are tracked in nodes.cpp now, but still clear
3922 them at the appropriate time.
3924 (KJS::ContextImp::currentBody): added; used to retrieve source URL and sid
3926 (KJS::ContextImp::pushIteration): moved here from LabelStack
3927 (KJS::ContextImp::popIteration): ditto
3928 (KJS::ContextImp::inIteration): ditto
3929 (KJS::ContextImp::pushSwitch): ditto
3930 (KJS::ContextImp::popSwitch): ditto
3931 (KJS::ContextImp::inSwitch): ditto
3933 (KJS::FunctionImp::FunctionImp): Add FunctionBodyNode* parameter.
3934 (KJS::FunctionImp::callAsFunction): Pass body to ContextImp.
3935 (KJS::FunctionImp::argumentsGetter): _context renamed to m_context.
3936 (KJS::DeclaredFunctionImp::DeclaredFunctionImp): Pass body to superclass
3938 (KJS::GlobalFuncImp::callAsFunction): Pass progNode as body for ContextImp in
3940 * kjs/function.h: Move body field from DeclaredFunctionImp to
3942 * kjs/grammar.y: Change DBG; statements no longer have a sourceid.
3944 (KJS::ContextImp::ContextImp): Initialize new m_currentBody, m_iterationDepth
3945 and m_switchDepth data members. New FunctionBodyNode* parameter - the
3946 function body provides source URL and SourceId.
3947 (KJS::InterpreterImp::mark): Use exception() function, not _exception directly.
3948 (KJS::InterpreterImp::evaluate): Pass progNode to ContextImp constructor
3951 (KJS::LabelStack::LabelStack): Remove iteration depth and switch depth;
3952 statement label stacks don't need these and it bloats their size. Put them
3953 in the ContextImp instead.
3954 * kjs/interpreter.cpp:
3955 (KJS::ExecState::lexicalInterpreter): Renamed _context to m_context.
3956 * kjs/interpreter.h:
3957 (KJS::ExecState::dynamicInterpreter): Renamed _context to m_context.
3958 (KJS::ExecState::context): ditto
3959 (KJS::ExecState::setException): Renamed _exception to m_exception
3960 (KJS::ExecState::clearException): ditto
3961 (KJS::ExecState::exception): ditto
3962 (KJS::ExecState::hadException): ditto
3963 (KJS::ExecState::ExecState): ditto both above renames
3965 (Node::Node): Removed initialization of line, source URL and refcount. Add to
3966 local newNodes set instead of involving parser.
3967 (Node::ref): Instead of managing refcount directly, story refcount over 1 in a
3968 HashCountedSet, and keep a separate HashSet of "floating" nodes with refcount
3970 (Node::deref): ditto
3971 (Node::refcount): ditto
3972 (Node::clearNewNodes): Destroy anything left in the new nodes set.
3973 (currentSourceId): Inline helper to get sourceId from function body via context.
3974 (currentSourceURL): ditto for sourceURL.
3975 (Node::createErrorCompletion): use new helper
3976 (Node::throwError): ditto
3977 (Node::setExceptionDetailsIfNeeded): ditto
3978 (StatementNode::StatementNode): remove initialization of l0 and sid, rename
3980 (StatementNode::setLoc): Set own m_lastLine and Node's m_line.
3981 (StatementNode::hitStatement): Get sid, first line, last line in the proper new ways.
3982 (StatListNode::StatListNode): updated for setLoc changes
3983 (BlockNode::BlockNode): ditto
3984 (DoWhileNode::execute): excpect iteraton counts on ContextImp, not LabelStack
3985 (WhileNode::execute): ditto
3986 (ForNode::execute): ditto
3987 (ForInNode::execute): ditto
3988 (ContinueNode::execute): excpect inIteration on ContextImp, not LabelStack
3989 (BreakNode::execute): excpect inIteration and inSwitch on ContextImp, not LabelStack
3990 (SwitchNode::execute): expect switch counts on ContextImp, not LabelStack
3991 (FunctionBodyNode::FunctionBodyNode): update for new setLoc
3992 (FunctionBodyNode::processFuncDecl): reindent
3993 (SourceElementsNode::SourceElementsNode): update for new setLoc
3995 (KJS::Node::lineNo): Renamed _line to m_line
3996 (KJS::StatementNode::firstLine): Use lineNo()
3997 (KJS::StatementNode::lastLine): Renamed l1 to m_lastLine
3998 (KJS::FunctionBodyNode::sourceId): added
3999 (KJS::FunctionBodyNode::sourceURL): added
4002 2006-03-14 Geoffrey Garen <ggaren@apple.com>
4004 - Fixed <rdar://problem/4478239> string sort puts "closed" before
4010 (KJS::compare): Inverted a < in order to treat the longer string as >
4013 2006-03-12 Alexey Proskuryakov <ap@nypop.com>
4017 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7708
4018 REGRESSION: Flash callback to JavaScript function not working.
4020 Test: plugins/invoke.html
4022 * bindings/c/c_utility.cpp:
4023 (KJS::Bindings::convertUTF8ToUTF16): Return a correct string length.
4025 2006-03-08 Eric Seidel <eseidel@apple.com>
4029 Partially fix JS on win32 by fixing hash table generation.
4031 * kjs/create_hash_table: limit << results to 32 bits.
4033 (TestFunctionImp::callAsFunction):
4035 2006-03-07 Darin Adler <darin@apple.com>
4037 * kxmlcore/Vector.h: Quick fix to try to get Windows compiling again.
4039 2006-03-07 Darin Adler <darin@apple.com>
4043 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7655
4044 unwanted output while running layout tests
4046 * kjs/lexer.cpp: (Lexer::lex): Turn off the "yylex: ERROR" message.
4047 * kjs/regexp.cpp: (KJS::RegExp::RegExp): Remove the code to log errors from PCRE
4048 to standard output. I think we should arrange for the error text to be in JavaScript
4049 exceptions instead at some point.
4050 * kxmlcore/Vector.h: Add a check for overflow so that we'll abort if we pass a
4051 too-large size rather than allocating a buffer smaller than requested.
4053 2006-03-06 David Carson <dacarson@gmail.com>
4055 Reviewed by Darin, landed by ap.
4057 - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=7582
4058 c_utility.cpp contains CFString OS X platform-dependent code; should use ICU
4060 Tested with test case from:
4061 http://bugzilla.opendarwin.org/show_bug.cgi?id=5163
4063 * bindings/c_utility.cpp
4064 (convertUTF8ToUTF16): Changed to using Unicode converter from ICU, and manual Latin-1 conversion.
4065 * icu/unicode/ucnv.h: Copied from WebCore.
4066 * icu/unicode/ucnv_err.h: Ditto.
4067 * icu/unicode/uenum.h: Ditto.
4069 2006-03-05 Darin Adler <darin@apple.com>
4071 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Updated.
4073 2006-03-06 Mitz Pettel <opendarwin.org@mitzpettel.com>
4075 Fix suggested by Alexey Proskuryakov <ap@nypop.com>, reviewed by Maciej and Hyatt.
4077 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=7601
4078 REGRESSION (r13089): Reproducible crash dereferencing a deallocated element on google image search
4080 * kxmlcore/Platform.h: Corrected the define to enable USE(MULTIPLE_THREADS) on Mac OS X.
4082 2006-03-05 Darin Adler <darin@apple.com>
4086 - http://bugzilla.opendarwin.org/show_bug.cgi?id=7616
4087 get all references to KJS::Node out of internal.h
4089 * JavaScriptCore.xcodeproj/project.pbxproj: Updated for file changes.
4091 * kjs/Parser.cpp: Added.
4092 * kjs/Parser.h: Added.
4094 * kjs/internal.cpp: Removed the Parser class.
4095 * kjs/internal.h: Ditto. Also removed unnecessary declarations of classes
4096 not used in this header.
4098 * kjs/nodes.h: Added an include of "Parser.h".
4099 * kjs/function.h: Added a declaration of FunctionBodyNode.
4101 2006-03-05 Geoffrey Garen <ggaren@apple.com>
4105 - JSC support for the fix for <rdar://problem/4467143> JavaScript
4106 enumeration of HTML element properties skips DOM node properties
4109 (1) Added the KJS_DEFINE_PROTOTYPE_WITH_PROTOTYPE macro. The
4110 class definiton macro needs to know about the prototype's prototype so
4111 that the class constructor properly sets it.
4112 (2) Removed the KJS_IMPLEMENT_PROTOTYPE_WITH_PARENT macro. The class
4113 implementation macro does not need to know about the prototype's
4114 prototype, since getOwnPropertySlot should only look in the current
4115 object's property map, and not its prototype's.
4117 2006-03-05 Andrew Wellington <proton@wiretapped.net>
4119 Reviewed by Eric, landed by ap.
4121 - Remove unused breakpoint bool from StatementNodes. No test provided as
4122 there is no functionality change.
4125 (StatementNode::StatementNode):
4128 2006-03-03 Geoffrey Garen <ggaren@apple.com>
4132 - Fixed <rdar://problem/4465598> R