1 2006-07-19 Anders Carlsson <acarlsson@apple.com>
5 <rdar://problem/4620655> REGRESSION(10.4.7-10.5): preview button for a blogger.com post doesn't work
7 * kjs/nodes2string.cpp:
8 (StringNode::streamTo):
9 Return the escaped string.
11 (RegExpNode::streamTo):
12 Use the correct syntax.
15 (KJS::escapeStringForPrettyPrinting):
17 Add escape function which escapes a string for pretty-printing so it can be parsed again.
19 * wtf/unicode/icu/UnicodeIcu.h:
20 (WTF::Unicode::isPrintableChar):
25 2006-07-18 Maciej Stachowiak <mjs@apple.com>
27 Reviewed by Adele Peterson.
29 <rdar://problem/4589530> REGRESSION: null character in JS string causes parse error (works in Tiger and in other browsers)
38 2006-07-18 Tim Omernick <timo@apple.com>
40 Reviewed by Tim Hatcher.
42 Removed a misleading comment; we recently added support for the NPNVPluginElementNPObject
49 2006-07-18 Timothy Hatcher <timothy@apple.com>
51 Made the following headers public:
60 * JavaScriptCore.xcodeproj/project.pbxproj:
62 2006-07-17 Geoffrey Garen <ggaren@apple.com>
66 - Added automatic prototype creation for classes.
68 A class stores a weak reference to a prototype, which is cleared when
69 the prototype is garbage collected, to avoid a reference cycle.
71 We now have an attributes field in JSClassDefinition, that currently is
72 used only to override automatic prototype creation when you want to manage your
73 own prototypes, but can be extended in the future for other nefarious purposes.
75 Similarly, we have JSObjectMake and JSObjectMakeWithPrototype, the latter
76 allowing you to manage your own prototypes.
78 JSObjectMakeConstructor is more interesting now, able to make a constructor
79 on your behalf if you just give it a class.
81 - Removed bogus old code from minidom.js.
83 - Tweaked the headerdocs.
85 - Added more GC testing, which caught some leaks, and tested more funny
86 edge cases in lookup, which caught a lookup bug. Removed some testing
87 we used to do with MyObject because it was redundant with the new, cool
90 While fixing the lookup bug I retracted this change:
92 "If a static setProperty callback returns 'false', to indicate that the
93 property was not set, we no longer forward the set request up the class
94 chain, because that's almost certainly not what the programmer expected."
96 Returning false when setting a static property is a little silly, but you can see
97 it being useful when shadowing a base class's static properties, and, regardless
98 of usefullness, this is the defined behavior of the setProperty callback.
100 - Plus a little ASCII art, for the kids.
102 2006-07-17 Timothy Hatcher <timothy@apple.com>
106 <rdar://problem/4634874> WebScriptObject and WebUndefined are no longer defined by WebKit
108 Moves WebScriptObject and WebUndefined up to WebCore.
109 This change does create an upwards-dependancy on WebScriptObject existing
110 in the loaded process, but this code path in JavaScriptCore does not get used
111 unless it is through WebKit/WebCore. Moving all of the binding code out of
112 JavaScriptCore might make sense in the future.
114 * JavaScriptCore.exp:
115 * JavaScriptCore.xcodeproj/project.pbxproj:
116 * bindings/objc/WebScriptObject.h: Replaced.
117 * bindings/objc/WebScriptObject.mm: Removed.
118 * bindings/objc/WebScriptObjectPrivate.h: Removed.
119 * bindings/objc/objc_class.h:
120 * bindings/objc/objc_instance.h:
121 * bindings/objc/objc_instance.mm:
122 (ObjcInstance::~ObjcInstance):
123 * bindings/objc/objc_runtime.h:
124 * bindings/objc/objc_runtime.mm:
125 (convertValueToObjcObject):
126 * bindings/objc/objc_utility.mm:
127 (KJS::Bindings::convertValueToObjcValue):
128 (KJS::Bindings::convertObjcValueToValue):
129 (KJS::Bindings::createObjcInstanceForValue):
131 2006-07-17 Darin Adler <darin@apple.com>
133 * API/JSBase.h: Fix comment formatting where things used to be lined up but
134 are now ragged. Got rid of spaces that attempted to line things up.
135 * API/JSObjectRef.h: Ditto. Also add missing periods for a couple of comments.
137 2006-07-17 Geoffrey Garen <ggaren@apple.com>
141 - Removed the exception parameter from the initialize callback and, by extension,
142 JSObjectMake. We have never had a need for exceptions when iniitializing,
143 so the parameter seemed likely to "get in the way."
145 Also, an exception in JavaScript is thrown in response to input --
146 "invalid URL", "index not a number", etc., so it's the job of the
147 constructor function, not the initialize method, to throw.
149 If initialize *really* wants to throw, it can communicate the throw to
150 the constructor through the constructed object's private data (e.g., set
151 it to NULL, signaling to the consntructor that initialization failed.)
153 - Added JSObjectMakeWithData, which enables a constructor to set private
154 data on an object *before* it has been initialized. That way, the initialize
155 methods can properly operate on the data.
157 * API/JSNode.c: Moved ref into the initialize method, for better encapsulation,
158 now that it's possible.
159 * API/JSNodeList.c: ditto
161 (main): Do more aggressive garbage collection to test ref/deref and
163 * API/minidom.js: store childNodes in a temporary so it doesn't get re-created
164 like a thousand times. This makes debugging ref/deref easier
166 2006-07-17 Geoffrey Garen <ggaren@apple.com>
170 - Changed the initialize callback to run from least derived class (parent
171 class) to most derived class. This enables C++ style initialization,
172 and derived class overriding of member data.
174 - Added excpetion propopgation to JSObjectMake, to support initialize
175 exceptions, and generally round out our policy of making function
176 signatures as long as possible.
178 * API/JSCallbackObject.h: Use ExecState instead of ContextRef, cuz we're
181 2006-07-17 Geoffrey Garen <ggaren@apple.com>
185 - Changed JSObjectMakeConstructor to JSObjectMakeConstructorWithCallback,
186 to match JSObjectMakeFunctionWithCallback.
188 - Added prototype parameter, so the generated constructor
189 automatically works with hasInstance / instanceof
191 - Moved hasInstance implementation from InternalFunctionImp to JSObject
192 so that subclasses can inherit it without inheriting function-related baggage.
193 More refactoring here would be good, but this seems like a good short-term
196 (KJS::JSCallbackFunction::implementsHasInstance): override and return false,
197 because callback functions aren't constructors.
199 2006-07-17 Maciej Stachowiak <mjs@apple.com>
203 - add a JSContextRef parameter to all JSValueRef, JSObjectRef, and JSContextRef operations;
204 except JSObject{Get,Set}PrivateData which can be assumed to be simple pure accessors.
206 Also renamed the parameter "context" to "ctx" because it makes the code read better with this pervasive
207 but usually uninteresting parameter.
211 (JSCheckScriptSyntax):
214 * API/JSCallbackObject.cpp:
215 (KJS::JSCallbackObject::JSCallbackObject):
216 (KJS::JSCallbackObject::init):
217 (KJS::JSCallbackObject::getOwnPropertySlot):
218 (KJS::JSCallbackObject::put):
219 (KJS::JSCallbackObject::deleteProperty):
220 (KJS::JSCallbackObject::toNumber):
221 (KJS::JSCallbackObject::toString):
222 * API/JSContextRef.cpp:
223 (JSGlobalContextCreate):
224 (JSGlobalContextRetain):
225 (JSGlobalContextRelease):
226 (JSContextGetGlobalObject):
227 * API/JSContextRef.h:
229 (JSNodePrototype_appendChild):
230 (JSNodePrototype_removeChild):
231 (JSNodePrototype_replaceChild):
232 (JSNode_getNodeType):
233 (JSNode_getFirstChild):
236 (JSNodeListPrototype_item):
238 (JSNodeList_getProperty):
239 (JSNodeList_prototype):
240 * API/JSObjectRef.cpp:
242 (JSObjectMakeFunctionWithCallback):
243 (JSObjectMakeConstructor):
244 (JSObjectMakeFunction):
245 (JSObjectGetPrototype):
246 (JSObjectSetPrototype):
247 (JSObjectHasProperty):
248 (JSObjectGetProperty):
249 (JSObjectSetProperty):
250 (JSObjectGetPropertyAtIndex):
251 (JSObjectSetPropertyAtIndex):
252 (JSObjectDeleteProperty):
253 (JSObjectIsFunction):
254 (JSObjectCallAsFunction):
255 (JSObjectIsConstructor):
256 (JSObjectCallAsConstructor):
257 (JSObjectCopyPropertyNames):
259 * API/JSStringRef.cpp:
260 * API/JSValueRef.cpp:
262 (JSValueIsUndefined):
268 (JSValueIsObjectOfClass):
270 (JSValueIsStrictEqual):
271 (JSValueIsInstanceOfConstructor):
272 (JSValueMakeUndefined):
274 (JSValueMakeBoolean):
279 (JSValueToStringCopy):
287 (MyObject_getProperty):
288 (MyObject_deleteProperty):
289 (MyObject_callAsFunction):
290 (MyObject_callAsConstructor):
291 (MyObject_convertToType):
292 (print_callAsFunction):
295 2006-07-16 Geoffrey Garen <ggaren@apple.com>
297 Approved by Maciej, RS by Beth.
299 JSObjectMakeFunction -> JSObjectMakeFunctionWithCallback
300 JSObjectMakeFunctionWithBody -> JSObjectMakeFunction
302 because the latter is more common, and more fundamental, than the former.
307 * API/JSCallbackObject.cpp:
308 (KJS::JSCallbackObject::getOwnPropertySlot):
309 (KJS::JSCallbackObject::put):
310 (KJS::JSCallbackObject::deleteProperty):
311 (KJS::JSCallbackObject::getPropertyNames):
312 (KJS::JSCallbackObject::staticValueGetter):
313 (KJS::JSCallbackObject::staticFunctionGetter):
314 * API/JSClassRef.cpp:
315 (OpaqueJSClass::OpaqueJSClass):
316 (OpaqueJSClass::~OpaqueJSClass):
318 * API/JSObjectRef.cpp:
320 (JSObjectMakeFunctionWithCallback):
321 (JSObjectMakeFunction):
322 (OpaqueJSPropertyNameArray::OpaqueJSPropertyNameArray):
323 (JSObjectCopyPropertyNames):
330 * JavaScriptCore.exp:
332 2006-07-16 Geoffrey Garen <ggaren@apple.com>
336 Replace __JS with OpaqueJS because the former, while used by CF, is
337 a prefix that's triply-reserved by the compiler. (_* is reserved in global
338 names, _[A-Z] is reserved in all names, and __ is reserved in all names
341 Opaque is an alternative used by other Mac OS X framewokrs.
346 * API/JSCallbackObject.cpp:
347 (KJS::JSCallbackObject::getOwnPropertySlot):
348 (KJS::JSCallbackObject::put):
349 (KJS::JSCallbackObject::deleteProperty):
350 (KJS::JSCallbackObject::getPropertyNames):
351 (KJS::JSCallbackObject::staticValueGetter):
352 (KJS::JSCallbackObject::staticFunctionGetter):
353 * API/JSClassRef.cpp:
354 (OpaqueJSClass::OpaqueJSClass):
355 (OpaqueJSClass::~OpaqueJSClass):
357 * API/JSObjectRef.cpp:
359 (OpaqueJSPropertyNameArray::OpaqueJSPropertyNameArray):
360 (JSObjectCopyPropertyNames):
362 2006-07-16 Darin Adler <darin@apple.com>
364 - try to fix Windows build
366 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
367 Added some recently added files, removed some recently removed.
369 2006-07-16 Geoffrey Garen <ggaren@apple.com>
373 - Change getProperty* to return undefined, rather than NULL, for missing
374 properties, since that's what the spec says. Also added exception out
375 parameters to the *Index functions, because they can call through to the
376 regular functions, which can throw for custom objects.
378 * API/JSObjectRef.cpp:
379 (JSObjectGetProperty):
380 (JSObjectGetPropertyAtIndex):
381 (JSObjectSetPropertyAtIndex):
386 2006-07-16 Geoffrey Garen <ggaren@apple.com>
390 - Properly document and handle NULL callbacks for static properties. We
391 throw an exception in any case other than a ReadOnly property with a NULL
392 setProperty callback, because a NULL callback almost certainly indicates
393 a programming error. Also throw an exception if hasProperty returns true
394 for a property that getProperty can't get.
396 - If a static setProperty callback returns 'false', to indicate that the
397 property was not set, we no longer forward the set request up the class
398 chain, because that's almost certainly not what the programmer expected.
400 * API/JSCallbackObject.cpp:
401 (KJS::JSCallbackObject::getOwnPropertySlot):
402 (KJS::JSCallbackObject::put):
403 (KJS::JSCallbackObject::staticValueGetter):
404 (KJS::JSCallbackObject::staticFunctionGetter):
405 (KJS::JSCallbackObject::callbackGetter):
409 (MyObject_hasProperty):
412 2006-07-16 Geoffrey Garen <ggaren@apple.com>
416 - Added names to functions.
418 - Removed GetPrivate/SetPrivate from callbackFunctions and callbackConstructors.
419 The private data idiom is that a JS object stores its native implementation
420 as private data. For functions and constructors, the native implementation is nothing
421 more than the callback they already store, so supporting private data, too,
422 confuses the idiom. If you *really* want, you can still create a custom
423 function with private data.
425 * API/JSCallbackConstructor.cpp:
426 * API/JSCallbackConstructor.h:
427 * API/JSCallbackFunction.cpp:
428 (KJS::JSCallbackFunction::JSCallbackFunction):
429 * API/JSCallbackFunction.h:
430 * API/JSCallbackObject.cpp:
431 (KJS::JSCallbackObject::staticFunctionGetter):
432 * API/JSObjectRef.cpp:
433 (JSObjectMakeFunction):
434 (JSObjectMakeFunctionWithBody):
435 (JSObjectGetPrivate):
436 (JSObjectSetPrivate):
443 2006-07-15 Maciej Stachowiak <mjs@apple.com>
447 - switch property lists to be vector+set of Identifiers instead of list of References
449 This has the following benefits:
451 - no duplicates in property lists
452 - simplifies API calls
453 - probably more efficient, since linked list is gone
454 - entirely removed Reference, ReferenceList and ProtectedReference types from the API
456 * kjs/PropertyNameArray.cpp: Added.
457 (KJS::PropertyNameArray::add): Check set, if not already there, add to
459 * kjs/PropertyNameArray.h: Added.
460 (KJS::PropertyNameArray::PropertyNameArray): Newly added type, combines
461 a set and a vector to make a unique but ordered list of identifiers.
462 (KJS::PropertyNameArray::begin): ditto
463 (KJS::PropertyNameArray::end): ditto
464 (KJS::PropertyNameArray::size): ditto
465 (KJS::PropertyNameArray::operator[]): ditto
466 * kjs/array_instance.h:
467 * kjs/array_object.cpp:
468 (ArrayInstance::getPropertyNames): renamed from getPropertyList, updated
469 for PropertyNameArray
470 (ArrayInstance::setLength): updated for PropertyNameArray
471 (ArrayInstance::pushUndefinedObjectsToEnd): ditto
473 (ForInNode::execute): updated for PropertyNameArray
476 (KJS::JSObject::getPropertyNames): renamed from getPropertyList, updated
477 for PropertyNameArray
479 * kjs/property_map.cpp:
480 (KJS::PropertyMap::getEnumerablePropertyNames): updated for PropertyNameArray
481 (KJS::PropertyMap::getSparseArrayPropertyNames): ditto
482 * kjs/property_map.h:
483 * kjs/protected_reference.h: Removed.
484 * kjs/reference.cpp: Removed.
485 * kjs/reference.h: Removed.
486 * kjs/reference_list.cpp: Removed.
487 * kjs/reference_list.h: Removed.
488 * kjs/scope_chain.cpp:
489 (KJS::ScopeChain::print): Use PropertyNamesArray instead of ReferenceList.
490 * kjs/string_object.cpp:
491 (StringInstance::getPropertyNames): Updated for new approach.
492 * kjs/string_object.h:
495 (toJS): Added overload for PropertyNameAccumulatorRef / PropertyNameArray*
498 * API/JSCallbackObject.cpp:
499 (KJS::JSCallbackObject::getPropertyNames): Fixed for new API.
500 * API/JSCallbackObject.h:
501 * API/JSObjectRef.cpp:
502 (__JSPropertyNameArray::__JSPropertyNameArray): Type used for a publicly vended
503 JSPropertyNameArrayRef.
504 (JSObjectCopyPropertyNames): New API call - renamed / refactored from
505 JSObjectCreatePropertyList
506 (JSPropertyNameArrayRetain): new retain call for JSPropertyNameArray.
507 (JSPropertyNameArrayRelease): new release call for - " -.
508 (JSPropertyNameArrayGetCount): Instead of having to use a stateful enumerator you
509 can now get the count and items in any order.
510 (JSPropertyNameArrayGetNameAtIndex): See above.
511 (JSPropertyNameAccumulatorAddName): What you add properties to is now an opaque
513 * API/JSObjectRef.h: Prototyped new functions, removed old ones
514 * JavaScriptCore.exp: Updated exported symbols.
515 * JavaScriptCore.xcodeproj/project.pbxproj: Added new files, removed old.
517 (MyObject_getPropertyNames): Renamed / fixed callback to fit new paradigm.
518 (main): Updated for new API.
520 2006-07-15 Darin Adler <darin@apple.com>
522 - oops, missed a few more arrays that had to be const
525 (JSNodePrototype_appendChild): Added const.
526 (JSNodePrototype_removeChild): Ditto.
527 (JSNodePrototype_replaceChild): Ditto.
528 (JSNode_construct): Ditto.
530 (JSNodeListPrototype_item): Ditto.
531 * API/JSObjectRef.cpp:
532 (JSObjectMakeFunctionWithBody): Ditto.
533 (JSObjectCallAsFunction): Ditto.
534 (JSObjectCallAsConstructor): Ditto.
538 (MyObject_callAsFunction): Ditto.
539 (MyObject_callAsConstructor): Ditto.
540 (print_callAsFunction): Ditto.
541 (myConstructor_callAsConstructor): Ditto.
543 2006-07-15 Darin Adler <darin@apple.com>
547 * API/JSNode.h: Made an array parameter const.
548 * API/JSObjectRef.h: Made array parameters const. Fixed a comment.
550 2006-07-15 Geoffrey Garen <ggaren@apple.com>
554 - JSObjectMakeFunctionWithBody includes a function name and named parameters now.
556 * API/JSObjectRef.cpp:
557 (JSObjectMakeFunctionWithBody):
560 (assertEqualsAsUTF8String): More informative failure reporting.
561 (main): Test more function cases.
563 2006-07-15 Geoffrey Garen <ggaren@apple.com>
567 - Moved the arguments passed to JSClassCreate into a single structure,
568 called JSClassDefinition. This will enable easier structure
569 migration/versioning in the future, if necessary.
571 - Added support for class names.
573 - kJSClassDefinitionNull replaces kJSObjectCallbacksNone.
575 - JSClass is becoming a fairly complex struct, so I migrated all of its
576 implementation other than reference counting to the sruct.
578 - Also moved JSClass* functions in the API to JSObjectRef.cpp, since they're
579 declared in JSObjectRef.h
581 - Also added some more informative explanation to the class structure doc.
583 2006-07-15 Darin Adler <darin@apple.com>
587 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8395
588 <rdar://problem/4613467>
589 REGRESSION: RegEx seems broken for hex escaped non breaking space
591 Test: fast/js/regexp-extended-characters-more.html
594 (match): Got rid of utf16Length local variable to guarantee there's no
595 extra stack usage in recursive calls. Fixed two places in the PCRE_UTF16
596 code that were using the length variable, which is the UTF-8 length of
597 a character in the pattern, to move in the UTF-16 subject string. Instead
598 they hardcode lengths of 1 and 2 since the code already handles BMP
599 characters and surrogate pairs separately. Also fixed some DPRINTF so
600 I could compile with DEBUG on.
601 (pcre_exec): Changed a place that was checking for multibyte characters
602 in the subject string to use ISMIDCHAR. Instead it was using hardcoded
603 logic that was right for UTF-8 but wrong for UTF-16.
605 * pcre/pcre_compile.c: (pcre_compile2): Fixed a DPRINTF so I could compile
608 2006-07-14 Geoffrey Garen <ggaren@apple.com>
612 Global replace in the API of argc/argv with argumentCount/arguments.
614 2006-07-14 Geoffrey Garen <ggaren@apple.com>
618 - Finalized exception handling in the API.
620 setProperty can throw because it throws for built-in arrays. getProperty
621 and deleteProperty can throw because setProperty can throw and we want
622 to be consistent, and also because they seem like "actions." callAsFunction,
623 callAsConstructor, and hasInstance can throw, because they caan throw for
626 toBoolean can't throw because it's defined that way in the spec.
628 - Documented that toBoolean and toObject can't be overridden by custom
629 objects because they're defined that way in the spec.
631 === Safari-521.17 ===
633 2006-07-14 Geoffrey Garen <ggaren@apple.com>
637 - Implemented ref-counting of JSContexts by splitting into two datatypes:
638 JSGlobalContext, which you can create/retain/release, and JSContext, which
641 Internally, you retain a JSGlobalContext/ExecState by retaining its
642 interpreter, which, in the case of a global ExecState, owns it.
644 - Also made ~Interpreter() protected to catch places where Interpreter
645 is manually deleted. (Can't make it private because some crazy fool
646 decided it would be a good idea to subclass Interpreter in other frameworks.
650 (toJS): Added cast for new JSGlobalContext
651 * API/JSStringRef.h: Changed vague "you must" language to more specific
652 (but, ultimately, equally vague) "behavior is undefined if you don't"
654 (KJS::Interpreter::Interpreter): Factored more common initialization into
657 (KJS::Interpreter::ref): new
658 (KJS::Interpreter::deref): new
659 (KJS::Interpreter::refCount): new
661 (doIt): Ref-count the interpreter.
663 2006-07-14 Maciej Stachowiak <mjs@apple.com>
667 - removed bool return value from JSObjectSetProperty, since it is inefficient and
668 also doesn't work quite right
669 - added JSObjectGetPropertyAtIndex and JSObjectSetPropertyAtIndex
671 * API/JSObjectRef.cpp:
672 (JSObjectSetProperty): Removed return value and canPut stuff.
673 (JSObjectGetPropertyAtIndex): Added.
674 (JSObjectSetPropertyAtIndex): Added.
675 * API/JSObjectRef.h: Prototyped and documented new functions.
677 2006-07-14 Geoffrey Garen <ggaren@apple.com>
681 Moved JSCheckScriptSyntax, JSEvaluateScript, and JSGarbageCollect into
682 JSBase.h/.cpp. They don't belong in the value-specific or context-specific
683 files because they're not part of the value or context implementations.
686 * API/JSContextRef.cpp:
687 (JSContextGetGlobalObject):
688 * API/JSContextRef.h:
689 * API/JSValueRef.cpp:
692 * JavaScriptCore.xcodeproj/project.pbxproj:
694 2006-07-13 Timothy Hatcher <timothy@apple.com>
698 Moved JavaScriptCore to be a public framework.
700 * JavaScriptCore.xcodeproj/project.pbxproj:
702 2006-07-13 Mark Rowe <opendarwin.org@bdash.net.nz>
704 Reviewed by Geoffrey.
706 http://bugzilla.opendarwin.org/show_bug.cgi?id=9742
707 Bug 9742: REGRESSION: WebKit hangs when loading <http://www.vtbook.com>
710 (KJS::JSValue::getUInt32): Only types tagged as numeric can be converted to UInt32.
712 2006-07-13 Geoffrey Garen <ggaren@apple.com>
716 - Renamed JSEvaluate -> JSEvaluateScript, JSCheckSyntax -> JSCheckScriptSyntax
717 - Added exception out parameters to JSValueTo* and JSValueIsEqual because
719 - Removed JSObjectGetDescription because it's useless and vague, and
720 JSValueToString/JSValueIsObjectOfClass do a better job, anyway
721 - Clarified comments about "IsFunction/Constructor" to indicate that they
722 are true of all functions/constructors, not just those created by JSObjectMake*
724 2006-07-12 Geoffrey Garen <ggaren@apple.com>
728 Finished previously approved JSInternalString -> JSString conversion
729 by renaming the files.
731 * API/JSCallbackObject.cpp:
732 * API/JSInternalStringRef.cpp: Removed.
733 * API/JSInternalStringRef.h: Removed.
734 * API/JSStringRef.cpp: Added.
735 * API/JSStringRef.h: Added.
736 * API/JavaScriptCore.h:
737 * JavaScriptCore.xcodeproj/project.pbxproj:
739 2006-07-12 Geoffrey Garen <ggaren@apple.com>
743 - Removed context and exception parameters from JSObjectGetPropertyEnumerator,
744 removing the spurious use of ExecState inside JavaScriptCore that made
745 us think this was necessary in the first place.
747 (StringInstance::getPropertyList): Use getString instead of toString because
748 we know we're dealing with a string -- we put it there in the first place.
749 While we're at it, store the string's size instead of retrieving it each time
750 through the loop, to avoid the unnecessary killing of puppies.
751 * kjs/string_object.h:
753 2006-07-12 Maciej Stachowiak <mjs@apple.com>
757 - add handling of hasInstance callback for API objects
759 * API/JSCallbackObject.cpp:
760 (KJS::JSCallbackObject::implementsHasInstance): Check if callback is present.
761 (KJS::JSCallbackObject::hasInstance): Invoke appropriate callback.
762 * API/JSCallbackObject.h:
763 * API/JSClassRef.cpp:
766 (MyObject_hasInstance): Test case; should match what construct would do.
769 2006-07-11 Geoffrey Garen <ggaren@apple.com>
773 - Implemented a vast number of renames and comment clarifications
774 suggested during API review.
776 JSInternalString -> JSString
777 JS*Make -> JSValueMake*, JSObjectMake*
779 JSValueIsInstanceOf -> JSValueIsInstanceOfConstructor (reads strangely well in client code)
780 JSGC*Protect -> JSValue*Protect
781 JS*Callback -> JSObject*Callback
782 JSGetPropertyListCallback -> JSObjectAddPropertiesToListCallback
783 JSPropertyEnumeratorGetNext -> JSPropertyEnumeratorGetNextName
785 JSStringCreateWithUTF8CString, JSStringGetUTF8CString,
786 JSStringGetMaximumUTF8CStringSize JSStringIsEqualToUTF8CString,
787 JSStringCreateWithCFString, JSStringCopyCFString, JSStringCreateWithCharacters.
789 - Changed functions taking a JSValue out arg and returning a bool indicating
790 whether it was set to simply return a JSValue or NULL.
792 - Removed JSStringGetCharacters because it's more documentation than code,
793 and it's just a glorified memcpy built on existing API functionality.
795 - Moved standard library includes into the headers that actually require them.
797 - Standardized use of the phrase "Create Rule."
799 - Removed JSLock from make functions that don't allocate.
801 - Added exception handling to JSValueToBoolean, since we now allow
802 callback objects to throw exceptions upon converting to boolean.
804 - Renamed JSGCCollect to JSGarbageCollect.
806 2006-07-10 Geoffrey Garen <ggaren@apple.com>
810 - Changed public header includes to the <JavaScriptCore/ style.
811 - Changed instances of 'buffer' to 'string' since we decided on
812 JSInternalString instead of JSStringBuffer.
814 * API/JSContextRef.h:
815 * API/JSInternalStringRef.cpp:
817 (JSInternalStringRetain):
818 (JSInternalStringRelease):
819 (JSValueCopyStringValue):
820 (JSInternalStringGetLength):
821 (JSInternalStringGetCharactersPtr):
822 (JSInternalStringGetCharacters):
823 (JSInternalStringGetMaxLengthUTF8):
824 (JSInternalStringGetCharactersUTF8):
825 (CFStringCreateWithJSInternalString):
826 * API/JSInternalStringRef.h:
828 (JSNodePrototype_appendChild):
829 (JSNode_getNodeType):
830 * API/JSObjectRef.cpp:
831 (JSObjectCallAsConstructor):
833 * API/JavaScriptCore.h:
838 (MyObject_getPropertyList):
839 (myConstructor_callAsConstructor):
840 (main): I noticed that we were prematurely releasing some string buffers,
841 so I moved their release calls to the end of main(). I got rid of 'Buf' in *Buf
842 (sometimes changing to 'IString', when necessary to differentiate a variable)
843 to match the buffer->string change.
845 === Safari-521.16 ===
847 2006-07-10 Darin Adler <darin@apple.com>
849 * kjs/value.cpp: (KJS::JSValue::toInt32Inline): Added inline keyword one more place.
852 2006-07-10 Darin Adler <darin@apple.com>
854 - fix the release build
858 (KJS::JSValue::toInt32Inline): Move the code here to an inline.
859 (KJS::JSValue::toInt32): Call the inline from both overloaded toInt32 functions.
861 2006-07-10 David Kilzer <ddkilzer@kilzer.net>
865 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9179
866 Implement select.options.add() method
868 * JavaScriptCore.exp: Added overloaded KJS::JSValue::toInt32() method.
869 * JavaScriptCore.xcodeproj/project.pbxproj: Altered attributes metadata for
870 kjs/value.h to make it available as a forwarded header.
872 (KJS::lookupPut): Extracted a lookupPut() method from the existing lookupPut() method.
873 The new method returns a boolean value if no entry is found in the lookup table.
875 (KJS::JSValue::toInt32): Overloaded toInt32() method with boolean "Ok" argument.
876 * kjs/value.h: Ditto.
878 2006-07-10 Geoffrey Garen <ggaren@apple.com>
880 No review necessary. Removed bogus file I accidentally checked in before.
882 * API/JSInternalSringRef.h: Removed.
884 2006-07-10 Geoffrey Garen <ggaren@apple.com>
888 Added exception out parameter to API object callbacks, removed semi-bogus
889 JSContext(.*)Exception functions.
891 To make these calls syntactically simple, I added an exceptionSlot()
892 method to the ExecState class, which provides a JSValue** slot in which to
893 store a JSValue* exception.
897 * API/JSCallbackConstructor.cpp:
898 (KJS::JSCallbackConstructor::construct):
899 * API/JSCallbackFunction.cpp:
900 (KJS::JSCallbackFunction::callAsFunction):
901 * API/JSCallbackObject.cpp:
902 (KJS::JSCallbackObject::init):
903 (KJS::JSCallbackObject::getOwnPropertySlot):
904 (KJS::JSCallbackObject::put):
905 (KJS::JSCallbackObject::deleteProperty):
906 (KJS::JSCallbackObject::construct):
907 (KJS::JSCallbackObject::callAsFunction):
908 (KJS::JSCallbackObject::getPropertyList):
909 (KJS::JSCallbackObject::toBoolean):
910 (KJS::JSCallbackObject::toNumber):
911 (KJS::JSCallbackObject::toString):
912 (KJS::JSCallbackObject::staticValueGetter):
913 (KJS::JSCallbackObject::callbackGetter):
914 * API/JSContextRef.cpp:
916 * API/JSContextRef.h:
918 (JSNodePrototype_appendChild):
919 (JSNodePrototype_removeChild):
920 (JSNodePrototype_replaceChild):
921 (JSNode_getNodeType):
922 (JSNode_getChildNodes):
923 (JSNode_getFirstChild):
927 (JSNodeListPrototype_item):
929 (JSNodeList_getProperty):
934 (MyObject_initialize):
935 (MyObject_hasProperty):
936 (MyObject_getProperty):
937 (MyObject_setProperty):
938 (MyObject_deleteProperty):
939 (MyObject_getPropertyList):
940 (MyObject_callAsFunction):
941 (MyObject_callAsConstructor):
942 (MyObject_convertToType):
943 (print_callAsFunction):
944 (myConstructor_callAsConstructor):
946 * JavaScriptCore.exp:
948 (KJS::ExecState::exceptionHandle):
950 2006-07-10 Geoffrey Garen <ggaren@apple.com>
954 Improved type safety by implementing opaque JSValue/JSObject typing through
955 abuse of 'const', not void*. Also fixed an alarming number of bugs
956 exposed by this new type safety.
958 I made one design change in JavaScriptCore, which is that the JSObject
959 constructor should take a JSValue* as its prototype argument, not a JSObject*,
960 since we allow the prototype to be any JSValue*, including jsNull(), for
966 * API/JSCallbackConstructor.cpp:
967 (KJS::JSCallbackConstructor::construct):
968 * API/JSCallbackFunction.cpp:
969 (KJS::JSCallbackFunction::callAsFunction):
970 * API/JSCallbackObject.cpp:
971 (KJS::JSCallbackObject::JSCallbackObject):
972 (KJS::JSCallbackObject::getOwnPropertySlot):
973 (KJS::JSCallbackObject::put):
974 (KJS::JSCallbackObject::construct):
975 (KJS::JSCallbackObject::callAsFunction):
976 (KJS::JSCallbackObject::staticFunctionGetter):
977 * API/JSCallbackObject.h:
978 * API/JSContextRef.cpp:
981 (JSNodePrototype_appendChild):
982 (JSNodePrototype_removeChild):
983 (JSNodePrototype_replaceChild):
984 * API/JSObjectRef.cpp:
986 (JSFunctionMakeWithBody):
987 (JSObjectGetProperty):
988 (JSObjectCallAsFunction):
989 (JSObjectCallAsConstructor):
995 (KJS::JSObject::JSObject):
997 2006-07-10 Geoffrey Garen <ggaren@apple.com>
999 Approved by Maciej, Darin.
1001 Renamed JSStringBufferRef to JSInternalStringRef. "Internal string" means the
1002 JavaScript engine's internal string representation, which is the most
1003 low-level and efficient representation to use when interfacing with JavaScript.
1009 * API/JSCallbackObject.cpp:
1010 (KJS::JSCallbackObject::getOwnPropertySlot):
1011 (KJS::JSCallbackObject::put):
1012 (KJS::JSCallbackObject::deleteProperty):
1013 (KJS::JSCallbackObject::staticValueGetter):
1014 (KJS::JSCallbackObject::callbackGetter):
1015 * API/JSContextRef.cpp:
1018 * API/JSContextRef.h:
1019 * API/JSInternalStringRef.cpp: Added.
1021 (JSInternalStringCreate):
1022 (JSInternalStringCreateUTF8):
1023 (JSInternalStringRetain):
1024 (JSInternalStringRelease):
1025 (JSValueCopyStringValue):
1026 (JSInternalStringGetLength):
1027 (JSInternalStringGetCharactersPtr):
1028 (JSInternalStringGetCharacters):
1029 (JSInternalStringGetMaxLengthUTF8):
1030 (JSInternalStringGetCharactersUTF8):
1031 (JSInternalStringIsEqual):
1032 (JSInternalStringIsEqualUTF8):
1033 (JSInternalStringCreateCF):
1034 (CFStringCreateWithJSInternalString):
1035 * API/JSInternalStringRef.h: Added.
1037 (JSNodePrototype_appendChild):
1038 (JSNode_getNodeType):
1039 (JSNode_getChildNodes):
1040 (JSNode_getFirstChild):
1042 (JSNodeList_length):
1043 (JSNodeList_getProperty):
1044 * API/JSObjectRef.cpp:
1045 (JSFunctionMakeWithBody):
1046 (JSObjectGetDescription):
1047 (JSObjectHasProperty):
1048 (JSObjectGetProperty):
1049 (JSObjectSetProperty):
1050 (JSObjectDeleteProperty):
1051 (JSPropertyEnumeratorGetNext):
1052 (JSPropertyListAdd):
1053 * API/JSObjectRef.h:
1054 * API/JSStringBufferRef.cpp: Removed.
1055 * API/JSStringBufferRef.h: Removed.
1057 * API/JavaScriptCore.h:
1062 (assertEqualsAsUTF8String):
1063 (assertEqualsAsCharactersPtr):
1064 (assertEqualsAsCharacters):
1065 (MyObject_hasProperty):
1066 (MyObject_getProperty):
1067 (MyObject_setProperty):
1068 (MyObject_deleteProperty):
1069 (MyObject_getPropertyList):
1070 (print_callAsFunction):
1071 (myConstructor_callAsConstructor):
1073 * JavaScriptCore.exp:
1074 * JavaScriptCore.xcodeproj/project.pbxproj:
1076 2006-07-08 Tim Omernick <timo@apple.com>
1080 Added an OpenGL drawing model to the Netscape Plug-in API.
1084 2006-07-08 Timothy Hatcher <timothy@apple.com>
1088 Moved KJS_GetCreatedJavaVMs to jni_utility.cpp.
1089 Switched KJS_GetCreatedJavaVMs over to use dlopen and dlsym
1090 now that NSAddImage, NSLookupSymbolInImage and NSAddressOfSymbol
1091 are deprecated in Leopard.
1093 * JavaScriptCore.exp:
1094 * JavaScriptCore.xcodeproj/project.pbxproj:
1095 * bindings/jni/jni_utility.cpp:
1096 (KJS::Bindings::KJS_GetCreatedJavaVMs):
1097 * bindings/softlinking.c: Removed.
1098 * bindings/softlinking.h: Removed.
1100 2006-07-08 Geoffrey Garen <ggaren@apple.com>
1104 - Make JSObjectGetProperty return a JSValue or NULL, like JSEvaluate does.
1106 * API/JSObjectRef.cpp:
1107 (JSObjectGetProperty):
1108 * API/JSObjectRef.h:
1112 2006-07-08 Geoffrey Garen <ggaren@apple.com>
1114 Style change -- no review necessary.
1116 Use 0 instead of NULL in API .cpp files, to match our style guidelines.
1118 * API/JSContextRef.cpp:
1120 * API/JSObjectRef.cpp:
1121 (JSFunctionMakeWithBody):
1122 (JSObjectCallAsFunction):
1123 (JSObjectCallAsConstructor):
1124 * API/JSValueRef.cpp:
1127 2006-07-08 Geoffrey Garen <ggaren@apple.com>
1131 - Added ability to pass NULL for thisObject when calling JSObjectCallAsFunction,
1132 to match JSEvaluate.
1134 * API/JSObjectRef.cpp:
1135 (JSObjectCallAsFunction):
1136 * API/JSObjectRef.h:
1140 === Safari-521.15 ===
1142 2006-07-07 Geoffrey Garen <ggaren@apple.com>
1146 - Standardized which functions take a JSContext as an argument. The rule is:
1147 if you might execute JavaScript, you take a JSContext, otherwise you don't.
1149 The FIXME in JSObjectRef.h requires refactoring some parts of Interpreter,
1150 but not API changes, so I'm putting it off until later.
1152 * API/JSCallbackObject.cpp:
1153 (KJS::JSCallbackObject::JSCallbackObject):
1154 (KJS::JSCallbackObject::init):
1155 * API/JSCallbackObject.h:
1156 * API/JSContextRef.cpp:
1158 * API/JSContextRef.h:
1159 * API/JSObjectRef.cpp:
1161 (JSPropertyEnumeratorGetNext):
1162 * API/JSObjectRef.h:
1164 (MyObject_initialize):
1166 * JavaScriptCore.exp:
1167 * kjs/array_object.cpp:
1168 (ArrayInstance::setLength):
1169 (ArrayInstance::pushUndefinedObjectsToEnd):
1171 (ForInNode::execute):
1172 * kjs/reference.cpp:
1173 (KJS::Reference::getPropertyName):
1174 (KJS::Reference::getValue):
1176 * kjs/scope_chain.cpp:
1177 (KJS::ScopeChain::print):
1179 2006-07-06 Geoffrey Garen <ggaren@apple.com>
1185 - Headerdoc finished
1188 - Added a JSContextRef argument to many functions, because you need a
1189 JSContextRef for doing virtually anything. I expect to add this argument
1190 to even more functions in a future patch.
1192 - Removed the globalObjectPrototype argument to JSContextCreate because
1193 you can't create an object until you have a context, so it's impossible
1194 to pass a prototype object to JSContextCreate. That's OK because (1) there's
1195 no reason to give the global object a prototype and (2) if you really want
1196 to, you can just use a separate call to JSObjectSetPrototype.
1198 - Removed the JSClassRef argument to JSClassCreate because it was unnecessary,
1199 and you need to be able to make the global object's class before you've
1200 created a JSContext.
1202 - Added an optional exception parameter to JSFunctionMakeWithBody because anything
1203 less would be uncivilized.
1205 - Made the return value parameter to JSObjectGetProperty optional to match
1206 all other return value parameters in the API.
1208 - Made JSObjectSetPrivate/JSObjectGetPrivate work on JSCallbackFunctions
1209 and JSCallbackConstructors. You could use an abstract base class or strategic
1210 placement of m_privateData in the class structure to implement this, but
1211 the former seemed like overkill, and the latter seemed too dangerous.
1213 - Fixed a bug where JSPropertyEnumeratorGetNext would skip the first property.
1216 - Reversed the logic of the JSChar #ifdef to avoid confusing headerdoc
1218 - Removed function names from @function declarations because headeroc
1219 can parse them automatically, and I wanted to rule out manual mismatch.
1221 - Changed Error::create to take a const UString& instead of a UString*
1222 because it was looking at me funny.
1224 - Renamed JSStringBufferCreateWithCFString to JSStringBufferCreateCF
1225 because the latter is more concise and it matches JSStringBufferCreateUTF8.
1227 * API/JSCallbackObject.cpp:
1228 (KJS::JSCallbackObject::getOwnPropertySlot):
1229 (KJS::JSCallbackObject::put):
1230 (KJS::JSCallbackObject::deleteProperty):
1231 (KJS::JSCallbackObject::getPropertyList):
1232 (KJS::JSCallbackObject::toBoolean):
1233 (KJS::JSCallbackObject::toNumber):
1234 (KJS::JSCallbackObject::toString):
1235 * API/JSClassRef.cpp:
1237 * API/JSContextRef.cpp:
1239 (JSContextSetException):
1240 * API/JSContextRef.h:
1242 (JSNodePrototype_class):
1245 (JSNodeListPrototype_class):
1247 * API/JSObjectRef.cpp:
1248 (JSObjectGetProperty):
1249 (JSObjectGetPrivate):
1250 (JSObjectSetPrivate):
1251 (JSObjectCallAsFunction):
1252 (JSObjectCallAsConstructor):
1253 (JSPropertyEnumeratorGetNext):
1254 * API/JSObjectRef.h:
1255 * API/JSStringBufferRef.cpp:
1256 (JSStringBufferCreateCF):
1257 * API/JSStringBufferRef.h:
1258 * API/JSValueRef.cpp:
1259 (JSValueIsInstanceOf):
1265 (MyObject_hasProperty):
1266 (MyObject_setProperty):
1267 (MyObject_deleteProperty):
1268 (MyObject_getPropertyList):
1269 (MyObject_convertToType):
1272 * JavaScriptCore.exp:
1274 2006-07-07 Geoffrey Garen <ggaren@apple.com>
1278 - Fixed a few crashes resulting from NULL parameters to JSClassCreate.
1280 * API/JSClassRef.cpp:
1283 * API/testapi.c: Added test for NULL parameters.
1286 2006-07-07 Geoffrey Garen <ggaren@apple.com>
1288 Reviewed by John, mocked by Darin.
1290 - Changed JSEvaluate to take a JSObjectRef instead of a JSValueRef as
1291 "this," since "this" must be an object.
1293 * API/JSContextRef.cpp:
1295 * API/JSContextRef.h:
1297 2006-07-07 Geoffrey Garen <ggaren@apple.com>
1304 * JavaScriptCore.xcodeproj/project.pbxproj:
1306 2006-07-05 Geoffrey Garen <ggaren@apple.com>
1310 Renamed JSCharBufferRef, which was universally unpopular, to JSStringBufferRef,
1311 which, hopefully, will be less unpopular.
1317 * API/JSCallbackObject.cpp:
1318 (KJS::JSCallbackObject::getOwnPropertySlot):
1319 (KJS::JSCallbackObject::put):
1320 (KJS::JSCallbackObject::deleteProperty):
1321 (KJS::JSCallbackObject::staticValueGetter):
1322 (KJS::JSCallbackObject::callbackGetter):
1323 * API/JSCharBufferRef.cpp: Removed.
1324 * API/JSCharBufferRef.h: Removed.
1325 * API/JSContextRef.cpp:
1328 * API/JSContextRef.h:
1330 (JSNodePrototype_appendChild):
1331 (JSNode_getNodeType):
1332 (JSNode_getChildNodes):
1333 (JSNode_getFirstChild):
1335 (JSNodeList_length):
1336 (JSNodeList_getProperty):
1337 * API/JSObjectRef.cpp:
1338 (JSFunctionMakeWithBody):
1339 (JSObjectGetDescription):
1340 (JSObjectHasProperty):
1341 (JSObjectGetProperty):
1342 (JSObjectSetProperty):
1343 (JSObjectDeleteProperty):
1344 (JSPropertyEnumeratorGetNext):
1345 (JSPropertyListAdd):
1346 * API/JSObjectRef.h:
1347 * API/JSStringBufferRef.cpp: Added.
1349 (JSStringBufferCreate):
1350 (JSStringBufferCreateUTF8):
1351 (JSStringBufferRetain):
1352 (JSStringBufferRelease):
1353 (JSValueCopyStringValue):
1354 (JSStringBufferGetLength):
1355 (JSStringBufferGetCharactersPtr):
1356 (JSStringBufferGetCharacters):
1357 (JSStringBufferGetMaxLengthUTF8):
1358 (JSStringBufferGetCharactersUTF8):
1359 (JSStringBufferIsEqual):
1360 (JSStringBufferIsEqualUTF8):
1361 (JSStringBufferCreateWithCFString):
1362 (CFStringCreateWithJSStringBuffer):
1363 * API/JSStringBufferRef.h: Added.
1365 * API/JavaScriptCore.h:
1370 (assertEqualsAsUTF8String):
1371 (assertEqualsAsCharactersPtr):
1372 (assertEqualsAsCharacters):
1373 (MyObject_hasProperty):
1374 (MyObject_getProperty):
1375 (MyObject_setProperty):
1376 (MyObject_deleteProperty):
1377 (MyObject_getPropertyList):
1378 (print_callAsFunction):
1379 (myConstructor_callAsConstructor):
1381 * JavaScriptCore.exp:
1382 * JavaScriptCore.xcodeproj/project.pbxproj:
1384 2006-07-05 Geoffrey Garen <ggaren@apple.com>
1388 Moved some code around for more logical file separation.
1391 * API/JSContextRef.h:
1392 * API/JSObjectRef.cpp:
1393 * API/JSValueRef.cpp:
1397 2006-07-03 Geoffrey Garen <ggaren@apple.com>
1401 Implemented JSFunctionMakeWithBody, which parses a script as a function body
1402 in the global scope, and returns the resulting anonymous function.
1404 I also removed private data from JSCallbackFunction. It never worked,
1405 since JSCallbackFunction doesn't inherit from JSCallbackObject.
1407 * API/JSCallbackConstructor.cpp: Removed.
1408 * API/JSCallbackConstructor.h: Removed.
1409 * API/JSCallbackFunction.cpp:
1410 (KJS::JSCallbackFunction::JSCallbackFunction):
1411 (KJS::JSCallbackFunction::implementsConstruct):
1412 (KJS::JSCallbackFunction::construct):
1413 (KJS::JSCallbackFunction::implementsCall):
1414 (KJS::JSCallbackFunction::callAsFunction):
1415 * API/JSCallbackFunction.h:
1416 * API/JSCallbackObject.cpp:
1417 (KJS::JSCallbackObject::staticFunctionGetter):
1418 * API/JSObjectRef.cpp:
1420 (JSFunctionMakeWithCallbacks):
1421 * API/JSObjectRef.h:
1427 * JavaScriptCore.exp: Programmatically added all symbols exported by
1428 API object files, and sorted results
1429 * JavaScriptCore.xcodeproj/project.pbxproj:
1431 2006-07-03 Geoffrey Garen <ggaren@apple.com>
1435 - Return syntax error in JSCheckSyntax through a JSValueRef* exception
1439 * API/JSContextRef.cpp:
1443 * JavaScriptCore.exp:
1444 * kjs/interpreter.cpp:
1445 (KJS::Interpreter::checkSyntax):
1446 * kjs/interpreter.h:
1448 2006-07-04 Darin Adler <darin@apple.com>
1452 * wtf/MathExtras.h: Oops. Added missing #endif.
1454 2006-07-04 Bjoern Graf <bjoern.graf@gmail.com>
1457 Tweaked a bit by Darin.
1459 - http://bugzilla.opendarwin.org/show_bug.cgi?id=9678
1460 work around MSVCRT's fmod function returning NaN for fmod(x, infinity) instead of x
1462 * wtf/MathExtras.h: Added include of <float.h>.
1463 (isinf): Fix to return false for NAN.
1464 (wtf_fmod): Added. An inline that works around the bug.
1467 * kjs/number_object.cpp:
1468 * kjs/operations.cpp:
1470 Added includes of MathExtras.h to all files using fmod.
1472 * JavaScriptCore.xcodeproj/project.pbxproj: Let Xcode 2.3 have its way with
1475 2006-07-01 Geoffrey Garen <ggaren@apple.com>
1479 - Refined value conversions in the API:
1480 - failed toNumber returns NaN
1481 - failed toObject returns NULL
1482 - failed toString returns empty string
1484 - Refined excpetion handling in the API:
1485 - failed value conversions do not throw exceptions
1486 - uncaught exceptions in JSEvaluate, JSObjectCallAsFunction, and
1487 JSObjectCallAsConstructor are returned through a JSValueRef* exception
1489 - removed JSContextHasException, because JSContextGetException does
1493 * API/JSCharBufferRef.cpp:
1494 (JSValueCopyStringValue):
1495 * API/JSContextRef.cpp:
1497 * API/JSContextRef.h:
1498 * API/JSNodeList.c: Added test code demonstrating how you would use
1499 toNumber, and why you probably don't need toUInt32, etc.
1500 (JSNodeListPrototype_item):
1501 (JSNodeList_getProperty):
1502 * API/JSObjectRef.cpp:
1504 (JSObjectCallAsFunction):
1505 (JSObjectCallAsConstructor):
1506 * API/JSObjectRef.h:
1507 * API/JSValueRef.cpp:
1513 (main): Added tests for new rules, and call to JSGCProtect to fix Intel
1515 * JavaScriptCore.exp:
1517 2006-07-03 Darin Adler <darin@apple.com>
1519 - Rolled out HashMap implementation of NPRuntime, at least temporarily.
1521 Fixes hang in the bindings section of layout tests seen on the
1524 This code was using HashMap<const char*, PrivateIdentifier*>.
1525 But that hashes based on pointer identity, not string value.
1526 The default hash for any pointer type is to hash based on the pointer.
1527 And WTF doesn't currently have a string hash for char*.
1528 We'll need to fix that before re-landing this patch.
1530 (Formatting was also incorrect -- extra spaces in parentheses.)
1532 * bindings/npruntime.cpp: Rolled out last change.
1534 2006-07-02 Justin Haygood <jhaygood@spsu.edu>
1536 Reviewed, tweaked, landed by ggaren.
1538 - Port NPRuntime from CFDictionary to HashMap.
1540 * bindings/npruntime.cpp:
1541 (getStringIdentifierDictionary):
1542 (getIntIdentifierDictionary):
1543 (_NPN_GetStringIdentifier):
1544 (_NPN_GetIntIdentifier):
1545 * bindings/npruntime.h:
1547 2006-07-01 Geoffrey Garen <ggaren@apple.com>
1551 - Fixed <rdar://problem/4611197> REGRESSION: Liveconnect with Java test
1552 fails at http://www-sor.inria.fr/~dedieu/notes/liveconnect/simple_example.html
1554 * JavaScriptCore.exp: Export symbols used by liveconnect
1556 2006-06-29 Geoffrey Garen <ggaren@apple.com>
1560 - Phase 2 in the JS API.
1562 - Added support for specifying static tables of values -- this should
1563 obviate the need for using complicated callbacks for most lookups.
1565 - API objects are now created with classes (JSClassRef) -- in order to support
1566 static values, and in order to prevent API objects from storing their
1567 data inline, and thus falling into the oversized (read: slow and prone to
1568 giving Maciej the frowny face) heap.
1570 - Added two specialized JSObject subclasses -- JSCallbackFunction and JSCallbackConstructor --
1571 to allow JSFunctionMake and JSConstructorMake to continue to work with
1572 the new class model. Another solution to this problem would be to create
1573 a custom class object for each function and constructor you make. This
1574 solution is more code but also more efficient.
1576 - Substantially beefed up the minidom example to demonstrate and test a
1577 lot of these techniques. Its output is still pretty haphazard, though.
1579 - Gave the <kjs/ preface to some includes -- I'm told this matters to
1580 building on some versions of Linux.
1582 - Implemented JSValueIsInstanceOf and JSValueIsObjectOfClass
1584 - Removed GetDescription callback. Something in the class datastructure
1585 should take care of this.
1588 * API/JSCallbackConstructor.cpp: Added.
1590 (KJS::JSCallbackConstructor::JSCallbackConstructor):
1591 (KJS::JSCallbackConstructor::implementsConstruct):
1592 (KJS::JSCallbackConstructor::construct):
1593 (KJS::JSCallbackConstructor::setPrivate):
1594 (KJS::JSCallbackConstructor::getPrivate):
1595 * API/JSCallbackConstructor.h: Added.
1596 (KJS::JSCallbackConstructor::classInfo):
1597 * API/JSCallbackFunction.cpp: Added.
1599 (KJS::JSCallbackFunction::JSCallbackFunction):
1600 (KJS::JSCallbackFunction::implementsCall):
1601 (KJS::JSCallbackFunction::callAsFunction):
1602 (KJS::JSCallbackFunction::setPrivate):
1603 (KJS::JSCallbackFunction::getPrivate):
1604 * API/JSCallbackFunction.h: Added.
1605 (KJS::JSCallbackFunction::classInfo):
1606 * API/JSCallbackObject.cpp:
1608 (KJS::JSCallbackObject::JSCallbackObject):
1609 (KJS::JSCallbackObject::init):
1610 (KJS::JSCallbackObject::~JSCallbackObject):
1611 (KJS::JSCallbackObject::className):
1612 (KJS::JSCallbackObject::getOwnPropertySlot):
1613 (KJS::JSCallbackObject::put):
1614 (KJS::JSCallbackObject::deleteProperty):
1615 (KJS::JSCallbackObject::implementsConstruct):
1616 (KJS::JSCallbackObject::construct):
1617 (KJS::JSCallbackObject::implementsCall):
1618 (KJS::JSCallbackObject::callAsFunction):
1619 (KJS::JSCallbackObject::getPropertyList):
1620 (KJS::JSCallbackObject::toBoolean):
1621 (KJS::JSCallbackObject::toNumber):
1622 (KJS::JSCallbackObject::toString):
1623 (KJS::JSCallbackObject::inherits):
1624 (KJS::JSCallbackObject::staticValueGetter):
1625 (KJS::JSCallbackObject::staticFunctionGetter):
1626 (KJS::JSCallbackObject::callbackGetter):
1627 * API/JSCallbackObject.h:
1628 * API/JSCharBufferRef.cpp:
1629 * API/JSClassRef.cpp: Added.
1633 * API/JSClassRef.h: Added.
1634 (StaticValueEntry::StaticValueEntry):
1635 (StaticFunctionEntry::StaticFunctionEntry):
1636 (__JSClass::__JSClass):
1637 * API/JSContextRef.cpp:
1640 * API/JSContextRef.h:
1641 * API/JSNode.c: Added.
1642 (JSNodePrototype_appendChild):
1643 (JSNodePrototype_removeChild):
1644 (JSNodePrototype_replaceChild):
1645 (JSNodePrototype_class):
1646 (JSNode_getNodeType):
1647 (JSNode_getChildNodes):
1648 (JSNode_getFirstChild):
1654 * API/JSNode.h: Added.
1655 * API/JSNodeList.c: Added.
1656 (JSNodeListPrototype_item):
1657 (JSNodeListPrototype_class):
1658 (JSNodeList_length):
1659 (JSNodeList_getProperty):
1660 (JSNodeList_finalize):
1662 (JSNodeList_prototype):
1664 * API/JSNodeList.h: Added.
1665 * API/JSObjectRef.cpp:
1668 (JSConstructorMake):
1669 (__JSPropertyEnumerator::__JSPropertyEnumerator):
1670 (JSObjectCreatePropertyEnumerator):
1671 (JSPropertyEnumeratorGetNext):
1672 (JSPropertyEnumeratorRetain):
1673 (JSPropertyEnumeratorRelease):
1674 * API/JSObjectRef.h:
1675 (__JSObjectCallbacks::):
1676 * API/JSValueRef.cpp:
1677 (JSValueIsObjectOfClass):
1678 (JSValueIsInstanceOf):
1680 * API/Node.c: Added.
1684 (Node_replaceChild):
1687 * API/Node.h: Added.
1688 * API/NodeList.c: Added.
1694 * API/NodeList.h: Added.
1698 (createStringWithContentsOfFile):
1701 (assertEqualsAsCharacters):
1702 (MyObject_getProperty):
1704 (myConstructor_callAsConstructor):
1707 * JavaScriptCore.xcodeproj/project.pbxproj:
1709 2006-06-26 Kevin Ollivier <kevino@theolliviers.com>
1711 Reviewed and tweaked by Darin.
1713 - Compile fixes for wx port / gcc 4.0.2
1715 * kjs/array_object.cpp:
1716 Added missing headers.
1719 gcc needs class prototypes before defining those classes as friend classes
1721 2006-06-30 Mike Emmel <mike.emmel@gmail.com>
1725 Compilation fixes for Linux/Gdk.
1727 * JavaScriptCore/kjs/interpreter.cpp: added include of signal.h
1728 * JavaScriptCore/kjs/ExecState.h: added missing class declaration
1729 * JavaScriptCore/kjs/ExecState.cpp: case wrong on include of context.h
1730 * JavaScriptCore/JavaScriptCoreSources.bkl: added Context.cpp and ExecState.cpp
1732 === Safari-521.14 ===
1734 2006-06-29 Maciej Stachowiak <mjs@apple.com>
1738 - add headerdoc comments to some of the new JS API headers
1743 2006-06-28 Timothy Hatcher <timothy@apple.com>
1745 Prefer the Stabs debugging symbols format until DWARF bugs are fixed.
1747 * JavaScriptCore.xcodeproj/project.pbxproj:
1749 2006-06-27 Timothy Hatcher <timothy@apple.com>
1753 <rdar://problem/4448350> Deprecated ObjC language API used in JavaScriptCore, WebCore, WebKit and WebBrowser
1755 Switch to the new ObjC 2 API, ifdefed the old code around OBJC_API_VERSION so it still works on Tiger.
1756 Removed the use of the old stringWithCString, switched to the new Tiger version that accepts an encoding.
1757 Lots of code style cleanup.
1759 * JavaScriptCore.xcodeproj/project.pbxproj:
1760 * bindings/objc/objc_class.h:
1761 * bindings/objc/objc_class.mm:
1762 (KJS::Bindings::ObjcClass::~ObjcClass):
1763 (KJS::Bindings::_createClassesByIsAIfNecessary):
1764 (KJS::Bindings::ObjcClass::classForIsA):
1765 (KJS::Bindings::ObjcClass::name):
1766 (KJS::Bindings::ObjcClass::methodsNamed):
1767 (KJS::Bindings::ObjcClass::fieldNamed):
1768 (KJS::Bindings::ObjcClass::fallbackObject):
1769 * bindings/objc/objc_header.h:
1770 * bindings/objc/objc_instance.h:
1771 * bindings/objc/objc_instance.mm:
1772 (ObjcInstance::ObjcInstance):
1773 (ObjcInstance::~ObjcInstance):
1774 (ObjcInstance::operator=):
1775 (ObjcInstance::begin):
1776 (ObjcInstance::end):
1777 (ObjcInstance::getClass):
1778 (ObjcInstance::invokeMethod):
1779 (ObjcInstance::invokeDefaultMethod):
1780 (ObjcInstance::setValueOfField):
1781 (ObjcInstance::supportsSetValueOfUndefinedField):
1782 (ObjcInstance::setValueOfUndefinedField):
1783 (ObjcInstance::getValueOfField):
1784 (ObjcInstance::getValueOfUndefinedField):
1785 (ObjcInstance::defaultValue):
1786 (ObjcInstance::stringValue):
1787 (ObjcInstance::numberValue):
1788 (ObjcInstance::booleanValue):
1789 (ObjcInstance::valueOf):
1790 * bindings/objc/objc_runtime.h:
1791 * bindings/objc/objc_runtime.mm:
1792 (ObjcMethod::ObjcMethod):
1794 (ObjcMethod::getMethodSignature):
1795 (ObjcMethod::setJavaScriptName):
1798 (ObjcField::valueFromInstance):
1799 (convertValueToObjcObject):
1800 (ObjcField::setValueToInstance):
1801 (ObjcArray::operator=):
1802 (ObjcArray::setValueAt):
1803 (ObjcArray::valueAt):
1804 (ObjcFallbackObjectImp::ObjcFallbackObjectImp):
1805 (ObjcFallbackObjectImp::callAsFunction):
1806 (ObjcFallbackObjectImp::defaultValue):
1808 2006-06-28 Anders Carlsson <acarlsson@apple.com>
1812 http://bugzilla.opendarwin.org/show_bug.cgi?id=8636
1813 REGRESSION: JavaScript access to Java applet causes hang (_webViewURL not implemented)
1815 * bindings/jni/jni_objc.mm:
1816 (KJS::Bindings::dispatchJNICall):
1817 Just pass nil as the calling URL. This will cause the Java plugin to use the URL of the page
1818 containing the applet (which is what we used to do).
1820 2006-06-27 Timothy Hatcher <timothy@apple.com>
1824 <rdar://problem/4406785> Add an export file to TOT JavaScriptCore like the Safari-2-0-branch
1826 * JavaScriptCore.exp: Added.
1827 * JavaScriptCore.xcodeproj/project.pbxproj:
1829 2006-06-25 Geoffrey Garen <ggaren@apple.com>
1833 - Added JSConstructorMake to match JSFunctionMake, along with test code.
1835 [ I checked in the ChangeLog before without the actual files. ]
1837 * API/JSObjectRef.cpp:
1838 (JSConstructorMake):
1839 * API/JSObjectRef.h:
1841 (myConstructor_callAsConstructor):
1845 * JavaScriptCore.xcodeproj/project.pbxproj: Moved testapi.c to the testapi
1846 target -- this was an oversight in my earlier check-in.
1848 2006-06-25 Timothy Hatcher <timothy@apple.com>
1852 Bug 9574: Drosera should show inline scripts within the original HTML
1853 http://bugzilla.opendarwin.org/show_bug.cgi?id=9574
1855 Pass the starting line number and error message to the debugger.
1858 (Debugger::sourceParsed):
1861 (KJS::GlobalFuncImp::callAsFunction):
1862 * kjs/function_object.cpp:
1863 (FunctionObjectImp::construct):
1864 * kjs/interpreter.cpp:
1865 (KJS::Interpreter::evaluate):
1867 2006-06-24 Alexey Proskuryakov <ap@nypop.com>
1869 Rubber-stamped by Eric.
1871 Add a -h (do not follow symlinks) option to ln in derived sources build script (without it,
1872 a symlink was created inside the source directory on second build).
1874 * JavaScriptCore.xcodeproj/project.pbxproj:
1876 2006-06-24 David Kilzer <ddkilzer@kilzer.net>
1878 Reviewed by Timothy.
1880 * Info.plist: Fixed copyright to include 2003-2006.
1882 2006-06-24 Alexey Proskuryakov <ap@nypop.com>
1886 - http://bugzilla.opendarwin.org/show_bug.cgi?id=9418
1887 WebKit will not build when Space exists in path
1889 * JavaScriptCore.xcodeproj/project.pbxproj: Enclose search paths in quotes; create symlinks to
1890 avoid passing paths with spaces to make.
1892 2006-06-23 Timothy Hatcher <timothy@apple.com>
1896 Adding more operator[] overloads for long and short types.
1899 (WTF::Vector::operator[]):
1901 === JavaScriptCore-521.13 ===
1903 2006-06-22 Alexey Proskuryakov <ap@nypop.com>
1907 - http://bugzilla.opendarwin.org/show_bug.cgi?id=9539
1908 Another case error preventing build
1910 * API/JSObjectRef.cpp: Changed "identifier.h" to "Identifier.h"
1912 2006-06-22 David Kilzer <ddkilzer@kilzer.net>
1916 http://bugzilla.opendarwin.org/show_bug.cgi?id=9539
1917 Another case error preventing build
1919 * API/APICast.h: Changed "UString.h" to "ustring.h".
1921 2006-06-21 Geoffrey Garen <ggaren@apple.com>
1923 Fixed release build, fixed accidental infinite recursion due to
1924 last minute global replace gone awry.
1929 (assertEqualsAsBoolean):
1930 (assertEqualsAsNumber):
1931 (assertEqualsAsUTF8String):
1932 (assertEqualsAsCharactersPtr):
1933 * JavaScriptCore.xcodeproj/project.pbxproj:
1935 2006-06-21 Geoffrey Garen <ggaren@apple.com>
1939 - First cut at C API to JavaScript. Includes a unit test, 'testapi.c',
1940 and the outline of a test app, 'minidom.c'.
1942 Includes one change to JSC internals: Rename propList to getPropertyList and have it
1943 take its target property list by reference so that subclasses can
1944 add properties to the list before calling through to their superclasses.
1946 Also, I just ran prepare-ChangeLog in about 10 seconds, and I would like
1947 to give a shout-out to that.
1949 * API/APICast.h: Added.
1952 * API/JSBase.h: Added.
1953 * API/JSCallbackObject.cpp: Added.
1955 (KJS::JSCallbackObject::JSCallbackObject):
1956 (KJS::JSCallbackObject::~JSCallbackObject):
1957 (KJS::JSCallbackObject::className):
1958 (KJS::JSCallbackObject::getOwnPropertySlot):
1959 (KJS::JSCallbackObject::put):
1960 (KJS::JSCallbackObject::deleteProperty):
1961 (KJS::JSCallbackObject::implementsConstruct):
1962 (KJS::JSCallbackObject::construct):
1963 (KJS::JSCallbackObject::implementsCall):
1964 (KJS::JSCallbackObject::callAsFunction):
1965 (KJS::JSCallbackObject::getPropertyList):
1966 (KJS::JSCallbackObject::toBoolean):
1967 (KJS::JSCallbackObject::toNumber):
1968 (KJS::JSCallbackObject::toString):
1969 (KJS::JSCallbackObject::setPrivate):
1970 (KJS::JSCallbackObject::getPrivate):
1971 (KJS::JSCallbackObject::cachedValueGetter):
1972 (KJS::JSCallbackObject::callbackGetter):
1973 * API/JSCallbackObject.h: Added.
1974 (KJS::JSCallbackObject::classInfo):
1975 * API/JSCharBufferRef.cpp: Added.
1977 (JSCharBufferCreate):
1978 (JSCharBufferCreateUTF8):
1979 (JSCharBufferRetain):
1980 (JSCharBufferRelease):
1981 (JSValueCopyStringValue):
1982 (JSCharBufferGetLength):
1983 (JSCharBufferGetCharactersPtr):
1984 (JSCharBufferGetCharacters):
1985 (JSCharBufferGetMaxLengthUTF8):
1986 (JSCharBufferGetCharactersUTF8):
1987 (JSCharBufferIsEqual):
1988 (JSCharBufferIsEqualUTF8):
1989 (JSCharBufferCreateWithCFString):
1990 (CFStringCreateWithJSCharBuffer):
1991 * API/JSCharBufferRef.h: Added.
1992 * API/JSContextRef.cpp: Added.
1995 (JSContextGetGlobalObject):
1998 (JSContextHasException):
1999 (JSContextGetException):
2000 (JSContextClearException):
2001 (JSContextSetException):
2002 * API/JSContextRef.h: Added.
2003 * API/JSObjectRef.cpp: Added.
2007 (JSObjectGetDescription):
2008 (JSObjectGetPrototype):
2009 (JSObjectSetPrototype):
2010 (JSObjectHasProperty):
2011 (JSObjectGetProperty):
2012 (JSObjectSetProperty):
2013 (JSObjectDeleteProperty):
2014 (JSObjectGetPrivate):
2015 (JSObjectSetPrivate):
2016 (JSObjectIsFunction):
2017 (JSObjectCallAsFunction):
2018 (JSObjectIsConstructor):
2019 (JSObjectCallAsConstructor):
2020 (__JSPropertyListEnumerator::__JSPropertyListEnumerator):
2021 (JSObjectCreatePropertyEnumerator):
2022 (JSPropertyEnumeratorGetNext):
2023 (JSPropertyEnumeratorRetain):
2024 (JSPropertyEnumeratorRelease):
2025 (JSPropertyListAdd):
2026 * API/JSObjectRef.h: Added.
2027 * API/JSValueRef.cpp: Added.
2029 (JSValueIsUndefined):
2036 (JSValueIsStrictEqual):
2046 * API/JSValueRef.h: Added.
2047 * API/JavaScriptCore.h: Added.
2048 * API/minidom.c: Added.
2050 * API/minidom.html: Added.
2051 * API/minidom.js: Added.
2052 * API/testapi.c: Added.
2053 (assertEqualsAsBoolean):
2054 (assertEqualsAsNumber):
2055 (assertEqualsAsUTF8String):
2056 (assertEqualsAsCharactersPtr):
2057 (assertEqualsAsCharacters):
2058 (MyObject_initialize):
2059 (MyObject_copyDescription):
2060 (MyObject_hasProperty):
2061 (MyObject_getProperty):
2062 (MyObject_setProperty):
2063 (MyObject_deleteProperty):
2064 (MyObject_getPropertyList):
2065 (MyObject_callAsFunction):
2066 (MyObject_callAsConstructor):
2067 (MyObject_convertToType):
2068 (MyObject_finalize):
2069 (print_callAsFunction):
2071 (createStringWithContentsOfFile):
2072 * API/testapi.js: Added.
2074 * JavaScriptCore.xcodeproj/project.pbxproj:
2075 * bindings/npruntime_impl.h:
2076 * kjs/array_instance.h:
2077 * kjs/array_object.cpp:
2078 (ArrayInstance::getPropertyList):
2079 * kjs/interpreter.cpp:
2080 (KJS::Interpreter::evaluate):
2082 (ForInNode::execute):
2084 (KJS::JSObject::put):
2085 (KJS::JSObject::canPut):
2086 (KJS::JSObject::deleteProperty):
2087 (KJS::JSObject::propertyIsEnumerable):
2088 (KJS::JSObject::getPropertyAttributes):
2089 (KJS::JSObject::getPropertyList):
2091 * kjs/property_map.cpp:
2092 (KJS::PropertyMap::get):
2093 * kjs/property_map.h:
2094 * kjs/scope_chain.cpp:
2095 (KJS::ScopeChain::print):
2096 * kjs/string_object.cpp:
2097 (StringInstance::getPropertyList):
2098 * kjs/string_object.h:
2100 (KJS::UString::Rep::ref):
2102 2006-06-20 Timothy Hatcher <timothy@apple.com>
2106 Make sure we clear the exception before returning so
2107 that future calls will not fail because of an earlier
2108 exception state. Assert on entry that the WebScriptObject
2109 is working with an ExecState that dose not have an exception.
2110 Document that evaluateWebScript and callWebScriptMethod return
2111 WebUndefined when an exception is thrown.
2113 * bindings/objc/WebScriptObject.h:
2114 * bindings/objc/WebScriptObject.mm:
2115 (-[WebScriptObject callWebScriptMethod:withArguments:]):
2116 (-[WebScriptObject evaluateWebScript:]):
2117 (-[WebScriptObject setValue:forKey:]):
2118 (-[WebScriptObject valueForKey:]):
2119 (-[WebScriptObject removeWebScriptKey:]):
2120 (-[WebScriptObject webScriptValueAtIndex:]):
2121 (-[WebScriptObject setWebScriptValueAtIndex:value:]):
2123 2006-06-19 Anders Carlsson <acarlsson@apple.com>
2127 * kjs/interpreter.cpp:
2128 (KJS::TimeoutChecker::pauseTimeoutCheck):
2129 (KJS::TimeoutChecker::resumeTimeoutCheck):
2130 Fix argument order in setitimer calls.
2132 2006-06-18 Anders Carlsson <acarlsson@apple.com>
2136 * kjs/interpreter.cpp:
2137 (KJS::TimeoutChecker::pauseTimeoutCheck):
2138 Do nothing if the timeout check hasn't been started.
2140 (KJS::TimeoutChecker::resumeTimeoutCheck):
2141 Do nothing if the timeout check hasn't been started.
2142 Use the right signal handler when unblocking.
2144 (KJS::Interpreter::handleTimeout):
2145 pause/resume the timeout check around the call to
2146 shouldInterruptScript().
2148 2006-06-16 Ben Goodger <beng@google.com>
2152 http://bugzilla.opendarwin.org/show_bug.cgi?id=9491
2153 Windows build breaks in interpreter.cpp
2155 * kjs/interpreter.cpp
2156 (KJS::TimeoutChecker::pauseTimeoutCheck):
2157 (KJS::TimeoutChecker::resumeTimeoutCheck):
2158 Make sure to only assert equality with s_executingInterpreter when it
2159 is being used (i.e. when HAVE(SYS_TIME_H) == true)
2161 2006-06-17 David Kilzer <ddkilzer@kilzer.net>
2165 http://bugzilla.opendarwin.org/show_bug.cgi?id=9477
2166 REGRESSION: fast/dom/replaceChild.html crashes on WebKit ToT in debug build
2169 (KJS::FunctionImp::callAsFunction): Refetch the debugger after executing the function
2170 in case the WebFrame it was running in has since been destroyed.
2172 2006-06-17 David Kilzer <ddkilzer@kilzer.net>
2176 http://bugzilla.opendarwin.org/show_bug.cgi?id=9476
2177 REGRESSION: Reproducible crash after closing window after viewing
2178 css2.1/t0803-c5501-imrgn-t-00-b-ag.html
2181 (Debugger::detach): Call setDebugger(0) for all interpreters removed from
2182 the 'attached to a debugger' list.
2184 2006-06-17 Anders Carlsson <acarlsson@apple.com>
2186 Reviewed by Maciej and Geoff.
2188 http://bugzilla.opendarwin.org/show_bug.cgi?id=7080
2189 Provide some way to stop a JavaScript infinite loop
2193 Add Interrupted completion type.
2196 (KJS::FunctionImp::callAsFunction):
2197 (KJS::GlobalFuncImp::callAsFunction):
2198 Only set the exception on the new ExecState if the current one has had one.
2200 * kjs/interpreter.cpp:
2201 (KJS::TimeoutChecker::startTimeoutCheck):
2202 (KJS::TimeoutChecker::stopTimeoutCheck):
2203 (KJS::TimeoutChecker::alarmHandler):
2204 (KJS::TimeoutChecker::pauseTimeoutCheck):
2205 (KJS::TimeoutChecker::resumeTimeoutCheck):
2206 New TimeoutChecker class which handles setting Interpreter::m_timedOut flag after a given
2207 period of time. This currently only works on Unix platforms where setitimer and signals are used.
2209 (KJS::Interpreter::Interpreter):
2210 Initialize new member variables.
2212 (KJS::Interpreter::~Interpreter):
2213 Destroy the timeout checker.
2215 (KJS::Interpreter::startTimeoutCheck):
2216 (KJS::Interpreter::stopTimeoutCheck):
2217 (KJS::Interpreter::pauseTimeoutCheck):
2218 (KJS::Interpreter::resumeTimeoutCheck):
2219 Call the timeout checker.
2221 (KJS::Interpreter::handleTimeout):
2222 Called on timeout. Resets the m_timedOut flag and calls shouldInterruptScript.
2224 * kjs/interpreter.h:
2225 (KJS::Interpreter::setTimeoutTime):
2226 New function for setting the timeout time.
2228 (KJS::Interpreter::shouldInterruptScript):
2229 New function. The idea is that this should be overridden by subclasses in order to for example
2230 pop up a dialog asking the user if the script should be interrupted.
2232 (KJS::Interpreter::checkTimeout):
2233 New function which checks the m_timedOut flag and calls handleTimeout if it's set.
2236 (DoWhileNode::execute):
2237 (WhileNode::execute):
2239 Call Interpreter::checkTimeout after each iteration of the loop.
2241 2006-06-15 Timothy Hatcher <timothy@apple.com>
2243 Reviewed by Geoff and Darin.
2245 Prefer the DWARF debugging symbols format for use in Xcode 2.3.
2247 * JavaScriptCore.xcodeproj/project.pbxproj:
2249 2006-06-14 Geoffrey Garen <ggaren@apple.com>
2253 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=9438
2254 Someone broke ToT: cannot build
2256 * JavaScriptCore.xcodeproj/project.pbxproj:
2257 * bindings/runtime_root.h: Changed "Interpreter.h" to "interpreter.h"
2259 2006-06-12 Geoffrey Garen <ggaren@apple.com>
2263 * bindings/objc/WebScriptObject.mm:
2264 (+[WebScriptObject throwException:]): Restore assignment I accidentally
2265 deleted in previous commit
2267 2006-06-12 Geoffrey Garen <ggaren@apple.com>
2269 Reviewed by TimO, Maciej.
2271 - Merged InterpreterImp code into Interpreter, which implements
2272 all interpreter functionality now. This is part of my continuing quest
2273 to create an external notion of JS "execution context" that is unified and simple --
2274 something to replace the mix of Context, ContextImp, ExecState, Interpreter,
2275 InterpreterImp, and JSRun.
2277 All tests pass. Leaks test has not regressed from its baseline ~207 leaks
2278 with ~3460 leaked nodes.
2280 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2281 * JavaScriptCore.xcodeproj/project.pbxproj:
2282 * bindings/NP_jsobject.cpp:
2283 * bindings/objc/WebScriptObject.mm:
2284 (+[WebScriptObject throwException:]):
2285 * bindings/runtime_root.cpp:
2286 * bindings/runtime_root.h:
2288 (KJS::Context::Context):
2289 * kjs/ExecState.cpp: Added.
2290 (KJS::ExecState::lexicalInterpreter):
2291 * kjs/ExecState.h: Added.
2292 (KJS::ExecState::dynamicInterpreter):
2293 * kjs/SavedBuiltins.h: Added.
2294 * kjs/bool_object.cpp:
2295 (BooleanPrototype::BooleanPrototype):
2296 * kjs/collector.cpp:
2297 (KJS::Collector::collect):
2298 (KJS::Collector::numInterpreters):
2304 (KJS::FunctionImp::callAsFunction):
2305 (KJS::GlobalFuncImp::callAsFunction):
2306 * kjs/function_object.cpp:
2307 (FunctionObjectImp::construct):
2310 * kjs/interpreter.cpp:
2311 (KJS::interpreterMap):
2312 (KJS::Interpreter::Interpreter):
2313 (KJS::Interpreter::init):
2314 (KJS::Interpreter::~Interpreter):
2315 (KJS::Interpreter::globalObject):
2316 (KJS::Interpreter::initGlobalObject):
2317 (KJS::Interpreter::globalExec):
2318 (KJS::Interpreter::checkSyntax):
2319 (KJS::Interpreter::evaluate):
2320 (KJS::Interpreter::builtinObject):
2321 (KJS::Interpreter::builtinFunction):
2322 (KJS::Interpreter::builtinArray):
2323 (KJS::Interpreter::builtinBoolean):
2324 (KJS::Interpreter::builtinString):
2325 (KJS::Interpreter::builtinNumber):
2326 (KJS::Interpreter::builtinDate):
2327 (KJS::Interpreter::builtinRegExp):
2328 (KJS::Interpreter::builtinError):
2329 (KJS::Interpreter::builtinObjectPrototype):
2330 (KJS::Interpreter::builtinFunctionPrototype):
2331 (KJS::Interpreter::builtinArrayPrototype):
2332 (KJS::Interpreter::builtinBooleanPrototype):
2333 (KJS::Interpreter::builtinStringPrototype):
2334 (KJS::Interpreter::builtinNumberPrototype):
2335 (KJS::Interpreter::builtinDatePrototype):
2336 (KJS::Interpreter::builtinRegExpPrototype):
2337 (KJS::Interpreter::builtinErrorPrototype):
2338 (KJS::Interpreter::builtinEvalError):
2339 (KJS::Interpreter::builtinRangeError):
2340 (KJS::Interpreter::builtinReferenceError):
2341 (KJS::Interpreter::builtinSyntaxError):
2342 (KJS::Interpreter::builtinTypeError):
2343 (KJS::Interpreter::builtinURIError):
2344 (KJS::Interpreter::builtinEvalErrorPrototype):
2345 (KJS::Interpreter::builtinRangeErrorPrototype):
2346 (KJS::Interpreter::builtinReferenceErrorPrototype):
2347 (KJS::Interpreter::builtinSyntaxErrorPrototype):
2348 (KJS::Interpreter::builtinTypeErrorPrototype):
2349 (KJS::Interpreter::builtinURIErrorPrototype):
2350 (KJS::Interpreter::mark):
2351 (KJS::Interpreter::interpreterWithGlobalObject):
2352 (KJS::Interpreter::saveBuiltins):
2353 (KJS::Interpreter::restoreBuiltins):
2354 * kjs/interpreter.h:
2355 (KJS::Interpreter::setCompatMode):
2356 (KJS::Interpreter::compatMode):
2357 (KJS::Interpreter::firstInterpreter):
2358 (KJS::Interpreter::nextInterpreter):
2359 (KJS::Interpreter::prevInterpreter):
2360 (KJS::Interpreter::debugger):
2361 (KJS::Interpreter::setDebugger):
2362 (KJS::Interpreter::setContext):
2363 (KJS::Interpreter::context):
2365 (StatementNode::hitStatement):
2366 (RegExpNode::evaluate):
2369 2006-06-12 Geoffrey Garen <ggaren@apple.com>
2373 - Have *.lut.h files #include lookup.h to eliminate surprising header
2374 include order dependency.
2376 * DerivedSources.make:
2377 * kjs/array_object.cpp:
2378 * kjs/date_object.cpp:
2379 * kjs/date_object.h:
2380 (KJS::DateProtoFunc::):
2382 * kjs/math_object.cpp:
2383 * kjs/number_object.cpp:
2384 * kjs/regexp_object.cpp:
2385 * kjs/string_object.cpp:
2387 2006-06-10 Geoffrey Garen <ggaren@apple.com>
2389 - http://bugzilla.opendarwin.org/show_bug.cgi?id=8515
2390 Linux porting compile bug
2392 Fix by Mike Emmel, Reviewed by Darin.
2394 * JavaScriptCoreSources.bkl:
2398 2006-06-09 Geoffrey Garen <ggaren@apple.com>
2400 Build fix -- I think :).
2402 * JavaScriptCore.xcodeproj/project.pbxproj:
2405 2006-06-09 Geoffrey Garen <ggaren@apple.com>
2407 Reviewed by Eric (yay!).
2409 - Removed Context wrapper for ContextImp, renamed ContextImp to Context,
2410 split Context into its own file -- Context.cpp -- renamed _var to m_var,
2411 change ' *' to '* '.
2413 * JavaScriptCore.xcodeproj/project.pbxproj:
2414 * kjs/Context.cpp: Added.
2415 (KJS::Context::Context):
2416 (KJS::Context::~Context):
2417 (KJS::Context::mark):
2419 (KJS::Context::scopeChain):
2420 (KJS::Context::variableObject):
2421 (KJS::Context::setVariableObject):
2422 (KJS::Context::thisValue):
2423 (KJS::Context::callingContext):
2424 (KJS::Context::activationObject):
2425 (KJS::Context::currentBody):
2426 (KJS::Context::function):
2427 (KJS::Context::arguments):
2428 (KJS::Context::pushScope):
2429 (KJS::Context::seenLabels):
2431 (KJS::FunctionImp::callAsFunction):
2432 (KJS::FunctionImp::processParameters):
2433 (KJS::FunctionImp::argumentsGetter):
2434 (KJS::GlobalFuncImp::callAsFunction):
2436 (KJS::InterpreterImp::evaluate):
2438 (KJS::InterpreterImp::setContext):
2439 (KJS::InterpreterImp::context):
2440 * kjs/interpreter.cpp:
2441 * kjs/interpreter.h:
2442 (KJS::ExecState::context):
2443 (KJS::ExecState::ExecState):
2447 (ThisNode::evaluate):
2448 (ResolveNode::evaluate):
2449 (FunctionCallResolveNode::evaluate):
2450 (PostfixResolveNode::evaluate):
2451 (DeleteResolveNode::evaluate):
2452 (TypeOfResolveNode::evaluate):
2453 (PrefixResolveNode::evaluate):
2454 (AssignResolveNode::evaluate):
2455 (VarDeclNode::evaluate):
2456 (VarDeclNode::processVarDecls):
2457 (DoWhileNode::execute):
2458 (WhileNode::execute):
2460 (ForInNode::execute):
2461 (ContinueNode::execute):
2462 (BreakNode::execute):
2463 (ReturnNode::execute):
2464 (WithNode::execute):
2465 (SwitchNode::execute):
2466 (LabelNode::execute):
2468 (FuncDeclNode::processFuncDecl):
2469 (FuncExprNode::evaluate):
2471 2006-06-07 Geoffrey Garen <ggaren@apple.com>
2473 Removed API directory I prematurely/accidentally added.
2477 2006-06-05 Mitz Pettel <opendarwin.org@mitzpettel.com>
2479 Reviewed and landed by Geoff.
2481 - fix a regression in ecma_3/String/regress-104375.js
2483 * kjs/string_object.cpp:
2484 (substituteBackreferences): If a 2-digit back reference is out of range,
2485 parse it as a 1-digit reference (followed by the other digit). This matches
2488 2006-06-05 Geoffrey Garen <ggaren@apple.com>
2491 Darin already reviewed this change on the branch. See <rdar://problem/4317701>.
2493 - Fixed <rdar://problem/4291345> PCRE overflow in Safari JavaScriptCore
2495 No test case because there's no behavior change.
2497 * pcre/pcre_compile.c:
2498 (read_repeat_counts): Check for integer overflow / out of bounds
2500 2006-06-05 Geoffrey Garen <ggaren@apple.com>
2504 - Changed CString length from int to size_t. We sould probably do this
2505 for UString, too. (Darin, if you're reading this: Maciej said so.)
2510 (KJS::CString::CString):
2513 (KJS::CString::size):
2515 2006-06-04 Geoffrey Garen <ggaren@apple.com>
2519 - http://bugzilla.opendarwin.org/show_bug.cgi?id=9304
2520 Minor cleanup in JavaScriptCore
2522 * kjs/value.h: Removed redundant declarations
2524 2006-06-04 Darin Adler <darin@apple.com>
2528 - changed deleteAllValues so it can work on "const" collections
2529 Deleting the values affects the values, not the pointers in the
2530 collection, so it's legitimate to do it to a const collection,
2531 and a case of that actually came up in the XPath code.
2534 (WTF::deleteAllPairSeconds): Use const iterators.
2535 (WTF::deleteAllValues): Take const HashMap reference as a parameter.
2537 (WTF::deleteAllValues): Take const HashSet reference as a parameter,
2538 and use const iterators.
2540 (WTF::deleteAllValues): Take const Vector reference as a parameter.
2542 - added more functions that are present in <math.h> on some platforms,
2543 but not on others; moved here from various files in WebCore
2554 2006-06-02 Mitz Pettel <opendarwin.org@mitzpettel.com>
2558 - http://bugzilla.opendarwin.org/show_bug.cgi?id=9234
2559 Implement $&, $' and $` replacement codes in String.prototype.replace
2561 Test: fast/js/string-replace-3.html
2563 * kjs/string_object.cpp:
2564 (substituteBackreferences): Added support for $& (matched substring),
2565 $` (everything preceding matched substring), $' (everything following
2566 matched substring) and 2-digit back references, and cleaned up a little.
2568 2006-06-02 Adele Peterson <adele@apple.com>
2572 Set incremental linking to no. This seems to fix a build problem I was seeing
2573 where dftables couldn't find a dll.
2575 * JavaScriptCore.vcproj/dftables/dftables.vcproj:
2577 2006-05-26 Steve Falkenburg <sfalken@apple.com>
2581 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2583 === JavaScriptCore-521.11 ===
2585 2006-05-24 Geoffrey Garen <ggaren@apple.com>
2589 - JSC half of fix for <rdar://problem/4557926> TOT REGRESSSION: Crash
2590 occurs when attempting to view image in slideshow mode at
2591 http://d.smugmug.com/gallery/581716 ( KJS::IfNode::execute
2592 (KJS::ExecState*) + 312)
2594 On alternate threads, DOMObjects remain in the
2595 ScriptInterpreter's cache because they're not collected. So, they
2596 need an opportunity to mark their children.
2598 I'm not particularly happy with this solution because it fails to
2599 resolve many outstanding issues with the DOM object cache. Since none
2600 of those issues is a crasher or a serious compatibility concern,
2601 and since the behavior of other browsers is not much to go on in this
2602 case, I've filed <rdar://problem/4561439> about that, and I'm moving on
2605 * JavaScriptCore.xcodeproj/project.pbxproj:
2606 * kjs/collector.cpp:
2607 (KJS::Collector::collect):
2609 (KJS::InterpreterImp::mark):
2611 * kjs/interpreter.cpp:
2612 (KJS::Interpreter::mark):
2613 * kjs/interpreter.h:
2615 === JavaScriptCore-521.10 ===
2617 2006-05-22 Timothy Hatcher <timothy@apple.com>
2619 Reviewed by Eric, Kevin and Geoff.
2621 Merge open source build fixes. <rdar://problem/4555500>
2623 * kjs/collector.cpp: look at the rsp register in x86_64
2624 (KJS::Collector::markOtherThreadConservatively):
2625 * wtf/Platform.h: add x86_64 to the platform list
2627 2006-05-19 Anders Carlsson <acarlsson@apple.com>
2631 http://bugzilla.opendarwin.org/show_bug.cgi?id=8993
2632 Support function declaration in case statements
2634 * kjs/grammar.y: Get rid of StatementList and use SourceElements instead.
2637 (CaseClauseNode::evalStatements):
2638 (CaseClauseNode::processVarDecls):
2639 (CaseClauseNode::processFuncDecl):
2640 (ClauseListNode::processFuncDecl):
2641 (CaseBlockNode::processFuncDecl):
2642 (SwitchNode::processFuncDecl):
2644 (KJS::CaseClauseNode::CaseClauseNode):
2645 (KJS::ClauseListNode::ClauseListNode):
2646 (KJS::ClauseListNode::getClause):
2647 (KJS::ClauseListNode::getNext):
2648 (KJS::ClauseListNode::releaseNext):
2649 (KJS::SwitchNode::SwitchNode):
2650 Add processFuncDecl for the relevant nodes.
2652 * kjs/nodes2string.cpp:
2653 (CaseClauseNode::streamTo):
2654 next got renamed to source.
2656 2006-05-17 George Staikos <staikos@kde.org>
2658 Reviewed by Maciej, Alexey, and Eric.
2660 * pcre/pcre_compile.c:
2663 * wtf/UnusedParam.h:
2664 Use /**/ in .c files to compile with non-C99 and non-GCC compilers.
2667 Change include to <wtf/HashTraits.h> from "HashTraits.h" to avoid -I
2669 * wtf/unicode/qt4/UnicodeQt4.h:
2670 Use correct parentheses and correct mask for utf-32 support.
2672 2006-05-17 Alexey Proskuryakov <ap@nypop.com>
2676 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8870
2677 Crash typing in Yahoo auto-complete widget.
2679 Test: fast/js/regexp-stack-overflow.html
2681 * pcre/pcre-config.h: Define NO_RECURSE.
2683 2006-05-16 George Staikos <staikos@kde.org>
2687 Fix some warnings and strict compilation errors.
2692 2006-05-15 Alexey Proskuryakov <ap@nypop.com>
2694 * make-generated-sources.sh: Changed to be executable and removed
2695 text in the file generated by "svn diff".
2697 2006-05-15 Geoffrey Garen <ggaren@apple.com>
2701 - Fixed <rdar://problem/4534904> please do not treat "debugger" as
2702 a reserved word while parsing JavaScript (and other ECMA reserved
2707 http://bugzilla.opendarwin.org/show_bug.cgi?id=6179
2708 We treat "char" as a reserved word in JavaScript and firefox/IE do
2711 (1) I unreserved most of the spec's "future reserved words" because
2712 they're not reserved in IE or FF. (Most, but not all, because IE
2713 somewhat randomly *does* reserve a few of them.)
2714 (2) I made 'debugger' a legitimate statement that acts like an empty
2715 statement because FF and IE support it.
2718 * kjs/keywords.table:
2720 2006-05-15 Tim Omernick <timo@apple.com>
2722 Reviewed by John Sullivan.
2724 Part of <rdar://problem/4466508> Add 64-bit support to the Netscape Plugin API
2726 Added to the Netscape Plugin API the concept of "plugin drawing models". The drawing model
2727 determines the kind of graphics context created by the browser for the plugin, as well as
2728 the Mac types of various Netscape Plugin API data structures.
2730 There is a drawing model to represent the old QuickDraw-based API. It is used by default
2731 if QuickDraw is available on the system, unless the plugin specifies another drawing model.
2733 The big change is the addition of the CoreGraphics drawing model. A plugin may request this
2734 drawing model to obtain access to a CGContextRef for drawing, instead of a QuickDraw CGrafPtr.
2737 Define NP_NO_QUICKDRAW when compiling 64-bit; there is no 64-bit QuickDraw.
2738 Added NPNVpluginDrawingModel, NPNVsupportsQuickDrawBool, and NPNVsupportsCoreGraphicsBool
2740 Added NPDrawingModel enumeration. Currently the only drawing models are QuickDraw and
2742 NPRegion's type now depends on the drawing model specified by the plugin.
2743 NP_Port is now only defined when QuickDraw is available.
2744 Added NP_CGContext, which is the type of the NPWindow's "window" member in CoreGraphics mode.
2746 2006-05-13 Kevin M. Ollivier <kevino@theolliviers.com>
2748 Reviewed by Darin, landed by ap.
2750 - http://bugzilla.opendarwin.org/show_bug.cgi?id=8528
2751 Bakefiles (and generated Makefiles) for wx and gdk ports
2753 * make-generated-sources.sh:
2754 Added script to configure environment to run DerivedSources.make
2756 * JavaScriptCoreSources.bkl:
2757 Added JavaScriptCore sources list for Bakefile.
2760 Bakefile used to generate JavaScriptCore project files
2761 (currently only used by wx and gdk ports)
2763 2006-05-09 Steve Falkenburg <sfalken@apple.com>
2766 Minor fixes to WTF headers.
2770 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Fix include dirs, paths to files.
2771 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj: Fix include dirs.
2772 * wtf/Assertions.h: include Platform.h to get definition for COMPILER()
2773 * wtf/Vector.h: include FastMalloc.h for definition of fastMalloc, fastFree
2775 2006-05-09 Maciej Stachowiak <mjs@apple.com>
2777 Rubber stamped by Anders.
2779 - renamed kxmlcore to wtf
2785 * JavaScriptCore.xcodeproj/project.pbxproj:
2786 * bindings/c/c_instance.cpp:
2787 * bindings/objc/WebScriptObject.mm:
2788 * kjs/JSImmediate.h:
2791 * kjs/array_object.cpp:
2792 * kjs/collector.cpp:
2793 (KJS::Collector::registerThread):
2797 (KJS::isStrWhiteSpace):
2799 * kjs/identifier.cpp:
2804 (Lexer::isWhiteSpace):
2805 (Lexer::isIdentStart):
2806 (Lexer::isIdentPart):
2810 * kjs/number_object.cpp:
2812 * kjs/property_map.cpp:
2813 * kjs/property_map.h:
2814 * kjs/string_object.cpp:
2815 (StringProtoFunc::callAsFunction):
2820 * kxmlcore: Removed.
2821 * kxmlcore/AlwaysInline.h: Removed.
2822 * kxmlcore/Assertions.cpp: Removed.
2823 * kxmlcore/Assertions.h: Removed.
2824 * kxmlcore/FastMalloc.cpp: Removed.
2825 * kxmlcore/FastMalloc.h: Removed.
2826 * kxmlcore/FastMallocInternal.h: Removed.
2827 * kxmlcore/Forward.h: Removed.
2828 * kxmlcore/HashCountedSet.h: Removed.
2829 * kxmlcore/HashFunctions.h: Removed.
2830 * kxmlcore/HashMap.h: Removed.
2831 * kxmlcore/HashSet.h: Removed.
2832 * kxmlcore/HashTable.cpp: Removed.
2833 * kxmlcore/HashTable.h: Removed.
2834 * kxmlcore/HashTraits.h: Removed.
2835 * kxmlcore/ListRefPtr.h: Removed.
2836 * kxmlcore/Noncopyable.h: Removed.
2837 * kxmlcore/OwnArrayPtr.h: Removed.
2838 * kxmlcore/OwnPtr.h: Removed.
2839 * kxmlcore/PassRefPtr.h: Removed.
2840 * kxmlcore/Platform.h: Removed.
2841 * kxmlcore/RefPtr.h: Removed.
2842 * kxmlcore/TCPageMap.h: Removed.
2843 * kxmlcore/TCSpinLock.h: Removed.
2844 * kxmlcore/TCSystemAlloc.cpp: Removed.
2845 * kxmlcore/TCSystemAlloc.h: Removed.
2846 * kxmlcore/UnusedParam.h: Removed.
2847 * kxmlcore/Vector.h: Removed.
2848 * kxmlcore/VectorTraits.h: Removed.
2849 * kxmlcore/unicode: Removed.
2850 * kxmlcore/unicode/Unicode.h: Removed.
2851 * kxmlcore/unicode/UnicodeCategory.h: Removed.
2852 * kxmlcore/unicode/icu: Removed.
2853 * kxmlcore/unicode/icu/UnicodeIcu.h: Removed.
2854 * kxmlcore/unicode/posix: Removed.
2855 * kxmlcore/unicode/qt3: Removed.
2856 * kxmlcore/unicode/qt4: Removed.
2857 * kxmlcore/unicode/qt4/UnicodeQt4.h: Removed.
2860 * wtf/Assertions.cpp:
2862 * wtf/FastMalloc.cpp:
2863 (WTF::TCMalloc_ThreadCache::Scavenge):
2866 (WTF::TCMallocGuard::TCMallocGuard):
2873 * wtf/FastMallocInternal.h:
2875 * wtf/HashCountedSet.h:
2876 * wtf/HashFunctions.h:
2879 * wtf/HashTable.cpp:
2883 * wtf/Noncopyable.h:
2884 * wtf/OwnArrayPtr.h:
2888 * wtf/TCSystemAlloc.cpp:
2889 (TCMalloc_SystemAlloc):
2891 * wtf/VectorTraits.h:
2892 * wtf/unicode/UnicodeCategory.h:
2893 * wtf/unicode/icu/UnicodeIcu.h:
2895 2006-05-08 Timothy Hatcher <timothy@apple.com>
2899 * bindings/npapi.h: do not define #pragma options align=mac68k if we are 64-bit
2901 2006-05-07 Darin Adler <darin@apple.com>
2903 Reviewed and landed by Maciej.
2905 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8765
2906 Random crashes on TOT since the form state change
2908 I haven't figured out how to construct a test for this, but this does seem to fix the
2909 problem; Mitz mentioned that a double-destroy was occurring in these functions.
2911 * kxmlcore/HashMap.h: (KXMLCore::HashMap::remove): Use RefCounter::deref instead of calling
2912 ~ValueType, because ~ValueType often results in a double-destroy, since the HashTable also
2913 destroys the element based on the storage type. The RefCounter template correctly does work
2914 only in cases where ValueType and ValueStorageType differ and this class is what's used
2915 elsewhere for the same purpose; I somehow missed this case when optimizing HashMap.
2916 * kxmlcore/HashSet.h: (KXMLCore::HashSet::remove): Ditto.
2918 2006-05-05 Darin Adler <darin@apple.com>
2920 - http://bugzilla.opendarwin.org/show_bug.cgi?id=8722
2921 IE compatibility fix in date parsing
2923 * kjs/date_object.cpp: (KJS::parseDate): Merged change that George Staikos provided
2924 from KDE 3.4.3 branch that allows day values of 0 and values that are > 1000.
2926 2006-05-04 Anders Carlsson <andersca@mac.com>
2930 http://bugzilla.opendarwin.org/show_bug.cgi?id=8734
2931 Would like a Vector::append that takes another Vector
2933 * kxmlcore/Vector.h:
2934 (KXMLCore::::append):
2935 New function that takes another array.
2937 2006-05-02 Steve Falkenburg <sfalken@apple.com>
2941 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: set NDEBUG for release build
2942 * kxmlcore/FastMalloc.cpp: Prevent USE_SYSTEM_MALLOC from being defined twice
2944 2006-05-02 Anders Carlsson <andersca@mac.com>
2948 * kxmlcore/HashMap.h:
2949 (KXMLCore::::operator):
2952 2006-05-01 Tim Omernick <timo@apple.com>
2954 Reviewed by Tim Hatcher.
2956 <rdar://problem/4476875> Support printing for embedded Netscape plugins
2959 Fixed struct alignment problem in our npapi.h. Structs must be 68k-aligned on both pre-Mac OS X
2960 and Mac OS X systems, as this is what plugins expect.
2962 2006-05-01 Timothy Hatcher <timothy@apple.com>
2966 <rdar://problem/4308243> 8F36 Regression: crash in malloc_consolidate if you use a .PAC file
2968 The original fix missed the oversized cell case. Added a test for "currentThreadIsMainThread ||
2969 imp->m_destructorIsThreadSafe" where we collect oversized cells.
2971 We don't have a way to test PAC files yet, so there's no test attached.
2973 * kjs/collector.cpp:
2974 (KJS::Collector::collect): test the thread when we collect oversized cells
2976 2006-05-01 Tim Omernick <timo@apple.com>
2980 <rdar://problem/4526114> REGRESSION (two days ago): LOG() just prints @ for NSObject substitutions
2982 * kxmlcore/Assertions.cpp:
2983 Changed sense of strstr("%@") check. I already made the same fix to the WebBrowser assertions.
2985 2006-04-28 Steve Falkenburg <sfalken@apple.com>
2989 Actually apply the change that was reviewed insted of checking it in with an #if 0 (oops).
2992 (main): Suppress C runtime alerts
2994 2006-04-28 Steve Falkenburg <sfalken@apple.com>
2998 Suppress error reporting dialog that blocks Javascript tests from completing.
3000 Real error is due to an overflow in the date/time handling functions that needs
3001 to be addressed, but this will prevent the hang running the Javascript tests
3002 on the build bot (along with the related changes).
3005 (main): Suppress C runtime alerts
3007 2006-04-27 Geoffrey Garen <ggaren@apple.com>
3011 - Minor fixups I discovered while working on the autogenerator.
3014 (findEntry): ASSERT that size is not 0, because otherwise we'll % by 0,
3015 compute a garbage address, and possibly crash.
3017 (cacheGlobalObject): Don't enumerate cached objects -- ideally, they
3018 would be hidden entirely.
3020 2006-04-21 Kevin M. Ollivier <kevino@theolliviers.com>
3024 - http://bugzilla.opendarwin.org/show_bug.cgi?id=8507
3025 Compilation fixes for building on gcc 4.0.2, and without precomp headers
3028 * kxmlcore/Assertions.cpp:
3029 * kxmlcore/FastMalloc.cpp:
3030 Added necessary headers to resolve compilation issues when not using
3031 precompiled headers.
3033 * kjs/value.h: Declare the JSCell class before friend declaration
3034 to resolve compilation issues with gcc 4.0.2.
3036 * kxmlcore/Platform.h: Set Unicode support to use ICU on platforms
3037 other than KDE (previously only defined for Win and Mac OS)
3039 2006-04-18 Eric Seidel <eseidel@apple.com>
3043 Fix "new Function()" to correctly use lexical scoping.
3044 Add ScopeChain::print() function for debugging.
3045 <rdar://problem/4067864> REGRESSION (125-407): JavaScript failure on PeopleSoft REN Server
3047 * kjs/function_object.cpp:
3048 (FunctionObjectImp::construct):
3049 * kjs/scope_chain.cpp:
3050 (KJS::ScopeChain::print):
3051 * kjs/scope_chain.h:
3053 2006-04-14 James G. Speth <speth@end.com>
3055 Reviewed by Timothy.
3057 Bug 8389: support for Cocoa bindings - binding an NSTreeController to the WebView's DOM
3058 http://bugzilla.opendarwin.org/show_bug.cgi?id=8389
3060 Adds a category to WebScriptObject with array accessors for KVC/KVO.
3062 If super valueForKey: fails it will call valueForUndefinedKey:, which is
3063 important because it causes the right behavior to happen with bindings using
3064 the "Raises for Not Applicable Keys" flag and the "Not Applicable Placeholder"
3066 * bindings/objc/WebScriptObject.mm:
3067 (-[WebScriptObject valueForKey:]):
3068 (-[WebScriptObject count]):
3069 (-[WebScriptObject objectAtIndex:]):
3070 (-[WebUndefined description]): return "undefined"
3072 2006-04-13 Geoffrey Garen <ggaren@apple.com>
3077 (KJS::InterpreterImp::initGlobalObject): Add the built-in object
3078 prototype to the end of the global object's prototype chain instead of
3079 just blowing away its existing prototype. We need to do this because
3080 the window object has a meaningful prototype now.
3082 2006-04-13 Maciej Stachowiak <mjs@apple.com>
3086 - fix testkjs to not show false-positive KJS::Node leaks in debug builds
3092 2006-04-11 Geoffrey Garen <ggaren@apple.com>
3096 Minor code cleanup -- passes all the JS tests.
3098 * kjs/object_object.cpp:
3099 (ObjectObjectImp::construct):
3100 (ObjectObjectImp::callAsFunction):
3102 2006-04-11 Darin Adler <darin@apple.com>
3104 - another attempt to fix Windows build -- Vector in Forward.h was not working
3106 * kxmlcore/Forward.h: Remove Vector.
3107 * kxmlcore/Vector.h: Add back default arguments, remove include of
3110 2006-04-11 Darin Adler <darin@apple.com>
3112 - try to fix Windows build -- HashForward.h was not working
3114 * kxmlcore/HashForward.h: Removed.
3116 * JavaScriptCore.xcodeproj/project.pbxproj: Remove HashForward.h.
3117 * kjs/collector.h: Remove use of HashForward.h.
3118 * kxmlcore/HashCountedSet.h: Remove include of HashForward.h, restore
3120 * kxmlcore/HashMap.h: Ditto.
3121 * kxmlcore/HashSet.h: Ditto.
3123 2006-04-11 David Harrison <harrison@apple.com>
3127 - fixed clean build, broken by Darin's check-in
3129 * kjs/date_object.cpp: Add needed include of lookup.h.
3130 * kjs/regexp_object.cpp: Move include of .lut.h file below other includes.
3132 2006-04-10 Darin Adler <darin@apple.com>
3134 Rubber-stamped by John Sullivan.
3136 - switched from a shell script to a makefile for generated files
3137 - removed lots of unneeded includes
3138 - added new Forward.h and HashForward.h headers that allow compiling with
3139 fewer unneeded templates
3141 * DerivedSources.make: Added.
3142 * generate-derived-sources: Removed.
3143 * JavaScriptCore.xcodeproj/project.pbxproj: Added new files, changed to use
3144 DerivedSources.make.
3146 * kxmlcore/Forward.h: Added.
3147 * kxmlcore/HashForward.h: Added.
3149 * kxmlcore/HashCountedSet.h: Include HashForward for default args.
3150 * kxmlcore/HashMap.h: Ditto.
3151 * kxmlcore/HashSet.h: Ditto.
3155 Moved KJS_MAX_STACK into the .cpp file.
3157 * bindings/NP_jsobject.cpp:
3158 * bindings/c/c_instance.h:
3159 * bindings/jni/jni_class.h:
3160 * bindings/jni/jni_runtime.h:
3161 * bindings/jni/jni_utility.h:
3162 * bindings/objc/WebScriptObject.mm:
3163 * bindings/objc/WebScriptObjectPrivate.h:
3164 * bindings/objc/objc_class.h:
3165 * bindings/objc/objc_class.mm:
3166 * bindings/objc/objc_instance.h:
3167 * bindings/objc/objc_instance.mm:
3168 * bindings/objc/objc_runtime.mm:
3169 * bindings/objc/objc_utility.mm:
3170 * bindings/runtime.h:
3171 * bindings/runtime_array.cpp:
3172 * bindings/runtime_array.h:
3173 * bindings/runtime_method.cpp:
3174 * bindings/runtime_method.h:
3175 * bindings/runtime_object.cpp:
3176 * bindings/runtime_root.h:
3177 * kjs/JSImmediate.cpp:
3179 * kjs/array_object.cpp:
3180 * kjs/array_object.h:
3181 * kjs/bool_object.cpp:
3182 * kjs/bool_object.h:
3186 * kjs/error_object.h:
3187 * kjs/function_object.h:
3190 * kjs/math_object.cpp:
3191 * kjs/math_object.h:
3194 * kjs/number_object.cpp:
3195 * kjs/number_object.h:
3196 * kjs/object_object.cpp:
3197 * kjs/operations.cpp:
3198 * kjs/protected_reference.h:
3200 * kjs/reference_list.h:
3201 * kjs/regexp_object.h:
3202 * kjs/string_object.cpp:
3203 * kjs/string_object.h:
3207 * kxmlcore/HashTable.h:
3208 * kxmlcore/ListRefPtr.h:
3209 * kxmlcore/TCPageMap.h:
3210 * kxmlcore/Vector.h:
3211 Removed unneeded header includes.
3213 2006-04-09 Geoffrey Garen <ggaren@apple.com>
3217 - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=8284
3218 prevent unnecessary entries in the "nodes with extra refs" hash table
3220 This patch switches manually RefPtr exchange with use of
3221 RefPtr::release to ensure that a node's ref count never tops 1
3222 (in the normal case).
3225 (BlockNode::BlockNode):
3226 (CaseBlockNode::CaseBlockNode):
3228 (KJS::ArrayNode::ArrayNode):
3229 (KJS::ObjectLiteralNode::ObjectLiteralNode):
3230 (KJS::ArgumentsNode::ArgumentsNode):
3231 (KJS::VarStatementNode::VarStatementNode):
3232 (KJS::ForNode::ForNode):
3233 (KJS::CaseClauseNode::CaseClauseNode):
3234 (KJS::FuncExprNode::FuncExprNode):
3235 (KJS::FuncDeclNode::FuncDeclNode):
3237 2006-04-08 Alexey Proskuryakov <ap@nypop.com>
3241 One more attempt - use reinterpret_cast, rather than static_cast.
3243 2006-04-08 Alexey Proskuryakov <ap@nypop.com>
3247 An attempt to fix Win32 build - ICU uses wchar_t on Windows, so we need a type cast.
3249 * kxmlcore/unicode/icu/UnicodeIcu.h:
3250 (KXMLCore::Unicode::toLower):
3251 (KXMLCore::Unicode::toUpper):
3253 2006-04-08 Alexey Proskuryakov <ap@nypop.com>
3257 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8264
3258 toLowerCase and toUpperCase don't honor special mappings
3260 Test: fast/js/string-capitalization.html
3262 * JavaScriptCore.xcodeproj/project.pbxproj: Added KXMLCore::Unicode headers to the project.
3263 * icu/unicode/putil.h: Added (copied from WebCore).
3264 * icu/unicode/uiter.h: Ditto.
3265 * icu/unicode/ustring.h: Ditto.
3266 * kjs/string_object.cpp:
3267 (StringProtoFunc::callAsFunction): Use the new KXMLCore::Unicode::toUpper() and toLower().
3268 * kjs/ustring.cpp: Removed unused (and evil) UChar::toLower() and toUpper().
3269 * kjs/ustring.h: Ditto.
3271 * kxmlcore/unicode/Unicode.h: Corrected capitalization of the word Unicode.
3272 * kxmlcore/unicode/UnicodeCategory.h: Renamed include guard macro to match file name.
3274 * kxmlcore/unicode/icu/UnicodeIcu.h:
3275 (KXMLCore::Unicode::toLower): Work on strings, not individual characters. Use ICU root locale.
3276 (KXMLCore::Unicode::toUpper): Ditto.
3277 (KXMLCore::Unicode::isFormatChar): Use int32_t, which can hold a complete code point.
3278 (KXMLCore::Unicode::isSeparatorSpace): Ditto.
3279 (KXMLCore::Unicode::category): Ditto.
3280 * kxmlcore/unicode/qt4/UnicodeQt4.h:
3281 (KXMLCore::Unicode::toLower): Work on strings, not individual characters.
3282 (KXMLCore::Unicode::toUpper): Ditto.
3283 (KXMLCore::Unicode::isFormatChar): Use int32_t, which can hold a complete code point.
3284 (KXMLCore::Unicode::isSeparatorSpace): Ditto.
3285 (KXMLCore::Unicode::category): Ditto.
3287 * tests/mozilla/ecma/String/15.5.4.12-1.js: Corrected expected results.
3288 * tests/mozilla/ecma/String/15.5.4.12-5.js: Corrected expected results.
3290 2006-04-05 Darin Adler <darin@apple.com>
3292 - attempt to fix Windows build
3294 * kxmlcore/HashMap.h: (KXMLCore::HashMap::remove): Use (*it). instead of it->.
3295 * kxmlcore/HashSet.h: (KXMLCore::HashSet::remove): Ditto.
3297 2006-04-05 Darin Adler <darin@apple.com>
3299 - attempt to fix Windows build
3301 * os-win32/stdint.h: Add int8_t, uint8_t, int64_t.
3303 2006-04-05 Darin Adler <darin@apple.com>
3307 - fix memory leak introduced by the previous change
3309 * kxmlcore/HashTable.h: Specialize NeedsRef so that it correctly returns true when
3310 the value in question is a pair where one of the pair needs a ref and the other
3311 of the pair does not.
3313 2006-04-05 Darin Adler <darin@apple.com>
3317 - JavaScriptCore part of fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=8049
3318 StringImpl hash traits deleted value creates an init routine for WebCore
3319 <rdar://problem/4442248> REGRESSION: WebCore has init routines (8049)
3321 Change HashMap and HashSet implementation so they fold various types together.
3322 This allows us to implement maps and sets that use RefPtr<WebCore::StringImpl>
3323 and WebCore::String in terms of the underlying raw pointer type, and hence use
3324 -1 for the deleted value.
3326 * kxmlcore/HashTraits.h: Added a new type to HashTraits, StorageTraits, which is a
3327 type to be used when storing a value that has the same layout as the type itself.
3328 This is used only for non-key cases. In the case of keys, the hash function must also
3329 be considered. Moved emptyValue out of GenericHashTraitsBase into GenericHashTraits.
3330 Added a new bool to HashTraits, needsRef, which indicates whether the type needs
3331 explicit reference counting. If the type itself has needsRef true, but the storage
3332 type has needsRef false, then the HashSet or HashMap has to handle the reference
3333 counting explicitly. Added hash trait specializations for all signed integer values
3334 that give -1 as the deleted value. Gave all integers StorageTraits of the canonical
3335 integer type of the same size so int and long will share code. Gave all pointers and
3336 RefPtrs StorageTraits of the appropriately sized integer type. Removed redundant
3337 TraitType and emptyValue definitions in the pointer specialization for HashTraits.
3338 Added PairBaseHashTraits, which doesn't try to set up needsDestruction and deletedValue.
3339 Useful for types where we don't want to force the existence of deletedValue, such as
3340 the type of a pair in a HashMap which is not the actual storage type. Removed an
3341 unneeded parameter from the DeletedValueAssigner template. Added HashKeyStorageTraits
3342 template, which determines what type can be used to store a given hash key type with
3343 a given hash function, and specialized it for pointers and RefPtr so that pointer
3344 hash tables share an underlying HashTable that uses IntHash.
3346 * kxmlcore/HashTable.h: Added HashTableConstIteratorAdapter, HashTableIteratorAdapter,
3347 NeedsRef, RefCountManagerBase, RefCountManager, HashTableRefCountManagerBase, and
3348 HashTableRefCountManager. All are used by both HashSet and HashMap to handle hash
3349 tables where the type stored is not the same as the real value type.
3351 * kxmlcore/HashFunctions.h: Added a new struct named IntTypes that finds an
3352 integer type given a sizeof value. Renamed pointerHash to intHash and made it
3353 use overloading and take integer parameters. Added an IntHash struct which is
3354 a hash function that works for integers. Changed PtrHash to call IntHash with
3355 an appropriately sized integer. Made IntHash the default hash function for
3356 many integer types. Made PtrHash the default hash function for RefPtr as well
3357 as for raw pointers.
3359 * kxmlcore/HashSet.h: Changed implementation to use a separate "storage type"
3360 derived from the new traits. The HashTable will use the storage type and all
3361 necessary translation and ref/deref is done at the HashSet level. Also reorganized
3362 the file so that the HashSet is at the top and has no inline implementation inside
3363 it so it's easy to read the interface to HashSet.
3365 * kxmlcore/HashMap.h: Changed implementation to use a separate "storage type"
3366 derived from the new traits. The HashTable will use the storage type and all
3367 necessary translation and ref/deref is done at the HashMap level. Also reorganized
3368 the file so that the HashMap is at the top and has no inline implementation inside
3369 it so it's easy to read the interface to HashMap.
3371 * kxmlcore/HashMapPtrSpec.h: Removed. Superceded by optimizations in HashMap itself.
3373 * JavaScriptCore.xcodeproj/project.pbxproj: Remove HashMapPtrSpec.h, resort files,
3374 and also remove some unnecessary build settings from the aggregate target that
3375 generates derived sources.
3376 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Ditto.
3378 2006-04-04 Timothy Hatcher <timothy@apple.com>
3382 The Debug and Release frameworks are now built with install paths relative to the build products directory.
3383 This removes the need for other projects to build with -framework WebCore and -framework JavaScriptCore.
3385 * JavaScriptCore.xcodeproj/project.pbxproj:
3387 2006-04-04 Eric Seidel <eseidel@apple.com>
3392 Disable ASSERT redefinition warnings for now.
3394 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
3395 * kxmlcore/Assertions.h:
3397 2006-04-04 Bjrn Graf <bjoern.graf@gmail.com>
3399 Reviewed by ggaren & darin. Landed by eseidel.
3401 Integrate CURL version of gettimeofday
3402 http://bugzilla.opendarwin.org/show_bug.cgi?id=7399
3403 Disable crash report dialogs for testkjs.exe in Release mode
3404 http://bugzilla.opendarwin.org/show_bug.cgi?id=8113
3409 (StopWatch::getElapsedMS):
3413 2006-04-04 Eric Seidel <eseidel@apple.com>
3417 * kjs/number_object.cpp:
3418 (NumberProtoFunc::callAsFunction): remove trunc() to fix win32.
3420 2006-03-12 Maciej Stachowiak <mjs@apple.com>
3424 - fixed "toPrecision sometimes messes up the last digit on intel Macs"
3425 http://bugzilla.opendarwin.org/show_bug.cgi?id=7748
3427 * kjs/number_object.cpp:
3428 (intPow10): Compute integer powers of 10 using exponentiation by squaring.
3429 (NumberProtoFunc::callAsFunction): Use intPow10(n) in place of all pow(10.0, n),
3430 plus a bit of refactoring.
3432 2006-04-03 Darin Adler <darin@apple.com>
3434 - tweak config.h and Platform.h to try to get buildbot working
3435 (making some small changes at the same time)
3437 * kjs/config.h: Removed now-unneeded HAVE_ICU.
3438 * kxmlcore/Platform.h: Tweak how platform gets set up. Move all the
3439 USE stuff to the end.
3441 2006-04-03 George Staikos <staikos@opensource.apple.com>
3445 Fix Win32 build breakage from previous commit, remove unused forward.
3447 2006-04-03 George Staikos <staikos@opensource.apple.com>
3451 Implement a unicode abstraction layer to make JavaScriptCore much more
3452 easily ported to other platforms without having to take in libicu. Also
3453 makes the unicode related code easier to understand.
3455 2006-04-03 Timothy Hatcher <timothy@apple.com>
3459 Fixes <rdar://problem/4498338> JavaScriptCore fails to compile for ppc64
3460 Other 64 bit build fixes.
3462 * kjs/collector.cpp:
3463 (KJS::Collector::markOtherThreadConservatively): test for __DARWIN_UNIX03 and use __r1
3465 (Bigint::): cast PRIVATE_mem to unsigned to prevent warning
3466 * bindings/jni/jni_utility.cpp:
3467 (KJS::Bindings::getJavaVM): cast jniError to long to prevent format warning
3468 (KJS::Bindings::getJNIEnv): cast jniError to long to prevent format warning
3469 * bindings/runtime_root.cpp:
3470 (KJS::Bindings::addNativeReference): cast CFDictionaryGetValue to unsigned long to prevent warning
3471 (KJS::Bindings::removeNativeReference): cast CFDictionaryGetValue to unsigned long to prevent warning
3473 2006-03-31 Darin Adler <darin@apple.com>
3477 - <rdar://problem/4395622> API: WebScriptObject.h incorrectly reports that -isSelectorExcludedFromWebScript returns NO by default
3479 * bindings/objc/WebScriptObject.h: Fixed comment.
3481 2006-03-31 Eric Seidel <eseidel@apple.com>
3485 A bit more code cleanup.
3487 * bindings/c/c_utility.cpp:
3488 (KJS::Bindings::convertValueToNPVariant):
3489 * bindings/objc/objc_runtime.mm:
3490 (convertValueToObjcObject):
3491 * bindings/objc/objc_utility.mm:
3492 (KJS::Bindings::convertValueToObjcValue):
3494 (KJS::GlobalFuncImp::callAsFunction):
3495 * kjs/interpreter.cpp:
3496 (KJS::ExecState::lexicalInterpreter):
3497 * kjs/interpreter.h:
3498 * kjs/operations.cpp:
3501 2006-03-30 Eric Seidel <eseidel@apple.com>
3505 Small code-style update.
3507 * kjs/operations.cpp:
3520 2006-03-31 Anders Carlsson <andersca@mac.com>
3524 Make sure the GetterSetterImp objects are marked as well.
3527 (KJS::GetterSetterImp::mark):
3528 Call JSCell::mark().
3530 2006-03-30 Eric Seidel <eseidel@apple.com>