1 2006-08-23 David Hyatt <hyatt@apple.com>
3 Fix Platform.h to include #defines for graphics features.
7 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
10 2006-08-23 Anders Carlsson <acarlsson@apple.com>
14 Make the bindings compile without CoreFoundation.
16 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
17 * bindings/c/c_instance.cpp:
18 * bindings/c/c_utility.cpp:
19 (KJS::Bindings::convertUTF8ToUTF16):
21 * bindings/runtime.cpp:
22 (KJS::Bindings::Instance::createBindingForLanguageInstance):
23 (KJS::Bindings::Instance::createLanguageInstanceForValue):
24 * bindings/runtime_root.cpp:
25 * bindings/runtime_root.h:
26 * kjs/interpreter.cpp:
27 (KJS::Interpreter::createLanguageInstanceForValue):
30 2006-08-22 Anders Carlsson <acarlsson@apple.com>
34 Move the npruntime code over to using HashMap and the runtime_root code over to using
35 HashMap and HashCountedSet.
37 * bindings/NP_jsobject.cpp:
38 * bindings/c/c_utility.cpp:
39 (KJS::Bindings::identifierFromNPIdentifier):
40 * bindings/c/c_utility.h:
41 * bindings/jni/jni_jsobject.cpp:
42 (JavaJSObject::invoke):
43 * bindings/npruntime.cpp:
44 (getStringIdentifierMap):
45 (getIntIdentifierMap):
46 (_NPN_GetStringIdentifier):
47 (_NPN_GetIntIdentifier):
48 * bindings/runtime_root.cpp:
49 (getReferencesByRootMap):
51 (KJS::Bindings::findReferenceSet):
52 (KJS::Bindings::rootForImp):
53 (KJS::Bindings::rootForInterpreter):
54 (KJS::Bindings::addNativeReference):
55 (KJS::Bindings::removeNativeReference):
56 (RootObject::removeAllNativeReferences):
57 * bindings/runtime_root.h:
59 2006-08-22 Anders Carlsson <acarlsson@apple.com>
63 Switch over the NPAPI and Java bindings to using HashMaps instead of dictionaries.
65 * JavaScriptCore.xcodeproj/project.pbxproj:
66 * bindings/c/c_class.cpp:
67 (KJS::Bindings::CClass::CClass):
68 (KJS::Bindings::CClass::~CClass):
69 (KJS::Bindings::CClass::classForIsA):
70 (KJS::Bindings::CClass::methodsNamed):
71 (KJS::Bindings::CClass::fieldNamed):
72 * bindings/c/c_class.h:
73 * bindings/jni/jni_class.cpp:
74 (JavaClass::JavaClass):
75 (JavaClass::~JavaClass):
76 (JavaClass::methodsNamed):
77 (JavaClass::fieldNamed):
78 * bindings/jni/jni_class.h:
79 * bindings/objc/objc_class.h:
80 * bindings/objc/objc_class.mm:
81 (KJS::Bindings::deleteMethod):
82 (KJS::Bindings::deleteField):
84 (KJS::Bindings::ObjcClass::methodsNamed):
85 (KJS::Bindings::ObjcClass::fieldNamed):
86 * bindings/runtime.cpp:
88 * bindings/runtime_object.cpp:
89 (RuntimeObjectImp::fieldGetter):
90 (RuntimeObjectImp::getOwnPropertySlot):
91 (RuntimeObjectImp::put):
92 (RuntimeObjectImp::canPut):
94 2006-08-21 Vladimir Olexa <vladimir.olexa@gmail.com>
98 http://bugzilla.opendarwin.org/show_bug.cgi?id=6252
99 JavaScript 1.6 Array.lastIndexOf
101 Test: fast/js/array-lastIndexOf.html
103 * kjs/array_object.cpp:
104 (ArrayProtoFunc::callAsFunction): Added a LastIndexOf case.
105 * kjs/array_object.h:
106 (KJS::ArrayProtoFunc::): Added LastIndexOf to enum.
107 * tests/mozilla/expected.html: Two more tests now pass.
109 2006-08-20 Nikolas Zimmermann <zimmermann@kde.org>
111 Reviewed by Maciej. Landed by rwlbuis.
113 Fixes parts of: http://bugzilla.opendarwin.org/show_bug.cgi?id=10463
114 WebKit should have Qt platform support
116 Removing obsolete QConstString/QString constructors in kjs code.
121 2006-08-17 Nikolas Zimmermann <zimmermann@kde.org>
123 Reviewed by Maciej. Landed by rwlbuis.
125 Fixes: http://bugzilla.opendarwin.org/show_bug.cgi?id=10463
126 WTF Changes needed for Qt platform code.
129 * wtf/unicode/UnicodeDecomposition.h: Added.
131 * wtf/unicode/UnicodeDirection.h: Added.
133 * wtf/unicode/qt4/UnicodeQt4.cpp: Added.
134 (WTF::Unicode::direction):
135 (WTF::Unicode::category):
136 (WTF::Unicode::decomposition):
137 * wtf/unicode/qt4/UnicodeQt4.h:
138 (WTF::Unicode::toLower):
139 (WTF::Unicode::toUpper):
140 (WTF::Unicode::isPrintableChar):
141 (WTF::Unicode::isSpace):
142 (WTF::Unicode::isPunct):
143 (WTF::Unicode::isDigit):
144 (WTF::Unicode::mirroredChar):
145 (WTF::Unicode::compare):
147 2006-08-17 Nikolas Zimmermann <zimmermann@kde.org>
149 Reviewed by Eric. Landed by rwlbuis.
151 Fixes: http://bugzilla.opendarwin.org/show_bug.cgi?id=10464
152 Offer a cmake build system for Qt platform.
154 * CMakeLists.txt: Added.
155 * pcre/CMakeLists.txt: Added.
157 2006-08-17 Anders Carlsson <acarlsson@apple.com>
164 2006-08-15 Steve Falkenburg <sfalken@apple.com>
170 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
173 2006-08-15 Mark Rowe <opendarwin.org@bdash.net.nz>
177 Build fix: DWARF and -gfull are incompatible with symbol separation.
179 * JavaScriptCore.xcodeproj/project.pbxproj:
181 2006-08-15 Mark Rowe <opendarwin.org@bdash.net.nz>
185 http://bugzilla.opendarwin.org/show_bug.cgi?id=10394
186 Bug 10394: WebKit Release and Production configurations should enable dead code stripping
188 * JavaScriptCore.xcodeproj/project.pbxproj:
190 2006-08-15 Mark Rowe <opendarwin.org@bdash.net.nz>
194 http://bugzilla.opendarwin.org/show_bug.cgi?id=10384
195 Bug 10384: Switch to DWARF for Release configuration
197 * JavaScriptCore.xcodeproj/project.pbxproj:
199 2006-08-13 Maks Orlovich <maksim@kde.org>
201 Reviewed (and tweaked a little) by Maciej.
203 - shrank the size of JSObject by 8 bytes and made the corresponding reduction to the cell size, resulting
204 in a 1.2% speed improvement on JS iBench (and probably overall memory savings).
206 This was done by removing _scope and _internalValue data members
207 from JSObject and moving them only to the subclasses that actually
211 (KJS::JSObject::mark): No need to mark scope or internal value here.
213 (KJS::JSObject::JSObject): Don't initialize them.
214 * kjs/JSWrapperObject.cpp: Added. New base class for object types that
215 wrap primitive values (Number, String, Boolean, Date).
216 (KJS::JSWrapperObject::mark):
217 * kjs/JSWrapperObject.h: Added.
218 (KJS::JSWrapperObject::JSWrapperObject):
219 (KJS::JSWrapperObject::internalValue):
220 (KJS::JSWrapperObject::setInternalValue):
221 * kjs/array_object.cpp:
222 (ArrayPrototype::ArrayPrototype): Don't set useless internal value.
223 * kjs/bool_object.cpp:
224 (BooleanInstance::BooleanInstance): Inherit from JSWrapperObject.
225 (BooleanProtoFunc::callAsFunction): Fixed to account for fact that not all
226 JSObjects have an internal value.
227 (BooleanObjectImp::construct): ditto.
229 * kjs/collector.cpp: Lowered cell size to 48.
230 (KJS::Collector::allocate): meaningless whitespace change
231 * kjs/date_object.cpp:
232 (KJS::DateInstance::DateInstance): Inherit from JSWrapperObject.
233 (KJS::DateProtoFunc::callAsFunction): adjusted for move of internalValue
234 (KJS::DateObjectImp::construct): ditto
236 * kjs/error_object.cpp:
237 (ErrorPrototype::ErrorPrototype): don't set internal value
238 * kjs/function.cpp: move _scope and related handling here
239 (KJS::FunctionImp::mark): mark scope
241 (KJS::FunctionImp::scope): moved here from JSObject
242 (KJS::FunctionImp::setScope): ditto
243 * kjs/number_object.cpp:
244 (NumberInstance::NumberInstance): inherit from JSWrapperObject
245 (NumberProtoFunc::callAsFunction): adjusted
246 (NumberObjectImp::construct): adjusted
247 * kjs/number_object.h: shring RegExp-related objects a little
248 * kjs/regexp_object.cpp:
249 (RegExpPrototype::RegExpPrototype): Adjust for size tweaks
250 (RegExpObjectImp::RegExpObjectImp): ditto
251 * kjs/regexp_object.h:
252 * kjs/string_object.cpp:
253 (StringInstance::StringInstance): inherit from JSWrapperObject
254 (StringProtoFunc::callAsFunction): adjusted
255 * kjs/string_object.h:
256 * JavaScriptCore.exp: Exported new methods as needed.
257 * JavaScriptCore.xcodeproj/project.pbxproj: Added new files to build.
259 2006-08-04 Brady Eidson <beidson@apple.com>
261 Reviewed by Geoff's rubber stamp
263 Fix a build break on Intel hardware causes by adapting stricter
264 compiler warnings (-Wshorten-64-to-32)
267 (assertEqualsAsNumber): manually cast some doubles to floats
270 2006-08-04 Sam Weinig <sam.weinig@gmail.com>
274 - patch for http://bugzilla.opendarwin.org/show_bug.cgi?id=10192
275 Make WebCore (and friends) compile with -Wshorten-64-to-32
277 * Adds -Wshorten-64-to-32 flag to Xcode project.
278 * Adds explicit casts where OK.
282 (JSNodeList_getProperty):
283 * JavaScriptCore.xcodeproj/project.pbxproj:
285 2006-08-04 Adam Roben <aroben@apple.com>
289 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Convert
292 2006-08-03 Sam Weinig <sam.weinig@gmail.com>
296 - patch for http://bugzilla.opendarwin.org/show_bug.cgi?id=10176
297 Make WebCore compile with -Wundef
299 * Adds -Wundef flag to Xcode project
300 * Converts #ifs to #ifdef and #ifndefs where needed.
301 * Added #define YYMAXDEPTH 10000 in kjs/grammar.y
302 to fix a warning from within Bison.
304 * JavaScriptCore.xcodeproj/project.pbxproj:
305 * bindings/jni/jni_jsobject.cpp:
306 (JavaJSObject::getSlot):
307 (JavaJSObject::setSlot):
309 * bindings/objc/objc_class.mm:
310 (KJS::Bindings::ObjcClass::methodsNamed):
311 (KJS::Bindings::ObjcClass::fieldNamed):
312 * bindings/objc/objc_instance.mm:
313 (ObjcInstance::invokeMethod):
314 * bindings/objc/objc_runtime.mm:
315 (ObjcMethod::getMethodSignature):
321 2006-08-03 Anders Carlsson <acarlsson@apple.com>
323 Reviewed by John Sullivan.
327 Return *this in operator=
329 2006-08-03 Adam Roben <aroben@apple.com>
333 - Fixed Windows build
335 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
336 * wtf/MathExtras.h: Implement inline versions of these functions
340 2006-08-02 Adam Roben <aroben@apple.com>
346 * kjs/date_object.cpp:
349 2006-07-29 Darin Adler <darin@apple.com>
351 - Removed tabs from these source files that still had them.
352 We don't use them; that way source files look fine in editors
353 that have tabs set to 8 spaces or to 4 spaces.
354 - Removed allow-tabs Subversion property from the files too.
356 * bindings/NP_jsobject.cpp:
357 * bindings/c/c_utility.cpp:
358 * bindings/jni/jni_runtime.cpp:
359 * bindings/jni/jni_utility.cpp:
360 * bindings/objc/objc_utility.mm:
361 * bindings/runtime.cpp:
362 * bindings/runtime_method.cpp:
363 * bindings/testbindings.cpp:
364 * bindings/testbindings.mm:
365 * kjs/date_object.cpp:
370 * kjs/string_object.cpp:
373 2006-07-29 Darin Adler <darin@apple.com>
375 * tests/mozilla/expected.html: Update test results now that regress-185165.js
376 is succeeding. I suspect Anders fix for bug 4620655 is the reason.
378 2006-07-29 Sam Weinig <sam.weinig@gmail.com>
382 - patch for http://bugzilla.opendarwin.org/show_bug.cgi?id=10080
383 Adopt pedantic changes from the Unity project to improve
384 cross-compiler compatibility
387 * Removing trailing semicolon from namespace braces.
388 * Removing trailing comma from last enum declaration.
389 * Updating to match style guidelines.
390 * Adding missing newline to the end of the file.
391 * Turning on gcc warning for missing newline at the end of a source file
392 (GCC_WARN_ABOUT_MISSING_NEWLINE in Xcode, -Wnewline in gcc).
393 * Alphabetical sorting of Xcode source list files.
394 * Replace use of non-portable variable-size array with Vector.
395 * Use C-style comments instead of C++ comments in files that might
396 be included by either C or C++ files.
398 * API/JSCallbackConstructor.cpp:
399 (KJS::JSCallbackConstructor::construct):
400 * API/JSCallbackFunction.cpp:
401 (KJS::JSCallbackFunction::callAsFunction):
402 * API/JSCallbackObject.cpp:
403 (KJS::JSCallbackObject::construct):
404 (KJS::JSCallbackObject::callAsFunction):
405 * JavaScriptCore.xcodeproj/project.pbxproj:
406 * JavaScriptCorePrefix.h:
407 * bindings/jni/jni_class.cpp:
408 (JavaClass::fieldNamed):
409 * bindings/jni/jni_class.h:
410 * bindings/jni/jni_instance.cpp:
411 (JavaInstance::JavaInstance):
412 (JavaInstance::valueOf):
413 * bindings/jni/jni_objc.mm:
414 (KJS::Bindings::dispatchJNICall):
415 * bindings/jni/jni_runtime.cpp:
416 (JavaParameter::JavaParameter):
417 (JavaArray::JavaArray):
418 * bindings/jni/jni_runtime.h:
419 * bindings/jni/jni_utility.h:
420 * bindings/objc/objc_instance.h:
421 * bindings/runtime_array.h:
427 2006-07-29 Mike Emmel <mike.emmel@gmail.com>
431 - fixes for Linux build
433 * JavaScriptCoreSources.bkl: Added new files to build, kjs/PropertyNameArray.cpp
434 and kjs/testkjs.cpp, and removed old files.
436 2006-07-24 Dan Waylonis <waylonis@google.com>
438 Reviewed and tweaked a bit by Darin.
440 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9902
441 jsNull and NSNull not properly converted between JS and ObjC
443 * bindings/objc/objc_utility.mm: (KJS::Bindings::convertObjcValueToValue):
444 Added case for converting NSNull to jsNull.
446 2006-07-24 Rob Buis <buis@kde.org>
450 http://bugzilla.opendarwin.org/show_bug.cgi?id=4258
451 Date().toString() only includes GMT offset, not timezone string
453 Use the info in tm_zone to append timezone abbreviation
454 to Date().toString().
456 * kjs/date_object.cpp:
459 2006-07-24 Rob Buis <buis@kde.org>
463 http://bugzilla.opendarwin.org/show_bug.cgi?id=5257
464 setYear() does not match FireFox/IE behavior
466 Make sure the right values end up in tm_year.
468 * kjs/date_object.cpp:
471 2006-07-23 Mark Rowe <opendarwin.org@bdash.net.nz>
475 Bug 9686: [Drosera] Need the ability to break into Drosera on Javascript exceptions
476 http://bugzilla.opendarwin.org/show_bug.cgi?id=9686
478 JavaScriptCore portion of the fix.
480 * JavaScriptCore.exp: Update symbol for change in argument type.
482 (Debugger::detach): Clear map of recent exceptions.
483 (Debugger::hasHandledException): Track the most recent exception
484 thrown by an interpreter.
485 (Debugger::exception): Change exception argument to a JSValue.
488 (Node::debugExceptionIfNeeded): Notify the debugger of an exception
489 if it hasn't seen it before.
490 (ThrowNode::execute): Notify the debugger that an exception is being thrown.
493 2006-07-23 Geoffrey Garen <ggaren@apple.com>
495 Patch by Eric Albert, reviewed by Darin and me.
497 - Fixed <rdar://problem/4645931> JavaScriptCore stack-scanning code
498 crashes (Collector::markStackObjectsConservatively)
500 * bindings/jni/jni_jsobject.cpp: On 64bit systems, jint is a long, not an
502 (JavaJSObject::getSlot):
503 (JavaJSObject::setSlot):
505 (KJS::Collector::markCurrentThreadConservatively): Use a pointer instead of
506 an int as 'dummy,' because on LP64 systems, an int is not pointer-aligned,
507 and we want to scan the stack for pointers.
508 * JavaScriptCore.xcodeproj/project.pbxproj: After a tense cease-fire, the
509 XCode war has started up again!
511 === Safari-521.20 ===
513 2006-07-21 Geoffrey Garen <ggaren@apple.com>
517 <rdar://problem/4507265> REGRESSION: overlays don't work on HousingMaps.com (Google Maps-based site)
519 - Added support for strings that masquerade as undefined. Currently used
520 by WebCore to implement undetectable style.filter.
522 The name is a little long, but it's only used in one line of code, so I
523 thought clarity should win over brevity.
525 * JavaScriptCore.exp:
526 * JavaScriptCore.xcodeproj/project.pbxproj:
528 * kjs/string_object.h:
529 (KJS::StringInstanceThatMasqueradesAsUndefined::StringInstanceThatMasqueradesAsUndefined):
530 (KJS::StringInstanceThatMasqueradesAsUndefined::masqueradeAsUndefined):
531 (KJS::StringInstanceThatMasqueradesAsUndefined::toBoolean):
533 === Safari-521.19 ===
535 2006-07-20 Steve Falkenburg <sfalken@apple.com>
540 (KJS::escapeStringForPrettyPrinting):
542 2006-07-19 Anders Carlsson <acarlsson@apple.com>
546 <rdar://problem/4620655> REGRESSION(10.4.7-10.5): preview button for a blogger.com post doesn't work
548 * kjs/nodes2string.cpp:
549 (StringNode::streamTo):
550 Return the escaped string.
552 (RegExpNode::streamTo):
553 Use the correct syntax.
556 (KJS::escapeStringForPrettyPrinting):
558 Add escape function which escapes a string for pretty-printing so it can be parsed again.
560 * wtf/unicode/icu/UnicodeIcu.h:
561 (WTF::Unicode::isPrintableChar):
564 2006-07-18 Maciej Stachowiak <mjs@apple.com>
566 Reviewed by Adele Peterson.
568 <rdar://problem/4589530> REGRESSION: null character in JS string causes parse error (works in Tiger and in other browsers)
577 2006-07-18 Tim Omernick <timo@apple.com>
579 Reviewed by Tim Hatcher.
581 Removed a misleading comment; we recently added support for the NPNVPluginElementNPObject
586 === Safari-521.18 ===
588 2006-07-18 Timothy Hatcher <timothy@apple.com>
590 Made the following headers public:
599 * JavaScriptCore.xcodeproj/project.pbxproj:
601 2006-07-17 Geoffrey Garen <ggaren@apple.com>
605 - Added automatic prototype creation for classes.
607 A class stores a weak reference to a prototype, which is cleared when
608 the prototype is garbage collected, to avoid a reference cycle.
610 We now have an attributes field in JSClassDefinition, that currently is
611 used only to override automatic prototype creation when you want to manage your
612 own prototypes, but can be extended in the future for other nefarious purposes.
614 Similarly, we have JSObjectMake and JSObjectMakeWithPrototype, the latter
615 allowing you to manage your own prototypes.
617 JSObjectMakeConstructor is more interesting now, able to make a constructor
618 on your behalf if you just give it a class.
620 - Removed bogus old code from minidom.js.
622 - Tweaked the headerdocs.
624 - Added more GC testing, which caught some leaks, and tested more funny
625 edge cases in lookup, which caught a lookup bug. Removed some testing
626 we used to do with MyObject because it was redundant with the new, cool
629 While fixing the lookup bug I retracted this change:
631 "If a static setProperty callback returns 'false', to indicate that the
632 property was not set, we no longer forward the set request up the class
633 chain, because that's almost certainly not what the programmer expected."
635 Returning false when setting a static property is a little silly, but you can see
636 it being useful when shadowing a base class's static properties, and, regardless
637 of usefullness, this is the defined behavior of the setProperty callback.
639 - Plus a little ASCII art, for the kids.
641 2006-07-17 Timothy Hatcher <timothy@apple.com>
645 <rdar://problem/4634874> WebScriptObject and WebUndefined are no longer defined by WebKit
647 Moves WebScriptObject and WebUndefined up to WebCore.
648 This change does create an upwards-dependancy on WebScriptObject existing
649 in the loaded process, but this code path in JavaScriptCore does not get used
650 unless it is through WebKit/WebCore. Moving all of the binding code out of
651 JavaScriptCore might make sense in the future.
653 * JavaScriptCore.exp:
654 * JavaScriptCore.xcodeproj/project.pbxproj:
655 * bindings/objc/WebScriptObject.h: Replaced.
656 * bindings/objc/WebScriptObject.mm: Removed.
657 * bindings/objc/WebScriptObjectPrivate.h: Removed.
658 * bindings/objc/objc_class.h:
659 * bindings/objc/objc_instance.h:
660 * bindings/objc/objc_instance.mm:
661 (ObjcInstance::~ObjcInstance):
662 * bindings/objc/objc_runtime.h:
663 * bindings/objc/objc_runtime.mm:
664 (convertValueToObjcObject):
665 * bindings/objc/objc_utility.mm:
666 (KJS::Bindings::convertValueToObjcValue):
667 (KJS::Bindings::convertObjcValueToValue):
668 (KJS::Bindings::createObjcInstanceForValue):
670 2006-07-17 Darin Adler <darin@apple.com>
672 * API/JSBase.h: Fix comment formatting where things used to be lined up but
673 are now ragged. Got rid of spaces that attempted to line things up.
674 * API/JSObjectRef.h: Ditto. Also add missing periods for a couple of comments.
676 2006-07-17 Geoffrey Garen <ggaren@apple.com>
680 - Removed the exception parameter from the initialize callback and, by extension,
681 JSObjectMake. We have never had a need for exceptions when iniitializing,
682 so the parameter seemed likely to "get in the way."
684 Also, an exception in JavaScript is thrown in response to input --
685 "invalid URL", "index not a number", etc., so it's the job of the
686 constructor function, not the initialize method, to throw.
688 If initialize *really* wants to throw, it can communicate the throw to
689 the constructor through the constructed object's private data (e.g., set
690 it to NULL, signaling to the consntructor that initialization failed.)
692 - Added JSObjectMakeWithData, which enables a constructor to set private
693 data on an object *before* it has been initialized. That way, the initialize
694 methods can properly operate on the data.
696 * API/JSNode.c: Moved ref into the initialize method, for better encapsulation,
697 now that it's possible.
698 * API/JSNodeList.c: ditto
700 (main): Do more aggressive garbage collection to test ref/deref and
702 * API/minidom.js: store childNodes in a temporary so it doesn't get re-created
703 like a thousand times. This makes debugging ref/deref easier
705 2006-07-17 Geoffrey Garen <ggaren@apple.com>
709 - Changed the initialize callback to run from least derived class (parent
710 class) to most derived class. This enables C++ style initialization,
711 and derived class overriding of member data.
713 - Added excpetion propopgation to JSObjectMake, to support initialize
714 exceptions, and generally round out our policy of making function
715 signatures as long as possible.
717 * API/JSCallbackObject.h: Use ExecState instead of ContextRef, cuz we're
720 2006-07-17 Geoffrey Garen <ggaren@apple.com>
724 - Changed JSObjectMakeConstructor to JSObjectMakeConstructorWithCallback,
725 to match JSObjectMakeFunctionWithCallback.
727 - Added prototype parameter, so the generated constructor
728 automatically works with hasInstance / instanceof
730 - Moved hasInstance implementation from InternalFunctionImp to JSObject
731 so that subclasses can inherit it without inheriting function-related baggage.
732 More refactoring here would be good, but this seems like a good short-term
735 (KJS::JSCallbackFunction::implementsHasInstance): override and return false,
736 because callback functions aren't constructors.
738 2006-07-17 Maciej Stachowiak <mjs@apple.com>
742 - add a JSContextRef parameter to all JSValueRef, JSObjectRef, and JSContextRef operations;
743 except JSObject{Get,Set}PrivateData which can be assumed to be simple pure accessors.
745 Also renamed the parameter "context" to "ctx" because it makes the code read better with this pervasive
746 but usually uninteresting parameter.
750 (JSCheckScriptSyntax):
753 * API/JSCallbackObject.cpp:
754 (KJS::JSCallbackObject::JSCallbackObject):
755 (KJS::JSCallbackObject::init):
756 (KJS::JSCallbackObject::getOwnPropertySlot):
757 (KJS::JSCallbackObject::put):
758 (KJS::JSCallbackObject::deleteProperty):
759 (KJS::JSCallbackObject::toNumber):
760 (KJS::JSCallbackObject::toString):
761 * API/JSContextRef.cpp:
762 (JSGlobalContextCreate):
763 (JSGlobalContextRetain):
764 (JSGlobalContextRelease):
765 (JSContextGetGlobalObject):
766 * API/JSContextRef.h:
768 (JSNodePrototype_appendChild):
769 (JSNodePrototype_removeChild):
770 (JSNodePrototype_replaceChild):
771 (JSNode_getNodeType):
772 (JSNode_getFirstChild):
775 (JSNodeListPrototype_item):
777 (JSNodeList_getProperty):
778 (JSNodeList_prototype):
779 * API/JSObjectRef.cpp:
781 (JSObjectMakeFunctionWithCallback):
782 (JSObjectMakeConstructor):
783 (JSObjectMakeFunction):
784 (JSObjectGetPrototype):
785 (JSObjectSetPrototype):
786 (JSObjectHasProperty):
787 (JSObjectGetProperty):
788 (JSObjectSetProperty):
789 (JSObjectGetPropertyAtIndex):
790 (JSObjectSetPropertyAtIndex):
791 (JSObjectDeleteProperty):
792 (JSObjectIsFunction):
793 (JSObjectCallAsFunction):
794 (JSObjectIsConstructor):
795 (JSObjectCallAsConstructor):
796 (JSObjectCopyPropertyNames):
798 * API/JSStringRef.cpp:
799 * API/JSValueRef.cpp:
801 (JSValueIsUndefined):
807 (JSValueIsObjectOfClass):
809 (JSValueIsStrictEqual):
810 (JSValueIsInstanceOfConstructor):
811 (JSValueMakeUndefined):
813 (JSValueMakeBoolean):
818 (JSValueToStringCopy):
826 (MyObject_getProperty):
827 (MyObject_deleteProperty):
828 (MyObject_callAsFunction):
829 (MyObject_callAsConstructor):
830 (MyObject_convertToType):
831 (print_callAsFunction):
834 2006-07-16 Geoffrey Garen <ggaren@apple.com>
836 Approved by Maciej, RS by Beth.
838 JSObjectMakeFunction -> JSObjectMakeFunctionWithCallback
839 JSObjectMakeFunctionWithBody -> JSObjectMakeFunction
841 because the latter is more common, and more fundamental, than the former.
846 * API/JSCallbackObject.cpp:
847 (KJS::JSCallbackObject::getOwnPropertySlot):
848 (KJS::JSCallbackObject::put):
849 (KJS::JSCallbackObject::deleteProperty):
850 (KJS::JSCallbackObject::getPropertyNames):
851 (KJS::JSCallbackObject::staticValueGetter):
852 (KJS::JSCallbackObject::staticFunctionGetter):
853 * API/JSClassRef.cpp:
854 (OpaqueJSClass::OpaqueJSClass):
855 (OpaqueJSClass::~OpaqueJSClass):
857 * API/JSObjectRef.cpp:
859 (JSObjectMakeFunctionWithCallback):
860 (JSObjectMakeFunction):
861 (OpaqueJSPropertyNameArray::OpaqueJSPropertyNameArray):
862 (JSObjectCopyPropertyNames):
869 * JavaScriptCore.exp:
871 2006-07-16 Geoffrey Garen <ggaren@apple.com>
875 Replace __JS with OpaqueJS because the former, while used by CF, is
876 a prefix that's triply-reserved by the compiler. (_* is reserved in global
877 names, _[A-Z] is reserved in all names, and __ is reserved in all names
880 Opaque is an alternative used by other Mac OS X framewokrs.
885 * API/JSCallbackObject.cpp:
886 (KJS::JSCallbackObject::getOwnPropertySlot):
887 (KJS::JSCallbackObject::put):
888 (KJS::JSCallbackObject::deleteProperty):
889 (KJS::JSCallbackObject::getPropertyNames):
890 (KJS::JSCallbackObject::staticValueGetter):
891 (KJS::JSCallbackObject::staticFunctionGetter):
892 * API/JSClassRef.cpp:
893 (OpaqueJSClass::OpaqueJSClass):
894 (OpaqueJSClass::~OpaqueJSClass):
896 * API/JSObjectRef.cpp:
898 (OpaqueJSPropertyNameArray::OpaqueJSPropertyNameArray):
899 (JSObjectCopyPropertyNames):
901 2006-07-16 Darin Adler <darin@apple.com>
903 - try to fix Windows build
905 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
906 Added some recently added files, removed some recently removed.
908 2006-07-16 Geoffrey Garen <ggaren@apple.com>
912 - Change getProperty* to return undefined, rather than NULL, for missing
913 properties, since that's what the spec says. Also added exception out
914 parameters to the *Index functions, because they can call through to the
915 regular functions, which can throw for custom objects.
917 * API/JSObjectRef.cpp:
918 (JSObjectGetProperty):
919 (JSObjectGetPropertyAtIndex):
920 (JSObjectSetPropertyAtIndex):
925 2006-07-16 Geoffrey Garen <ggaren@apple.com>
929 - Properly document and handle NULL callbacks for static properties. We
930 throw an exception in any case other than a ReadOnly property with a NULL
931 setProperty callback, because a NULL callback almost certainly indicates
932 a programming error. Also throw an exception if hasProperty returns true
933 for a property that getProperty can't get.
935 - If a static setProperty callback returns 'false', to indicate that the
936 property was not set, we no longer forward the set request up the class
937 chain, because that's almost certainly not what the programmer expected.
939 * API/JSCallbackObject.cpp:
940 (KJS::JSCallbackObject::getOwnPropertySlot):
941 (KJS::JSCallbackObject::put):
942 (KJS::JSCallbackObject::staticValueGetter):
943 (KJS::JSCallbackObject::staticFunctionGetter):
944 (KJS::JSCallbackObject::callbackGetter):
948 (MyObject_hasProperty):
951 2006-07-16 Geoffrey Garen <ggaren@apple.com>
955 - Added names to functions.
957 - Removed GetPrivate/SetPrivate from callbackFunctions and callbackConstructors.
958 The private data idiom is that a JS object stores its native implementation
959 as private data. For functions and constructors, the native implementation is nothing
960 more than the callback they already store, so supporting private data, too,
961 confuses the idiom. If you *really* want, you can still create a custom
962 function with private data.
964 * API/JSCallbackConstructor.cpp:
965 * API/JSCallbackConstructor.h:
966 * API/JSCallbackFunction.cpp:
967 (KJS::JSCallbackFunction::JSCallbackFunction):
968 * API/JSCallbackFunction.h:
969 * API/JSCallbackObject.cpp:
970 (KJS::JSCallbackObject::staticFunctionGetter):
971 * API/JSObjectRef.cpp:
972 (JSObjectMakeFunction):
973 (JSObjectMakeFunctionWithBody):
974 (JSObjectGetPrivate):
975 (JSObjectSetPrivate):
982 2006-07-15 Maciej Stachowiak <mjs@apple.com>
986 - switch property lists to be vector+set of Identifiers instead of list of References
988 This has the following benefits:
990 - no duplicates in property lists
991 - simplifies API calls
992 - probably more efficient, since linked list is gone
993 - entirely removed Reference, ReferenceList and ProtectedReference types from the API
995 * kjs/PropertyNameArray.cpp: Added.
996 (KJS::PropertyNameArray::add): Check set, if not already there, add to
998 * kjs/PropertyNameArray.h: Added.
999 (KJS::PropertyNameArray::PropertyNameArray): Newly added type, combines
1000 a set and a vector to make a unique but ordered list of identifiers.
1001 (KJS::PropertyNameArray::begin): ditto
1002 (KJS::PropertyNameArray::end): ditto
1003 (KJS::PropertyNameArray::size): ditto
1004 (KJS::PropertyNameArray::operator[]): ditto
1005 * kjs/array_instance.h:
1006 * kjs/array_object.cpp:
1007 (ArrayInstance::getPropertyNames): renamed from getPropertyList, updated
1008 for PropertyNameArray
1009 (ArrayInstance::setLength): updated for PropertyNameArray
1010 (ArrayInstance::pushUndefinedObjectsToEnd): ditto
1012 (ForInNode::execute): updated for PropertyNameArray
1015 (KJS::JSObject::getPropertyNames): renamed from getPropertyList, updated
1016 for PropertyNameArray
1018 * kjs/property_map.cpp:
1019 (KJS::PropertyMap::getEnumerablePropertyNames): updated for PropertyNameArray
1020 (KJS::PropertyMap::getSparseArrayPropertyNames): ditto
1021 * kjs/property_map.h:
1022 * kjs/protected_reference.h: Removed.
1023 * kjs/reference.cpp: Removed.
1024 * kjs/reference.h: Removed.
1025 * kjs/reference_list.cpp: Removed.
1026 * kjs/reference_list.h: Removed.
1027 * kjs/scope_chain.cpp:
1028 (KJS::ScopeChain::print): Use PropertyNamesArray instead of ReferenceList.
1029 * kjs/string_object.cpp:
1030 (StringInstance::getPropertyNames): Updated for new approach.
1031 * kjs/string_object.h:
1034 (toJS): Added overload for PropertyNameAccumulatorRef / PropertyNameArray*
1037 * API/JSCallbackObject.cpp:
1038 (KJS::JSCallbackObject::getPropertyNames): Fixed for new API.
1039 * API/JSCallbackObject.h:
1040 * API/JSObjectRef.cpp:
1041 (__JSPropertyNameArray::__JSPropertyNameArray): Type used for a publicly vended
1042 JSPropertyNameArrayRef.
1043 (JSObjectCopyPropertyNames): New API call - renamed / refactored from
1044 JSObjectCreatePropertyList
1045 (JSPropertyNameArrayRetain): new retain call for JSPropertyNameArray.
1046 (JSPropertyNameArrayRelease): new release call for - " -.
1047 (JSPropertyNameArrayGetCount): Instead of having to use a stateful enumerator you
1048 can now get the count and items in any order.
1049 (JSPropertyNameArrayGetNameAtIndex): See above.
1050 (JSPropertyNameAccumulatorAddName): What you add properties to is now an opaque
1052 * API/JSObjectRef.h: Prototyped new functions, removed old ones
1053 * JavaScriptCore.exp: Updated exported symbols.
1054 * JavaScriptCore.xcodeproj/project.pbxproj: Added new files, removed old.
1056 (MyObject_getPropertyNames): Renamed / fixed callback to fit new paradigm.
1057 (main): Updated for new API.
1059 2006-07-15 Darin Adler <darin@apple.com>
1061 - oops, missed a few more arrays that had to be const
1064 (JSNodePrototype_appendChild): Added const.
1065 (JSNodePrototype_removeChild): Ditto.
1066 (JSNodePrototype_replaceChild): Ditto.
1067 (JSNode_construct): Ditto.
1069 (JSNodeListPrototype_item): Ditto.
1070 * API/JSObjectRef.cpp:
1071 (JSObjectMakeFunctionWithBody): Ditto.
1072 (JSObjectCallAsFunction): Ditto.
1073 (JSObjectCallAsConstructor): Ditto.
1077 (MyObject_callAsFunction): Ditto.
1078 (MyObject_callAsConstructor): Ditto.
1079 (print_callAsFunction): Ditto.
1080 (myConstructor_callAsConstructor): Ditto.
1082 2006-07-15 Darin Adler <darin@apple.com>
1086 * API/JSNode.h: Made an array parameter const.
1087 * API/JSObjectRef.h: Made array parameters const. Fixed a comment.
1089 2006-07-15 Geoffrey Garen <ggaren@apple.com>
1093 - JSObjectMakeFunctionWithBody includes a function name and named parameters now.
1095 * API/JSObjectRef.cpp:
1096 (JSObjectMakeFunctionWithBody):
1097 * API/JSObjectRef.h:
1099 (assertEqualsAsUTF8String): More informative failure reporting.
1100 (main): Test more function cases.
1102 2006-07-15 Geoffrey Garen <ggaren@apple.com>
1106 - Moved the arguments passed to JSClassCreate into a single structure,
1107 called JSClassDefinition. This will enable easier structure
1108 migration/versioning in the future, if necessary.
1110 - Added support for class names.
1112 - kJSClassDefinitionNull replaces kJSObjectCallbacksNone.
1114 - JSClass is becoming a fairly complex struct, so I migrated all of its
1115 implementation other than reference counting to the sruct.
1117 - Also moved JSClass* functions in the API to JSObjectRef.cpp, since they're
1118 declared in JSObjectRef.h
1120 - Also added some more informative explanation to the class structure doc.
1122 2006-07-15 Darin Adler <darin@apple.com>
1126 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8395
1127 <rdar://problem/4613467>
1128 REGRESSION: RegEx seems broken for hex escaped non breaking space
1130 Test: fast/js/regexp-extended-characters-more.html
1133 (match): Got rid of utf16Length local variable to guarantee there's no
1134 extra stack usage in recursive calls. Fixed two places in the PCRE_UTF16
1135 code that were using the length variable, which is the UTF-8 length of
1136 a character in the pattern, to move in the UTF-16 subject string. Instead
1137 they hardcode lengths of 1 and 2 since the code already handles BMP
1138 characters and surrogate pairs separately. Also fixed some DPRINTF so
1139 I could compile with DEBUG on.
1140 (pcre_exec): Changed a place that was checking for multibyte characters
1141 in the subject string to use ISMIDCHAR. Instead it was using hardcoded
1142 logic that was right for UTF-8 but wrong for UTF-16.
1144 * pcre/pcre_compile.c: (pcre_compile2): Fixed a DPRINTF so I could compile
1147 2006-07-14 Geoffrey Garen <ggaren@apple.com>
1151 Global replace in the API of argc/argv with argumentCount/arguments.
1153 2006-07-14 Geoffrey Garen <ggaren@apple.com>
1157 - Finalized exception handling in the API.
1159 setProperty can throw because it throws for built-in arrays. getProperty
1160 and deleteProperty can throw because setProperty can throw and we want
1161 to be consistent, and also because they seem like "actions." callAsFunction,
1162 callAsConstructor, and hasInstance can throw, because they caan throw for
1165 toBoolean can't throw because it's defined that way in the spec.
1167 - Documented that toBoolean and toObject can't be overridden by custom
1168 objects because they're defined that way in the spec.
1170 === Safari-521.17 ===
1172 2006-07-14 Geoffrey Garen <ggaren@apple.com>
1176 - Implemented ref-counting of JSContexts by splitting into two datatypes:
1177 JSGlobalContext, which you can create/retain/release, and JSContext, which
1180 Internally, you retain a JSGlobalContext/ExecState by retaining its
1181 interpreter, which, in the case of a global ExecState, owns it.
1183 - Also made ~Interpreter() protected to catch places where Interpreter
1184 is manually deleted. (Can't make it private because some crazy fool
1185 decided it would be a good idea to subclass Interpreter in other frameworks.
1189 (toJS): Added cast for new JSGlobalContext
1190 * API/JSStringRef.h: Changed vague "you must" language to more specific
1191 (but, ultimately, equally vague) "behavior is undefined if you don't"
1193 (KJS::Interpreter::Interpreter): Factored more common initialization into
1195 * kjs/interpreter.h:
1196 (KJS::Interpreter::ref): new
1197 (KJS::Interpreter::deref): new
1198 (KJS::Interpreter::refCount): new
1200 (doIt): Ref-count the interpreter.
1202 2006-07-14 Maciej Stachowiak <mjs@apple.com>
1206 - removed bool return value from JSObjectSetProperty, since it is inefficient and
1207 also doesn't work quite right
1208 - added JSObjectGetPropertyAtIndex and JSObjectSetPropertyAtIndex
1210 * API/JSObjectRef.cpp:
1211 (JSObjectSetProperty): Removed return value and canPut stuff.
1212 (JSObjectGetPropertyAtIndex): Added.
1213 (JSObjectSetPropertyAtIndex): Added.
1214 * API/JSObjectRef.h: Prototyped and documented new functions.
1216 2006-07-14 Geoffrey Garen <ggaren@apple.com>
1220 Moved JSCheckScriptSyntax, JSEvaluateScript, and JSGarbageCollect into
1221 JSBase.h/.cpp. They don't belong in the value-specific or context-specific
1222 files because they're not part of the value or context implementations.
1225 * API/JSContextRef.cpp:
1226 (JSContextGetGlobalObject):
1227 * API/JSContextRef.h:
1228 * API/JSValueRef.cpp:
1231 * JavaScriptCore.xcodeproj/project.pbxproj:
1233 2006-07-13 Timothy Hatcher <timothy@apple.com>
1237 Moved JavaScriptCore to be a public framework.
1239 * JavaScriptCore.xcodeproj/project.pbxproj:
1241 2006-07-13 Mark Rowe <opendarwin.org@bdash.net.nz>
1243 Reviewed by Geoffrey.
1245 http://bugzilla.opendarwin.org/show_bug.cgi?id=9742
1246 Bug 9742: REGRESSION: WebKit hangs when loading <http://www.vtbook.com>
1249 (KJS::JSValue::getUInt32): Only types tagged as numeric can be converted to UInt32.
1251 2006-07-13 Geoffrey Garen <ggaren@apple.com>
1255 - Renamed JSEvaluate -> JSEvaluateScript, JSCheckSyntax -> JSCheckScriptSyntax
1256 - Added exception out parameters to JSValueTo* and JSValueIsEqual because
1258 - Removed JSObjectGetDescription because it's useless and vague, and
1259 JSValueToString/JSValueIsObjectOfClass do a better job, anyway
1260 - Clarified comments about "IsFunction/Constructor" to indicate that they
1261 are true of all functions/constructors, not just those created by JSObjectMake*
1263 2006-07-12 Geoffrey Garen <ggaren@apple.com>
1267 Finished previously approved JSInternalString -> JSString conversion
1268 by renaming the files.
1270 * API/JSCallbackObject.cpp:
1271 * API/JSInternalStringRef.cpp: Removed.
1272 * API/JSInternalStringRef.h: Removed.
1273 * API/JSStringRef.cpp: Added.
1274 * API/JSStringRef.h: Added.
1275 * API/JavaScriptCore.h:
1276 * JavaScriptCore.xcodeproj/project.pbxproj:
1278 2006-07-12 Geoffrey Garen <ggaren@apple.com>
1282 - Removed context and exception parameters from JSObjectGetPropertyEnumerator,
1283 removing the spurious use of ExecState inside JavaScriptCore that made
1284 us think this was necessary in the first place.
1286 (StringInstance::getPropertyList): Use getString instead of toString because
1287 we know we're dealing with a string -- we put it there in the first place.
1288 While we're at it, store the string's size instead of retrieving it each time
1289 through the loop, to avoid the unnecessary killing of puppies.
1290 * kjs/string_object.h:
1292 2006-07-12 Maciej Stachowiak <mjs@apple.com>
1296 - add handling of hasInstance callback for API objects
1298 * API/JSCallbackObject.cpp:
1299 (KJS::JSCallbackObject::implementsHasInstance): Check if callback is present.
1300 (KJS::JSCallbackObject::hasInstance): Invoke appropriate callback.
1301 * API/JSCallbackObject.h:
1302 * API/JSClassRef.cpp:
1303 * API/JSObjectRef.h:
1305 (MyObject_hasInstance): Test case; should match what construct would do.
1308 2006-07-11 Geoffrey Garen <ggaren@apple.com>
1312 - Implemented a vast number of renames and comment clarifications
1313 suggested during API review.
1315 JSInternalString -> JSString
1316 JS*Make -> JSValueMake*, JSObjectMake*
1317 JSTypeCode -> JSType
1318 JSValueIsInstanceOf -> JSValueIsInstanceOfConstructor (reads strangely well in client code)
1319 JSGC*Protect -> JSValue*Protect
1320 JS*Callback -> JSObject*Callback
1321 JSGetPropertyListCallback -> JSObjectAddPropertiesToListCallback
1322 JSPropertyEnumeratorGetNext -> JSPropertyEnumeratorGetNextName
1324 JSStringCreateWithUTF8CString, JSStringGetUTF8CString,
1325 JSStringGetMaximumUTF8CStringSize JSStringIsEqualToUTF8CString,
1326 JSStringCreateWithCFString, JSStringCopyCFString, JSStringCreateWithCharacters.
1328 - Changed functions taking a JSValue out arg and returning a bool indicating
1329 whether it was set to simply return a JSValue or NULL.
1331 - Removed JSStringGetCharacters because it's more documentation than code,
1332 and it's just a glorified memcpy built on existing API functionality.
1334 - Moved standard library includes into the headers that actually require them.
1336 - Standardized use of the phrase "Create Rule."
1338 - Removed JSLock from make functions that don't allocate.
1340 - Added exception handling to JSValueToBoolean, since we now allow
1341 callback objects to throw exceptions upon converting to boolean.
1343 - Renamed JSGCCollect to JSGarbageCollect.
1345 2006-07-10 Geoffrey Garen <ggaren@apple.com>
1349 - Changed public header includes to the <JavaScriptCore/ style.
1350 - Changed instances of 'buffer' to 'string' since we decided on
1351 JSInternalString instead of JSStringBuffer.
1353 * API/JSContextRef.h:
1354 * API/JSInternalStringRef.cpp:
1356 (JSInternalStringRetain):
1357 (JSInternalStringRelease):
1358 (JSValueCopyStringValue):
1359 (JSInternalStringGetLength):
1360 (JSInternalStringGetCharactersPtr):
1361 (JSInternalStringGetCharacters):
1362 (JSInternalStringGetMaxLengthUTF8):
1363 (JSInternalStringGetCharactersUTF8):
1364 (CFStringCreateWithJSInternalString):
1365 * API/JSInternalStringRef.h:
1367 (JSNodePrototype_appendChild):
1368 (JSNode_getNodeType):
1369 * API/JSObjectRef.cpp:
1370 (JSObjectCallAsConstructor):
1372 * API/JavaScriptCore.h:
1377 (MyObject_getPropertyList):
1378 (myConstructor_callAsConstructor):
1379 (main): I noticed that we were prematurely releasing some string buffers,
1380 so I moved their release calls to the end of main(). I got rid of 'Buf' in *Buf
1381 (sometimes changing to 'IString', when necessary to differentiate a variable)
1382 to match the buffer->string change.
1384 === Safari-521.16 ===
1386 2006-07-10 Darin Adler <darin@apple.com>
1388 * kjs/value.cpp: (KJS::JSValue::toInt32Inline): Added inline keyword one more place.
1391 2006-07-10 Darin Adler <darin@apple.com>
1393 - fix the release build
1397 (KJS::JSValue::toInt32Inline): Move the code here to an inline.
1398 (KJS::JSValue::toInt32): Call the inline from both overloaded toInt32 functions.
1400 2006-07-10 David Kilzer <ddkilzer@kilzer.net>
1404 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9179
1405 Implement select.options.add() method
1407 * JavaScriptCore.exp: Added overloaded KJS::JSValue::toInt32() method.
1408 * JavaScriptCore.xcodeproj/project.pbxproj: Altered attributes metadata for
1409 kjs/value.h to make it available as a forwarded header.
1411 (KJS::lookupPut): Extracted a lookupPut() method from the existing lookupPut() method.
1412 The new method returns a boolean value if no entry is found in the lookup table.
1414 (KJS::JSValue::toInt32): Overloaded toInt32() method with boolean "Ok" argument.
1415 * kjs/value.h: Ditto.
1417 2006-07-10 Geoffrey Garen <ggaren@apple.com>
1419 No review necessary. Removed bogus file I accidentally checked in before.
1421 * API/JSInternalSringRef.h: Removed.
1423 2006-07-10 Geoffrey Garen <ggaren@apple.com>
1427 Added exception out parameter to API object callbacks, removed semi-bogus
1428 JSContext(.*)Exception functions.
1430 To make these calls syntactically simple, I added an exceptionSlot()
1431 method to the ExecState class, which provides a JSValue** slot in which to
1432 store a JSValue* exception.
1436 * API/JSCallbackConstructor.cpp:
1437 (KJS::JSCallbackConstructor::construct):
1438 * API/JSCallbackFunction.cpp:
1439 (KJS::JSCallbackFunction::callAsFunction):
1440 * API/JSCallbackObject.cpp:
1441 (KJS::JSCallbackObject::init):
1442 (KJS::JSCallbackObject::getOwnPropertySlot):
1443 (KJS::JSCallbackObject::put):
1444 (KJS::JSCallbackObject::deleteProperty):
1445 (KJS::JSCallbackObject::construct):
1446 (KJS::JSCallbackObject::callAsFunction):
1447 (KJS::JSCallbackObject::getPropertyList):
1448 (KJS::JSCallbackObject::toBoolean):
1449 (KJS::JSCallbackObject::toNumber):
1450 (KJS::JSCallbackObject::toString):
1451 (KJS::JSCallbackObject::staticValueGetter):
1452 (KJS::JSCallbackObject::callbackGetter):
1453 * API/JSContextRef.cpp:
1455 * API/JSContextRef.h:
1457 (JSNodePrototype_appendChild):
1458 (JSNodePrototype_removeChild):
1459 (JSNodePrototype_replaceChild):
1460 (JSNode_getNodeType):
1461 (JSNode_getChildNodes):
1462 (JSNode_getFirstChild):
1466 (JSNodeListPrototype_item):
1467 (JSNodeList_length):
1468 (JSNodeList_getProperty):
1469 * API/JSObjectRef.h:
1473 (MyObject_initialize):
1474 (MyObject_hasProperty):
1475 (MyObject_getProperty):
1476 (MyObject_setProperty):
1477 (MyObject_deleteProperty):
1478 (MyObject_getPropertyList):
1479 (MyObject_callAsFunction):
1480 (MyObject_callAsConstructor):
1481 (MyObject_convertToType):
1482 (print_callAsFunction):
1483 (myConstructor_callAsConstructor):
1485 * JavaScriptCore.exp:
1487 (KJS::ExecState::exceptionHandle):
1489 2006-07-10 Geoffrey Garen <ggaren@apple.com>
1493 Improved type safety by implementing opaque JSValue/JSObject typing through
1494 abuse of 'const', not void*. Also fixed an alarming number of bugs
1495 exposed by this new type safety.
1497 I made one design change in JavaScriptCore, which is that the JSObject
1498 constructor should take a JSValue* as its prototype argument, not a JSObject*,
1499 since we allow the prototype to be any JSValue*, including jsNull(), for
1505 * API/JSCallbackConstructor.cpp:
1506 (KJS::JSCallbackConstructor::construct):
1507 * API/JSCallbackFunction.cpp:
1508 (KJS::JSCallbackFunction::callAsFunction):
1509 * API/JSCallbackObject.cpp:
1510 (KJS::JSCallbackObject::JSCallbackObject):
1511 (KJS::JSCallbackObject::getOwnPropertySlot):
1512 (KJS::JSCallbackObject::put):
1513 (KJS::JSCallbackObject::construct):
1514 (KJS::JSCallbackObject::callAsFunction):
1515 (KJS::JSCallbackObject::staticFunctionGetter):
1516 * API/JSCallbackObject.h:
1517 * API/JSContextRef.cpp:
1520 (JSNodePrototype_appendChild):
1521 (JSNodePrototype_removeChild):
1522 (JSNodePrototype_replaceChild):
1523 * API/JSObjectRef.cpp:
1525 (JSFunctionMakeWithBody):
1526 (JSObjectGetProperty):
1527 (JSObjectCallAsFunction):
1528 (JSObjectCallAsConstructor):
1529 * API/JSObjectRef.h:
1534 (KJS::JSObject::JSObject):
1536 2006-07-10 Geoffrey Garen <ggaren@apple.com>
1538 Approved by Maciej, Darin.
1540 Renamed JSStringBufferRef to JSInternalStringRef. "Internal string" means the
1541 JavaScript engine's internal string representation, which is the most
1542 low-level and efficient representation to use when interfacing with JavaScript.
1548 * API/JSCallbackObject.cpp:
1549 (KJS::JSCallbackObject::getOwnPropertySlot):
1550 (KJS::JSCallbackObject::put):
1551 (KJS::JSCallbackObject::deleteProperty):
1552 (KJS::JSCallbackObject::staticValueGetter):
1553 (KJS::JSCallbackObject::callbackGetter):
1554 * API/JSContextRef.cpp:
1557 * API/JSContextRef.h:
1558 * API/JSInternalStringRef.cpp: Added.
1560 (JSInternalStringCreate):
1561 (JSInternalStringCreateUTF8):
1562 (JSInternalStringRetain):
1563 (JSInternalStringRelease):
1564 (JSValueCopyStringValue):
1565 (JSInternalStringGetLength):
1566 (JSInternalStringGetCharactersPtr):
1567 (JSInternalStringGetCharacters):
1568 (JSInternalStringGetMaxLengthUTF8):
1569 (JSInternalStringGetCharactersUTF8):
1570 (JSInternalStringIsEqual):
1571 (JSInternalStringIsEqualUTF8):
1572 (JSInternalStringCreateCF):
1573 (CFStringCreateWithJSInternalString):
1574 * API/JSInternalStringRef.h: Added.
1576 (JSNodePrototype_appendChild):
1577 (JSNode_getNodeType):
1578 (JSNode_getChildNodes):
1579 (JSNode_getFirstChild):
1581 (JSNodeList_length):
1582 (JSNodeList_getProperty):
1583 * API/JSObjectRef.cpp:
1584 (JSFunctionMakeWithBody):
1585 (JSObjectGetDescription):
1586 (JSObjectHasProperty):
1587 (JSObjectGetProperty):
1588 (JSObjectSetProperty):
1589 (JSObjectDeleteProperty):
1590 (JSPropertyEnumeratorGetNext):
1591 (JSPropertyListAdd):
1592 * API/JSObjectRef.h:
1593 * API/JSStringBufferRef.cpp: Removed.
1594 * API/JSStringBufferRef.h: Removed.
1596 * API/JavaScriptCore.h:
1601 (assertEqualsAsUTF8String):
1602 (assertEqualsAsCharactersPtr):
1603 (assertEqualsAsCharacters):
1604 (MyObject_hasProperty):
1605 (MyObject_getProperty):
1606 (MyObject_setProperty):
1607 (MyObject_deleteProperty):
1608 (MyObject_getPropertyList):
1609 (print_callAsFunction):
1610 (myConstructor_callAsConstructor):
1612 * JavaScriptCore.exp:
1613 * JavaScriptCore.xcodeproj/project.pbxproj:
1615 2006-07-08 Tim Omernick <timo@apple.com>
1619 Added an OpenGL drawing model to the Netscape Plug-in API.
1623 2006-07-08 Timothy Hatcher <timothy@apple.com>
1627 Moved KJS_GetCreatedJavaVMs to jni_utility.cpp.
1628 Switched KJS_GetCreatedJavaVMs over to use dlopen and dlsym
1629 now that NSAddImage, NSLookupSymbolInImage and NSAddressOfSymbol
1630 are deprecated in Leopard.
1632 * JavaScriptCore.exp:
1633 * JavaScriptCore.xcodeproj/project.pbxproj:
1634 * bindings/jni/jni_utility.cpp:
1635 (KJS::Bindings::KJS_GetCreatedJavaVMs):
1636 * bindings/softlinking.c: Removed.
1637 * bindings/softlinking.h: Removed.
1639 2006-07-08 Geoffrey Garen <ggaren@apple.com>
1643 - Make JSObjectGetProperty return a JSValue or NULL, like JSEvaluate does.
1645 * API/JSObjectRef.cpp:
1646 (JSObjectGetProperty):
1647 * API/JSObjectRef.h:
1651 2006-07-08 Geoffrey Garen <ggaren@apple.com>
1653 Style change -- no review necessary.
1655 Use 0 instead of NULL in API .cpp files, to match our style guidelines.
1657 * API/JSContextRef.cpp:
1659 * API/JSObjectRef.cpp:
1660 (JSFunctionMakeWithBody):
1661 (JSObjectCallAsFunction):
1662 (JSObjectCallAsConstructor):
1663 * API/JSValueRef.cpp:
1666 2006-07-08 Geoffrey Garen <ggaren@apple.com>
1670 - Added ability to pass NULL for thisObject when calling JSObjectCallAsFunction,
1671 to match JSEvaluate.
1673 * API/JSObjectRef.cpp:
1674 (JSObjectCallAsFunction):
1675 * API/JSObjectRef.h:
1679 === Safari-521.15 ===
1681 2006-07-07 Geoffrey Garen <ggaren@apple.com>
1685 - Standardized which functions take a JSContext as an argument. The rule is:
1686 if you might execute JavaScript, you take a JSContext, otherwise you don't.
1688 The FIXME in JSObjectRef.h requires refactoring some parts of Interpreter,
1689 but not API changes, so I'm putting it off until later.
1691 * API/JSCallbackObject.cpp:
1692 (KJS::JSCallbackObject::JSCallbackObject):
1693 (KJS::JSCallbackObject::init):
1694 * API/JSCallbackObject.h:
1695 * API/JSContextRef.cpp:
1697 * API/JSContextRef.h:
1698 * API/JSObjectRef.cpp:
1700 (JSPropertyEnumeratorGetNext):
1701 * API/JSObjectRef.h:
1703 (MyObject_initialize):
1705 * JavaScriptCore.exp:
1706 * kjs/array_object.cpp:
1707 (ArrayInstance::setLength):
1708 (ArrayInstance::pushUndefinedObjectsToEnd):
1710 (ForInNode::execute):
1711 * kjs/reference.cpp:
1712 (KJS::Reference::getPropertyName):
1713 (KJS::Reference::getValue):
1715 * kjs/scope_chain.cpp:
1716 (KJS::ScopeChain::print):
1718 2006-07-06 Geoffrey Garen <ggaren@apple.com>
1724 - Headerdoc finished
1727 - Added a JSContextRef argument to many functions, because you need a
1728 JSContextRef for doing virtually anything. I expect to add this argument
1729 to even more functions in a future patch.
1731 - Removed the globalObjectPrototype argument to JSContextCreate because
1732 you can't create an object until you have a context, so it's impossible
1733 to pass a prototype object to JSContextCreate. That's OK because (1) there's
1734 no reason to give the global object a prototype and (2) if you really want
1735 to, you can just use a separate call to JSObjectSetPrototype.
1737 - Removed the JSClassRef argument to JSClassCreate because it was unnecessary,
1738 and you need to be able to make the global object's class before you've
1739 created a JSContext.
1741 - Added an optional exception parameter to JSFunctionMakeWithBody because anything
1742 less would be uncivilized.
1744 - Made the return value parameter to JSObjectGetProperty optional to match
1745 all other return value parameters in the API.
1747 - Made JSObjectSetPrivate/JSObjectGetPrivate work on JSCallbackFunctions
1748 and JSCallbackConstructors. You could use an abstract base class or strategic
1749 placement of m_privateData in the class structure to implement this, but
1750 the former seemed like overkill, and the latter seemed too dangerous.
1752 - Fixed a bug where JSPropertyEnumeratorGetNext would skip the first property.
1755 - Reversed the logic of the JSChar #ifdef to avoid confusing headerdoc
1757 - Removed function names from @function declarations because headeroc
1758 can parse them automatically, and I wanted to rule out manual mismatch.
1760 - Changed Error::create to take a const UString& instead of a UString*
1761 because it was looking at me funny.
1763 - Renamed JSStringBufferCreateWithCFString to JSStringBufferCreateCF
1764 because the latter is more concise and it matches JSStringBufferCreateUTF8.
1766 * API/JSCallbackObject.cpp:
1767 (KJS::JSCallbackObject::getOwnPropertySlot):
1768 (KJS::JSCallbackObject::put):
1769 (KJS::JSCallbackObject::deleteProperty):
1770 (KJS::JSCallbackObject::getPropertyList):
1771 (KJS::JSCallbackObject::toBoolean):
1772 (KJS::JSCallbackObject::toNumber):
1773 (KJS::JSCallbackObject::toString):
1774 * API/JSClassRef.cpp:
1776 * API/JSContextRef.cpp:
1778 (JSContextSetException):
1779 * API/JSContextRef.h:
1781 (JSNodePrototype_class):
1784 (JSNodeListPrototype_class):
1786 * API/JSObjectRef.cpp:
1787 (JSObjectGetProperty):
1788 (JSObjectGetPrivate):
1789 (JSObjectSetPrivate):
1790 (JSObjectCallAsFunction):
1791 (JSObjectCallAsConstructor):
1792 (JSPropertyEnumeratorGetNext):
1793 * API/JSObjectRef.h:
1794 * API/JSStringBufferRef.cpp:
1795 (JSStringBufferCreateCF):
1796 * API/JSStringBufferRef.h:
1797 * API/JSValueRef.cpp:
1798 (JSValueIsInstanceOf):
1804 (MyObject_hasProperty):
1805 (MyObject_setProperty):
1806 (MyObject_deleteProperty):
1807 (MyObject_getPropertyList):
1808 (MyObject_convertToType):
1811 * JavaScriptCore.exp:
1813 2006-07-07 Geoffrey Garen <ggaren@apple.com>
1817 - Fixed a few crashes resulting from NULL parameters to JSClassCreate.
1819 * API/JSClassRef.cpp:
1822 * API/testapi.c: Added test for NULL parameters.
1825 2006-07-07 Geoffrey Garen <ggaren@apple.com>
1827 Reviewed by John, mocked by Darin.
1829 - Changed JSEvaluate to take a JSObjectRef instead of a JSValueRef as
1830 "this," since "this" must be an object.
1832 * API/JSContextRef.cpp:
1834 * API/JSContextRef.h:
1836 2006-07-07 Geoffrey Garen <ggaren@apple.com>
1843 * JavaScriptCore.xcodeproj/project.pbxproj:
1845 2006-07-05 Geoffrey Garen <ggaren@apple.com>
1849 Renamed JSCharBufferRef, which was universally unpopular, to JSStringBufferRef,
1850 which, hopefully, will be less unpopular.
1856 * API/JSCallbackObject.cpp:
1857 (KJS::JSCallbackObject::getOwnPropertySlot):
1858 (KJS::JSCallbackObject::put):
1859 (KJS::JSCallbackObject::deleteProperty):
1860 (KJS::JSCallbackObject::staticValueGetter):
1861 (KJS::JSCallbackObject::callbackGetter):
1862 * API/JSCharBufferRef.cpp: Removed.
1863 * API/JSCharBufferRef.h: Removed.
1864 * API/JSContextRef.cpp:
1867 * API/JSContextRef.h:
1869 (JSNodePrototype_appendChild):
1870 (JSNode_getNodeType):
1871 (JSNode_getChildNodes):
1872 (JSNode_getFirstChild):
1874 (JSNodeList_length):
1875 (JSNodeList_getProperty):
1876 * API/JSObjectRef.cpp:
1877 (JSFunctionMakeWithBody):
1878 (JSObjectGetDescription):
1879 (JSObjectHasProperty):
1880 (JSObjectGetProperty):
1881 (JSObjectSetProperty):
1882 (JSObjectDeleteProperty):
1883 (JSPropertyEnumeratorGetNext):
1884 (JSPropertyListAdd):
1885 * API/JSObjectRef.h:
1886 * API/JSStringBufferRef.cpp: Added.
1888 (JSStringBufferCreate):
1889 (JSStringBufferCreateUTF8):
1890 (JSStringBufferRetain):
1891 (JSStringBufferRelease):
1892 (JSValueCopyStringValue):
1893 (JSStringBufferGetLength):
1894 (JSStringBufferGetCharactersPtr):
1895 (JSStringBufferGetCharacters):
1896 (JSStringBufferGetMaxLengthUTF8):
1897 (JSStringBufferGetCharactersUTF8):
1898 (JSStringBufferIsEqual):
1899 (JSStringBufferIsEqualUTF8):
1900 (JSStringBufferCreateWithCFString):
1901 (CFStringCreateWithJSStringBuffer):
1902 * API/JSStringBufferRef.h: Added.
1904 * API/JavaScriptCore.h:
1909 (assertEqualsAsUTF8String):
1910 (assertEqualsAsCharactersPtr):
1911 (assertEqualsAsCharacters):
1912 (MyObject_hasProperty):
1913 (MyObject_getProperty):
1914 (MyObject_setProperty):
1915 (MyObject_deleteProperty):
1916 (MyObject_getPropertyList):
1917 (print_callAsFunction):
1918 (myConstructor_callAsConstructor):
1920 * JavaScriptCore.exp:
1921 * JavaScriptCore.xcodeproj/project.pbxproj:
1923 2006-07-05 Geoffrey Garen <ggaren@apple.com>
1927 Moved some code around for more logical file separation.
1930 * API/JSContextRef.h:
1931 * API/JSObjectRef.cpp:
1932 * API/JSValueRef.cpp:
1936 2006-07-03 Geoffrey Garen <ggaren@apple.com>
1940 Implemented JSFunctionMakeWithBody, which parses a script as a function body
1941 in the global scope, and returns the resulting anonymous function.
1943 I also removed private data from JSCallbackFunction. It never worked,
1944 since JSCallbackFunction doesn't inherit from JSCallbackObject.
1946 * API/JSCallbackConstructor.cpp: Removed.
1947 * API/JSCallbackConstructor.h: Removed.
1948 * API/JSCallbackFunction.cpp:
1949 (KJS::JSCallbackFunction::JSCallbackFunction):
1950 (KJS::JSCallbackFunction::implementsConstruct):
1951 (KJS::JSCallbackFunction::construct):
1952 (KJS::JSCallbackFunction::implementsCall):
1953 (KJS::JSCallbackFunction::callAsFunction):
1954 * API/JSCallbackFunction.h:
1955 * API/JSCallbackObject.cpp:
1956 (KJS::JSCallbackObject::staticFunctionGetter):
1957 * API/JSObjectRef.cpp:
1959 (JSFunctionMakeWithCallbacks):
1960 * API/JSObjectRef.h:
1966 * JavaScriptCore.exp: Programmatically added all symbols exported by
1967 API object files, and sorted results
1968 * JavaScriptCore.xcodeproj/project.pbxproj:
1970 2006-07-03 Geoffrey Garen <ggaren@apple.com>
1974 - Return syntax error in JSCheckSyntax through a JSValueRef* exception
1978 * API/JSContextRef.cpp:
1982 * JavaScriptCore.exp:
1983 * kjs/interpreter.cpp:
1984 (KJS::Interpreter::checkSyntax):
1985 * kjs/interpreter.h:
1987 2006-07-04 Darin Adler <darin@apple.com>
1991 * wtf/MathExtras.h: Oops. Added missing #endif.
1993 2006-07-04 Bjoern Graf <bjoern.graf@gmail.com>
1996 Tweaked a bit by Darin.
1998 - http://bugzilla.opendarwin.org/show_bug.cgi?id=9678
1999 work around MSVCRT's fmod function returning NaN for fmod(x, infinity) instead of x
2001 * wtf/MathExtras.h: Added include of <float.h>.
2002 (isinf): Fix to return false for NAN.
2003 (wtf_fmod): Added. An inline that works around the bug.
2006 * kjs/number_object.cpp:
2007 * kjs/operations.cpp:
2009 Added includes of MathExtras.h to all files using fmod.
2011 * JavaScriptCore.xcodeproj/project.pbxproj: Let Xcode 2.3 have its way with
2014 2006-07-01 Geoffrey Garen <ggaren@apple.com>
2018 - Refined value conversions in the API:
2019 - failed toNumber returns NaN
2020 - failed toObject returns NULL
2021 - failed toString returns empty string
2023 - Refined excpetion handling in the API:
2024 - failed value conversions do not throw exceptions
2025 - uncaught exceptions in JSEvaluate, JSObjectCallAsFunction, and
2026 JSObjectCallAsConstructor are returned through a JSValueRef* exception
2028 - removed JSContextHasException, because JSContextGetException does
2032 * API/JSCharBufferRef.cpp:
2033 (JSValueCopyStringValue):
2034 * API/JSContextRef.cpp:
2036 * API/JSContextRef.h:
2037 * API/JSNodeList.c: Added test code demonstrating how you would use
2038 toNumber, and why you probably don't need toUInt32, etc.
2039 (JSNodeListPrototype_item):
2040 (JSNodeList_getProperty):
2041 * API/JSObjectRef.cpp:
2043 (JSObjectCallAsFunction):
2044 (JSObjectCallAsConstructor):
2045 * API/JSObjectRef.h:
2046 * API/JSValueRef.cpp:
2052 (main): Added tests for new rules, and call to JSGCProtect to fix Intel
2054 * JavaScriptCore.exp:
2056 2006-07-03 Darin Adler <darin@apple.com>
2058 - Rolled out HashMap implementation of NPRuntime, at least temporarily.
2060 Fixes hang in the bindings section of layout tests seen on the
2063 This code was using HashMap<const char*, PrivateIdentifier*>.
2064 But that hashes based on pointer identity, not string value.
2065 The default hash for any pointer type is to hash based on the pointer.
2066 And WTF doesn't currently have a string hash for char*.
2067 We'll need to fix that before re-landing this patch.
2069 (Formatting was also incorrect -- extra spaces in parentheses.)
2071 * bindings/npruntime.cpp: Rolled out last change.
2073 2006-07-02 Justin Haygood <jhaygood@spsu.edu>
2075 Reviewed, tweaked, landed by ggaren.
2077 - Port NPRuntime from CFDictionary to HashMap.
2079 * bindings/npruntime.cpp:
2080 (getStringIdentifierDictionary):
2081 (getIntIdentifierDictionary):
2082 (_NPN_GetStringIdentifier):
2083 (_NPN_GetIntIdentifier):
2084 * bindings/npruntime.h:
2086 2006-07-01 Geoffrey Garen <ggaren@apple.com>
2090 - Fixed <rdar://problem/4611197> REGRESSION: Liveconnect with Java test
2091 fails at http://www-sor.inria.fr/~dedieu/notes/liveconnect/simple_example.html
2093 * JavaScriptCore.exp: Export symbols used by liveconnect
2095 2006-06-29 Geoffrey Garen <ggaren@apple.com>
2099 - Phase 2 in the JS API.
2101 - Added support for specifying static tables of values -- this should
2102 obviate the need for using complicated callbacks for most lookups.
2104 - API objects are now created with classes (JSClassRef) -- in order to support
2105 static values, and in order to prevent API objects from storing their
2106 data inline, and thus falling into the oversized (read: slow and prone to
2107 giving Maciej the frowny face) heap.
2109 - Added two specialized JSObject subclasses -- JSCallbackFunction and JSCallbackConstructor --
2110 to allow JSFunctionMake and JSConstructorMake to continue to work with
2111 the new class model. Another solution to this problem would be to create
2112 a custom class object for each function and constructor you make. This
2113 solution is more code but also more efficient.
2115 - Substantially beefed up the minidom example to demonstrate and test a
2116 lot of these techniques. Its output is still pretty haphazard, though.
2118 - Gave the <kjs/ preface to some includes -- I'm told this matters to
2119 building on some versions of Linux.
2121 - Implemented JSValueIsInstanceOf and JSValueIsObjectOfClass
2123 - Removed GetDescription callback. Something in the class datastructure
2124 should take care of this.
2127 * API/JSCallbackConstructor.cpp: Added.
2129 (KJS::JSCallbackConstructor::JSCallbackConstructor):
2130 (KJS::JSCallbackConstructor::implementsConstruct):
2131 (KJS::JSCallbackConstructor::construct):
2132 (KJS::JSCallbackConstructor::setPrivate):
2133 (KJS::JSCallbackConstructor::getPrivate):
2134 * API/JSCallbackConstructor.h: Added.
2135 (KJS::JSCallbackConstructor::classInfo):
2136 * API/JSCallbackFunction.cpp: Added.
2138 (KJS::JSCallbackFunction::JSCallbackFunction):
2139 (KJS::JSCallbackFunction::implementsCall):
2140 (KJS::JSCallbackFunction::callAsFunction):
2141 (KJS::JSCallbackFunction::setPrivate):
2142 (KJS::JSCallbackFunction::getPrivate):
2143 * API/JSCallbackFunction.h: Added.
2144 (KJS::JSCallbackFunction::classInfo):
2145 * API/JSCallbackObject.cpp:
2147 (KJS::JSCallbackObject::JSCallbackObject):
2148 (KJS::JSCallbackObject::init):
2149 (KJS::JSCallbackObject::~JSCallbackObject):
2150 (KJS::JSCallbackObject::className):
2151 (KJS::JSCallbackObject::getOwnPropertySlot):
2152 (KJS::JSCallbackObject::put):
2153 (KJS::JSCallbackObject::deleteProperty):
2154 (KJS::JSCallbackObject::implementsConstruct):
2155 (KJS::JSCallbackObject::construct):
2156 (KJS::JSCallbackObject::implementsCall):
2157 (KJS::JSCallbackObject::callAsFunction):
2158 (KJS::JSCallbackObject::getPropertyList):
2159 (KJS::JSCallbackObject::toBoolean):
2160 (KJS::JSCallbackObject::toNumber):
2161 (KJS::JSCallbackObject::toString):
2162 (KJS::JSCallbackObject::inherits):
2163 (KJS::JSCallbackObject::staticValueGetter):
2164 (KJS::JSCallbackObject::staticFunctionGetter):
2165 (KJS::JSCallbackObject::callbackGetter):
2166 * API/JSCallbackObject.h:
2167 * API/JSCharBufferRef.cpp:
2168 * API/JSClassRef.cpp: Added.
2172 * API/JSClassRef.h: Added.
2173 (StaticValueEntry::StaticValueEntry):
2174 (StaticFunctionEntry::StaticFunctionEntry):
2175 (__JSClass::__JSClass):
2176 * API/JSContextRef.cpp:
2179 * API/JSContextRef.h:
2180 * API/JSNode.c: Added.
2181 (JSNodePrototype_appendChild):
2182 (JSNodePrototype_removeChild):
2183 (JSNodePrototype_replaceChild):
2184 (JSNodePrototype_class):
2185 (JSNode_getNodeType):
2186 (JSNode_getChildNodes):
2187 (JSNode_getFirstChild):
2193 * API/JSNode.h: Added.
2194 * API/JSNodeList.c: Added.
2195 (JSNodeListPrototype_item):
2196 (JSNodeListPrototype_class):
2197 (JSNodeList_length):
2198 (JSNodeList_getProperty):
2199 (JSNodeList_finalize):
2201 (JSNodeList_prototype):
2203 * API/JSNodeList.h: Added.
2204 * API/JSObjectRef.cpp:
2207 (JSConstructorMake):
2208 (__JSPropertyEnumerator::__JSPropertyEnumerator):
2209 (JSObjectCreatePropertyEnumerator):
2210 (JSPropertyEnumeratorGetNext):
2211 (JSPropertyEnumeratorRetain):
2212 (JSPropertyEnumeratorRelease):
2213 * API/JSObjectRef.h:
2214 (__JSObjectCallbacks::):
2215 * API/JSValueRef.cpp:
2216 (JSValueIsObjectOfClass):
2217 (JSValueIsInstanceOf):
2219 * API/Node.c: Added.
2223 (Node_replaceChild):
2226 * API/Node.h: Added.
2227 * API/NodeList.c: Added.
2233 * API/NodeList.h: Added.
2237 (createStringWithContentsOfFile):
2240 (assertEqualsAsCharacters):
2241 (MyObject_getProperty):
2243 (myConstructor_callAsConstructor):
2246 * JavaScriptCore.xcodeproj/project.pbxproj:
2248 2006-06-26 Kevin Ollivier <kevino@theolliviers.com>
2250 Reviewed and tweaked by Darin.
2252 - Compile fixes for wx port / gcc 4.0.2
2254 * kjs/array_object.cpp:
2255 Added missing headers.
2258 gcc needs class prototypes before defining those classes as friend classes
2260 2006-06-30 Mike Emmel <mike.emmel@gmail.com>
2264 Compilation fixes for Linux/Gdk.
2266 * JavaScriptCore/kjs/interpreter.cpp: added include of signal.h
2267 * JavaScriptCore/kjs/ExecState.h: added missing class declaration
2268 * JavaScriptCore/kjs/ExecState.cpp: case wrong on include of context.h
2269 * JavaScriptCore/JavaScriptCoreSources.bkl: added Context.cpp and ExecState.cpp
2271 === Safari-521.14 ===
2273 2006-06-29 Maciej Stachowiak <mjs@apple.com>
2277 - add headerdoc comments to some of the new JS API headers
2282 2006-06-28 Timothy Hatcher <timothy@apple.com>
2284 Prefer the Stabs debugging symbols format until DWARF bugs are fixed.
2286 * JavaScriptCore.xcodeproj/project.pbxproj:
2288 2006-06-27 Timothy Hatcher <timothy@apple.com>
2292 <rdar://problem/4448350> Deprecated ObjC language API used in JavaScriptCore, WebCore, WebKit and WebBrowser
2294 Switch to the new ObjC 2 API, ifdefed the old code around OBJC_API_VERSION so it still works on Tiger.
2295 Removed the use of the old stringWithCString, switched to the new Tiger version that accepts an encoding.
2296 Lots of code style cleanup.
2298 * JavaScriptCore.xcodeproj/project.pbxproj:
2299 * bindings/objc/objc_class.h:
2300 * bindings/objc/objc_class.mm:
2301 (KJS::Bindings::ObjcClass::~ObjcClass):
2302 (KJS::Bindings::_createClassesByIsAIfNecessary):
2303 (KJS::Bindings::ObjcClass::classForIsA):
2304 (KJS::Bindings::ObjcClass::name):
2305 (KJS::Bindings::ObjcClass::methodsNamed):
2306 (KJS::Bindings::ObjcClass::fieldNamed):
2307 (KJS::Bindings::ObjcClass::fallbackObject):
2308 * bindings/objc/objc_header.h:
2309 * bindings/objc/objc_instance.h:
2310 * bindings/objc/objc_instance.mm:
2311 (ObjcInstance::ObjcInstance):
2312 (ObjcInstance::~ObjcInstance):
2313 (ObjcInstance::operator=):
2314 (ObjcInstance::begin):
2315 (ObjcInstance::end):
2316 (ObjcInstance::getClass):
2317 (ObjcInstance::invokeMethod):
2318 (ObjcInstance::invokeDefaultMethod):
2319 (ObjcInstance::setValueOfField):
2320 (ObjcInstance::supportsSetValueOfUndefinedField):
2321 (ObjcInstance::setValueOfUndefinedField):
2322 (ObjcInstance::getValueOfField):
2323 (ObjcInstance::getValueOfUndefinedField):
2324 (ObjcInstance::defaultValue):
2325 (ObjcInstance::stringValue):
2326 (ObjcInstance::numberValue):
2327 (ObjcInstance::booleanValue):
2328 (ObjcInstance::valueOf):
2329 * bindings/objc/objc_runtime.h:
2330 * bindings/objc/objc_runtime.mm:
2331 (ObjcMethod::ObjcMethod):
2333 (ObjcMethod::getMethodSignature):
2334 (ObjcMethod::setJavaScriptName):
2337 (ObjcField::valueFromInstance):
2338 (convertValueToObjcObject):
2339 (ObjcField::setValueToInstance):
2340 (ObjcArray::operator=):
2341 (ObjcArray::setValueAt):
2342 (ObjcArray::valueAt):
2343 (ObjcFallbackObjectImp::ObjcFallbackObjectImp):
2344 (ObjcFallbackObjectImp::callAsFunction):
2345 (ObjcFallbackObjectImp::defaultValue):
2347 2006-06-28 Anders Carlsson <acarlsson@apple.com>
2351 http://bugzilla.opendarwin.org/show_bug.cgi?id=8636
2352 REGRESSION: JavaScript access to Java applet causes hang (_webViewURL not implemented)
2354 * bindings/jni/jni_objc.mm:
2355 (KJS::Bindings::dispatchJNICall):
2356 Just pass nil as the calling URL. This will cause the Java plugin to use the URL of the page
2357 containing the applet (which is what we used to do).
2359 2006-06-27 Timothy Hatcher <timothy@apple.com>
2363 <rdar://problem/4406785> Add an export file to TOT JavaScriptCore like the Safari-2-0-branch
2365 * JavaScriptCore.exp: Added.
2366 * JavaScriptCore.xcodeproj/project.pbxproj:
2368 2006-06-25 Geoffrey Garen <ggaren@apple.com>
2372 - Added JSConstructorMake to match JSFunctionMake, along with test code.
2374 [ I checked in the ChangeLog before without the actual files. ]
2376 * API/JSObjectRef.cpp:
2377 (JSConstructorMake):
2378 * API/JSObjectRef.h:
2380 (myConstructor_callAsConstructor):
2384 * JavaScriptCore.xcodeproj/project.pbxproj: Moved testapi.c to the testapi
2385 target -- this was an oversight in my earlier check-in.
2387 2006-06-25 Timothy Hatcher <timothy@apple.com>
2391 Bug 9574: Drosera should show inline scripts within the original HTML
2392 http://bugzilla.opendarwin.org/show_bug.cgi?id=9574
2394 Pass the starting line number and error message to the debugger.
2397 (Debugger::sourceParsed):
2400 (KJS::GlobalFuncImp::callAsFunction):
2401 * kjs/function_object.cpp:
2402 (FunctionObjectImp::construct):
2403 * kjs/interpreter.cpp:
2404 (KJS::Interpreter::evaluate):
2406 2006-06-24 Alexey Proskuryakov <ap@nypop.com>
2408 Rubber-stamped by Eric.
2410 Add a -h (do not follow symlinks) option to ln in derived sources build script (without it,
2411 a symlink was created inside the source directory on second build).
2413 * JavaScriptCore.xcodeproj/project.pbxproj:
2415 2006-06-24 David Kilzer <ddkilzer@kilzer.net>
2417 Reviewed by Timothy.
2419 * Info.plist: Fixed copyright to include 2003-2006.
2421 2006-06-24 Alexey Proskuryakov <ap@nypop.com>
2425 - http://bugzilla.opendarwin.org/show_bug.cgi?id=9418
2426 WebKit will not build when Space exists in path
2428 * JavaScriptCore.xcodeproj/project.pbxproj: Enclose search paths in quotes; create symlinks to
2429 avoid passing paths with spaces to make.
2431 2006-06-23 Timothy Hatcher <timothy@apple.com>
2435 Adding more operator[] overloads for long and short types.
2438 (WTF::Vector::operator[]):
2440 === JavaScriptCore-521.13 ===
2442 2006-06-22 Alexey Proskuryakov <ap@nypop.com>
2446 - http://bugzilla.opendarwin.org/show_bug.cgi?id=9539
2447 Another case error preventing build
2449 * API/JSObjectRef.cpp: Changed "identifier.h" to "Identifier.h"
2451 2006-06-22 David Kilzer <ddkilzer@kilzer.net>
2455 http://bugzilla.opendarwin.org/show_bug.cgi?id=9539
2456 Another case error preventing build
2458 * API/APICast.h: Changed "UString.h" to "ustring.h".
2460 2006-06-21 Geoffrey Garen <ggaren@apple.com>
2462 Fixed release build, fixed accidental infinite recursion due to
2463 last minute global replace gone awry.
2468 (assertEqualsAsBoolean):
2469 (assertEqualsAsNumber):
2470 (assertEqualsAsUTF8String):
2471 (assertEqualsAsCharactersPtr):
2472 * JavaScriptCore.xcodeproj/project.pbxproj:
2474 2006-06-21 Geoffrey Garen <ggaren@apple.com>
2478 - First cut at C API to JavaScript. Includes a unit test, 'testapi.c',
2479 and the outline of a test app, 'minidom.c'.
2481 Includes one change to JSC internals: Rename propList to getPropertyList and have it
2482 take its target property list by reference so that subclasses can
2483 add properties to the list before calling through to their superclasses.
2485 Also, I just ran prepare-ChangeLog in about 10 seconds, and I would like
2486 to give a shout-out to that.
2488 * API/APICast.h: Added.
2491 * API/JSBase.h: Added.
2492 * API/JSCallbackObject.cpp: Added.
2494 (KJS::JSCallbackObject::JSCallbackObject):
2495 (KJS::JSCallbackObject::~JSCallbackObject):
2496 (KJS::JSCallbackObject::className):
2497 (KJS::JSCallbackObject::getOwnPropertySlot):
2498 (KJS::JSCallbackObject::put):
2499 (KJS::JSCallbackObject::deleteProperty):
2500 (KJS::JSCallbackObject::implementsConstruct):
2501 (KJS::JSCallbackObject::construct):
2502 (KJS::JSCallbackObject::implementsCall):
2503 (KJS::JSCallbackObject::callAsFunction):
2504 (KJS::JSCallbackObject::getPropertyList):
2505 (KJS::JSCallbackObject::toBoolean):
2506 (KJS::JSCallbackObject::toNumber):
2507 (KJS::JSCallbackObject::toString):
2508 (KJS::JSCallbackObject::setPrivate):
2509 (KJS::JSCallbackObject::getPrivate):
2510 (KJS::JSCallbackObject::cachedValueGetter):
2511 (KJS::JSCallbackObject::callbackGetter):
2512 * API/JSCallbackObject.h: Added.
2513 (KJS::JSCallbackObject::classInfo):
2514 * API/JSCharBufferRef.cpp: Added.
2516 (JSCharBufferCreate):
2517 (JSCharBufferCreateUTF8):
2518 (JSCharBufferRetain):
2519 (JSCharBufferRelease):
2520 (JSValueCopyStringValue):
2521 (JSCharBufferGetLength):
2522 (JSCharBufferGetCharactersPtr):
2523 (JSCharBufferGetCharacters):
2524 (JSCharBufferGetMaxLengthUTF8):
2525 (JSCharBufferGetCharactersUTF8):
2526 (JSCharBufferIsEqual):
2527 (JSCharBufferIsEqualUTF8):
2528 (JSCharBufferCreateWithCFString):
2529 (CFStringCreateWithJSCharBuffer):
2530 * API/JSCharBufferRef.h: Added.
2531 * API/JSContextRef.cpp: Added.
2534 (JSContextGetGlobalObject):
2537 (JSContextHasException):
2538 (JSContextGetException):
2539 (JSContextClearException):
2540 (JSContextSetException):
2541 * API/JSContextRef.h: Added.
2542 * API/JSObjectRef.cpp: Added.
2546 (JSObjectGetDescription):
2547 (JSObjectGetPrototype):
2548 (JSObjectSetPrototype):
2549 (JSObjectHasProperty):
2550 (JSObjectGetProperty):
2551 (JSObjectSetProperty):
2552 (JSObjectDeleteProperty):
2553 (JSObjectGetPrivate):
2554 (JSObjectSetPrivate):
2555 (JSObjectIsFunction):
2556 (JSObjectCallAsFunction):
2557 (JSObjectIsConstructor):
2558 (JSObjectCallAsConstructor):
2559 (__JSPropertyListEnumerator::__JSPropertyListEnumerator):
2560 (JSObjectCreatePropertyEnumerator):
2561 (JSPropertyEnumeratorGetNext):
2562 (JSPropertyEnumeratorRetain):
2563 (JSPropertyEnumeratorRelease):
2564 (JSPropertyListAdd):
2565 * API/JSObjectRef.h: Added.
2566 * API/JSValueRef.cpp: Added.
2568 (JSValueIsUndefined):
2575 (JSValueIsStrictEqual):
2585 * API/JSValueRef.h: Added.
2586 * API/JavaScriptCore.h: Added.
2587 * API/minidom.c: Added.
2589 * API/minidom.html: Added.
2590 * API/minidom.js: Added.
2591 * API/testapi.c: Added.
2592 (assertEqualsAsBoolean):
2593 (assertEqualsAsNumber):
2594 (assertEqualsAsUTF8String):
2595 (assertEqualsAsCharactersPtr):
2596 (assertEqualsAsCharacters):
2597 (MyObject_initialize):
2598 (MyObject_copyDescription):
2599 (MyObject_hasProperty):
2600 (MyObject_getProperty):
2601 (MyObject_setProperty):
2602 (MyObject_deleteProperty):
2603 (MyObject_getPropertyList):
2604 (MyObject_callAsFunction):
2605 (MyObject_callAsConstructor):
2606 (MyObject_convertToType):
2607 (MyObject_finalize):
2608 (print_callAsFunction):
2610 (createStringWithContentsOfFile):
2611 * API/testapi.js: Added.
2613 * JavaScriptCore.xcodeproj/project.pbxproj:
2614 * bindings/npruntime_impl.h:
2615 * kjs/array_instance.h:
2616 * kjs/array_object.cpp:
2617 (ArrayInstance::getPropertyList):
2618 * kjs/interpreter.cpp:
2619 (KJS::Interpreter::evaluate):
2621 (ForInNode::execute):
2623 (KJS::JSObject::put):
2624 (KJS::JSObject::canPut):
2625 (KJS::JSObject::deleteProperty):
2626 (KJS::JSObject::propertyIsEnumerable):
2627 (KJS::JSObject::getPropertyAttributes):
2628 (KJS::JSObject::getPropertyList):
2630 * kjs/property_map.cpp:
2631 (KJS::PropertyMap::get):
2632 * kjs/property_map.h:
2633 * kjs/scope_chain.cpp:
2634 (KJS::ScopeChain::print):
2635 * kjs/string_object.cpp:
2636 (StringInstance::getPropertyList):
2637 * kjs/string_object.h:
2639 (KJS::UString::Rep::ref):
2641 2006-06-20 Timothy Hatcher <timothy@apple.com>
2645 Make sure we clear the exception before returning so
2646 that future calls will not fail because of an earlier
2647 exception state. Assert on entry that the WebScriptObject
2648 is working with an ExecState that dose not have an exception.
2649 Document that evaluateWebScript and callWebScriptMethod return
2650 WebUndefined when an exception is thrown.
2652 * bindings/objc/WebScriptObject.h:
2653 * bindings/objc/WebScriptObject.mm:
2654 (-[WebScriptObject callWebScriptMethod:withArguments:]):
2655 (-[WebScriptObject evaluateWebScript:]):
2656 (-[WebScriptObject setValue:forKey:]):
2657 (-[WebScriptObject valueForKey:]):
2658 (-[WebScriptObject removeWebScriptKey:]):
2659 (-[WebScriptObject webScriptValueAtIndex:]):
2660 (-[WebScriptObject setWebScriptValueAtIndex:value:]):
2662 2006-06-19 Anders Carlsson <acarlsson@apple.com>
2666 * kjs/interpreter.cpp:
2667 (KJS::TimeoutChecker::pauseTimeoutCheck):
2668 (KJS::TimeoutChecker::resumeTimeoutCheck):
2669 Fix argument order in setitimer calls.
2671 2006-06-18 Anders Carlsson <acarlsson@apple.com>
2675 * kjs/interpreter.cpp:
2676 (KJS::TimeoutChecker::pauseTimeoutCheck):
2677 Do nothing if the timeout check hasn't been started.
2679 (KJS::TimeoutChecker::resumeTimeoutCheck):
2680 Do nothing if the timeout check hasn't been started.
2681 Use the right signal handler when unblocking.
2683 (KJS::Interpreter::handleTimeout):
2684 pause/resume the timeout check around the call to
2685 shouldInterruptScript().
2687 2006-06-16 Ben Goodger <beng@google.com>
2691 http://bugzilla.opendarwin.org/show_bug.cgi?id=9491
2692 Windows build breaks in interpreter.cpp
2694 * kjs/interpreter.cpp
2695 (KJS::TimeoutChecker::pauseTimeoutCheck):
2696 (KJS::TimeoutChecker::resumeTimeoutCheck):
2697 Make sure to only assert equality with s_executingInterpreter when it
2698 is being used (i.e. when HAVE(SYS_TIME_H) == true)
2700 2006-06-17 David Kilzer <ddkilzer@kilzer.net>
2704 http://bugzilla.opendarwin.org/show_bug.cgi?id=9477
2705 REGRESSION: fast/dom/replaceChild.html crashes on WebKit ToT in debug build
2708 (KJS::FunctionImp::callAsFunction): Refetch the debugger after executing the function
2709 in case the WebFrame it was running in has since been destroyed.
2711 2006-06-17 David Kilzer <ddkilzer@kilzer.net>
2715 http://bugzilla.opendarwin.org/show_bug.cgi?id=9476
2716 REGRESSION: Reproducible crash after closing window after viewing
2717 css2.1/t0803-c5501-imrgn-t-00-b-ag.html
2720 (Debugger::detach): Call setDebugger(0) for all interpreters removed from
2721 the 'attached to a debugger' list.
2723 2006-06-17 Anders Carlsson <acarlsson@apple.com>
2725 Reviewed by Maciej and Geoff.
2727 http://bugzilla.opendarwin.org/show_bug.cgi?id=7080
2728 Provide some way to stop a JavaScript infinite loop
2732 Add Interrupted completion type.
2735 (KJS::FunctionImp::callAsFunction):
2736 (KJS::GlobalFuncImp::callAsFunction):
2737 Only set the exception on the new ExecState if the current one has had one.
2739 * kjs/interpreter.cpp:
2740 (KJS::TimeoutChecker::startTimeoutCheck):
2741 (KJS::TimeoutChecker::stopTimeoutCheck):
2742 (KJS::TimeoutChecker::alarmHandler):
2743 (KJS::TimeoutChecker::pauseTimeoutCheck):
2744 (KJS::TimeoutChecker::resumeTimeoutCheck):
2745 New TimeoutChecker class which handles setting Interpreter::m_timedOut flag after a given
2746 period of time. This currently only works on Unix platforms where setitimer and signals are used.
2748 (KJS::Interpreter::Interpreter):
2749 Initialize new member variables.
2751 (KJS::Interpreter::~Interpreter):
2752 Destroy the timeout checker.
2754 (KJS::Interpreter::startTimeoutCheck):
2755 (KJS::Interpreter::stopTimeoutCheck):
2756 (KJS::Interpreter::pauseTimeoutCheck):
2757 (KJS::Interpreter::resumeTimeoutCheck):
2758 Call the timeout checker.
2760 (KJS::Interpreter::handleTimeout):
2761 Called on timeout. Resets the m_timedOut flag and calls shouldInterruptScript.
2763 * kjs/interpreter.h:
2764 (KJS::Interpreter::setTimeoutTime):
2765 New function for setting the timeout time.
2767 (KJS::Interpreter::shouldInterruptScript):
2768 New function. The idea is that this should be overridden by subclasses in order to for example
2769 pop up a dialog asking the user if the script should be interrupted.
2771 (KJS::Interpreter::checkTimeout):
2772 New function which checks the m_timedOut flag and calls handleTimeout if it's set.
2775 (DoWhileNode::execute):
2776 (WhileNode::execute):
2778 Call Interpreter::checkTimeout after each iteration of the loop.
2780 2006-06-15 Timothy Hatcher <timothy@apple.com>
2782 Reviewed by Geoff and Darin.
2784 Prefer the DWARF debugging symbols format for use in Xcode 2.3.
2786 * JavaScriptCore.xcodeproj/project.pbxproj:
2788 2006-06-14 Geoffrey Garen <ggaren@apple.com>
2792 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=9438
2793 Someone broke ToT: cannot build
2795 * JavaScriptCore.xcodeproj/project.pbxproj:
2796 * bindings/runtime_root.h: Changed "Interpreter.h" to "interpreter.h"
2798 2006-06-12 Geoffrey Garen <ggaren@apple.com>
2802 * bindings/objc/WebScriptObject.mm:
2803 (+[WebScriptObject throwException:]): Restore assignment I accidentally
2804 deleted in previous commit
2806 2006-06-12 Geoffrey Garen <ggaren@apple.com>
2808 Reviewed by TimO, Maciej.
2810 - Merged InterpreterImp code into Interpreter, which implements
2811 all interpreter functionality now. This is part of my continuing quest
2812 to create an external notion of JS "execution context" that is unified and simple --
2813 something to replace the mix of Context, ContextImp, ExecState, Interpreter,
2814 InterpreterImp, and JSRun.
2816 All tests pass. Leaks test has not regressed from its baseline ~207 leaks
2817 with ~3460 leaked nodes.
2819 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2820 * JavaScriptCore.xcodeproj/project.pbxproj:
2821 * bindings/NP_jsobject.cpp:
2822 * bindings/objc/WebScriptObject.mm:
2823 (+[WebScriptObject throwException:]):
2824 * bindings/runtime_root.cpp:
2825 * bindings/runtime_root.h:
2827 (KJS::Context::Context):
2828 * kjs/ExecState.cpp: Added.
2829 (KJS::ExecState::lexicalInterpreter):
2830 * kjs/ExecState.h: Added.
2831 (KJS::ExecState::dynamicInterpreter):
2832 * kjs/SavedBuiltins.h: Added.
2833 * kjs/bool_object.cpp:
2834 (BooleanPrototype::BooleanPrototype):
2835 * kjs/collector.cpp:
2836 (KJS::Collector::collect):
2837 (KJS::Collector::numInterpreters):
2843 (KJS::FunctionImp::callAsFunction):
2844 (KJS::GlobalFuncImp::callAsFunction):
2845 * kjs/function_object.cpp:
2846 (FunctionObjectImp::construct):
2849 * kjs/interpreter.cpp:
2850 (KJS::interpreterMap):
2851 (KJS::Interpreter::Interpreter):
2852 (KJS::Interpreter::init):
2853 (KJS::Interpreter::~Interpreter):
2854 (KJS::Interpreter::globalObject):
2855 (KJS::Interpreter::initGlobalObject):
2856 (KJS::Interpreter::globalExec):
2857 (KJS::Interpreter::checkSyntax):
2858 (KJS::Interpreter::evaluate):
2859 (KJS::Interpreter::builtinObject):
2860 (KJS::Interpreter::builtinFunction):
2861 (KJS::Interpreter::builtinArray):
2862 (KJS::Interpreter::builtinBoolean):
2863 (KJS::Interpreter::builtinString):
2864 (KJS::Interpreter::builtinNumber):
2865 (KJS::Interpreter::builtinDate):
2866 (KJS::Interpreter::builtinRegExp):
2867 (KJS::Interpreter::builtinError):
2868 (KJS::Interpreter::builtinObjectPrototype):
2869 (KJS::Interpreter::builtinFunctionPrototype):
2870 (KJS::Interpreter::builtinArrayPrototype):
2871 (KJS::Interpreter::builtinBooleanPrototype):
2872 (KJS::Interpreter::builtinStringPrototype):
2873 (KJS::Interpreter::builtinNumberPrototype):
2874 (KJS::Interpreter::builtinDatePrototype):
2875 (KJS::Interpreter::builtinRegExpPrototype):
2876 (KJS::Interpreter::builtinErrorPrototype):
2877 (KJS::Interpreter::builtinEvalError):
2878 (KJS::Interpreter::builtinRangeError):
2879 (KJS::Interpreter::builtinReferenceError):
2880 (KJS::Interpreter::builtinSyntaxError):
2881 (KJS::Interpreter::builtinTypeError):
2882 (KJS::Interpreter::builtinURIError):
2883 (KJS::Interpreter::builtinEvalErrorPrototype):
2884 (KJS::Interpreter::builtinRangeErrorPrototype):
2885 (KJS::Interpreter::builtinReferenceErrorPrototype):
2886 (KJS::Interpreter::builtinSyntaxErrorPrototype):
2887 (KJS::Interpreter::builtinTypeErrorPrototype):
2888 (KJS::Interpreter::builtinURIErrorPrototype):
2889 (KJS::Interpreter::mark):
2890 (KJS::Interpreter::interpreterWithGlobalObject):
2891 (KJS::Interpreter::saveBuiltins):
2892 (KJS::Interpreter::restoreBuiltins):
2893 * kjs/interpreter.h:
2894 (KJS::Interpreter::setCompatMode):
2895 (KJS::Interpreter::compatMode):
2896 (KJS::Interpreter::firstInterpreter):
2897 (KJS::Interpreter::nextInterpreter):
2898 (KJS::Interpreter::prevInterpreter):
2899 (KJS::Interpreter::debugger):
2900 (KJS::Interpreter::setDebugger):
2901 (KJS::Interpreter::setContext):
2902 (KJS::Interpreter::context):
2904 (StatementNode::hitStatement):
2905 (RegExpNode::evaluate):
2908 2006-06-12 Geoffrey Garen <ggaren@apple.com>
2912 - Have *.lut.h files #include lookup.h to eliminate surprising header
2913 include order dependency.
2915 * DerivedSources.make:
2916 * kjs/array_object.cpp:
2917 * kjs/date_object.cpp:
2918 * kjs/date_object.h:
2919 (KJS::DateProtoFunc::):
2921 * kjs/math_object.cpp:
2922 * kjs/number_object.cpp:
2923 * kjs/regexp_object.cpp:
2924 * kjs/string_object.cpp:
2926 2006-06-10 Geoffrey Garen <ggaren@apple.com>
2928 - http://bugzilla.opendarwin.org/show_bug.cgi?id=8515
2929 Linux porting compile bug
2931 Fix by Mike Emmel, Reviewed by Darin.
2933 * JavaScriptCoreSources.bkl:
2937 2006-06-09 Geoffrey Garen <ggaren@apple.com>
2939 Build fix -- I think :).
2941 * JavaScriptCore.xcodeproj/project.pbxproj:
2944 2006-06-09 Geoffrey Garen <ggaren@apple.com>
2946 Reviewed by Eric (yay!).
2948 - Removed Context wrapper for ContextImp, renamed ContextImp to Context,
2949 split Context into its own file -- Context.cpp -- renamed _var to m_var,
2950 change ' *' to '* '.
2952 * JavaScriptCore.xcodeproj/project.pbxproj:
2953 * kjs/Context.cpp: Added.
2954 (KJS::Context::Context):
2955 (KJS::Context::~Context):
2956 (KJS::Context::mark):
2958 (KJS::Context::scopeChain):
2959 (KJS::Context::variableObject):
2960 (KJS::Context::setVariableObject):
2961 (KJS::Context::thisValue):
2962 (KJS::Context::callingContext):
2963 (KJS::Context::activationObject):
2964 (KJS::Context::currentBody):
2965 (KJS::Context::function):
2966 (KJS::Context::arguments):
2967 (KJS::Context::pushScope):
2968 (KJS::Context::seenLabels):
2970 (KJS::FunctionImp::callAsFunction):
2971 (KJS::FunctionImp::processParameters):
2972 (KJS::FunctionImp::argumentsGetter):
2973 (KJS::GlobalFuncImp::callAsFunction):
2975 (KJS::InterpreterImp::evaluate):
2977 (KJS::InterpreterImp::setContext):
2978 (KJS::InterpreterImp::context):
2979 * kjs/interpreter.cpp:
2980 * kjs/interpreter.h:
2981 (KJS::ExecState::context):
2982 (KJS::ExecState::ExecState):
2986 (ThisNode::evaluate):
2987 (ResolveNode::evaluate):
2988 (FunctionCallResolveNode::evaluate):
2989 (PostfixResolveNode::evaluate):
2990 (DeleteResolveNode::evaluate):
2991 (TypeOfResolveNode::evaluate):
2992 (PrefixResolveNode::evaluate):
2993 (AssignResolveNode::evaluate):
2994 (VarDeclNode::evaluate):
2995 (VarDeclNode::processVarDecls):
2996 (DoWhileNode::execute):
2997 (WhileNode::execute):
2999 (ForInNode::execute):
3000 (ContinueNode::execute):
3001 (BreakNode::execute):
3002 (ReturnNode::execute):
3003 (WithNode::execute):
3004 (SwitchNode::execute):
3005 (LabelNode::execute):
3007 (FuncDeclNode::processFuncDecl):
3008 (FuncExprNode::evaluate):
3010 2006-06-07 Geoffrey Garen <ggaren@apple.com>
3012 Removed API directory I prematurely/accidentally added.
3016 2006-06-05 Mitz Pettel <opendarwin.org@mitzpettel.com>
3018 Reviewed and landed by Geoff.
3020 - fix a regression in ecma_3/String/regress-104375.js
3022 * kjs/string_object.cpp:
3023 (substituteBackreferences): If a 2-digit back reference is out of range,
3024 parse it as a 1-digit reference (followed by the other digit). This matches
3027 2006-06-05 Geoffrey Garen <ggaren@apple.com>
3030 Darin already reviewed this change on the branch. See <rdar://problem/4317701>.
3032 - Fixed <rdar://problem/4291345> PCRE overflow in Safari JavaScriptCore
3034 No test case because there's no behavior change.
3036 * pcre/pcre_compile.c:
3037 (read_repeat_counts): Check for integer overflow / out of bounds
3039 2006-06-05 Geoffrey Garen <ggaren@apple.com>
3043 - Changed CString length from int to size_t. We sould probably do this
3044 for UString, too. (Darin, if you're reading this: Maciej said so.)
3049 (KJS::CString::CString):
3052 (KJS::CString::size):
3054 2006-06-04 Geoffrey Garen <ggaren@apple.com>
3058 - http://bugzilla.opendarwin.org/show_bug.cgi?id=9304
3059 Minor cleanup in JavaScriptCore
3061 * kjs/value.h: Removed redundant declarations
3063 2006-06-04 Darin Adler <darin@apple.com>
3067 - changed deleteAllValues so it can work on "const" collections
3068 Deleting the values affects the values, not the pointers in the
3069 collection, so it's legitimate to do it to a const collection,
3070 and a case of that actually came up in the XPath code.
3073 (WTF::deleteAllPairSeconds): Use const iterators.
3074 (WTF::deleteAllValues): Take const HashMap reference as a parameter.
3076 (WTF::deleteAllValues): Take const HashSet reference as a parameter,
3077 and use const iterators.
3079 (WTF::deleteAllValues): Take const Vector reference as a parameter.
3081 - added more functions that are present in <math.h> on some platforms,
3082 but not on others; moved here from various files in WebCore
3093 2006-06-02 Mitz Pettel <opendarwin.org@mitzpettel.com>
3097 - http://bugzilla.opendarwin.org/show_bug.cgi?id=9234
3098 Implement $&, $' and $` replacement codes in String.prototype.replace
3100 Test: fast/js/string-replace-3.html
3102 * kjs/string_object.cpp:
3103 (substituteBackreferences): Added support for $& (matched substring),
3104 $` (everything preceding matched substring), $' (everything following
3105 matched substring) and 2-digit back references, and cleaned up a little.
3107 2006-06-02 Adele Peterson <adele@apple.com>
3111 Set incremental linking to no. This seems to fix a build problem I was seeing
3112 where dftables couldn't find a dll.
3114 * JavaScriptCore.vcproj/dftables/dftables.vcproj:
3116 2006-05-26 Steve Falkenburg <sfalken@apple.com>
3120 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3122 === JavaScriptCore-521.11 ===
3124 2006-05-24 Geoffrey Garen <ggaren@apple.com>
3128 - JSC half of fix for <rdar://problem/4557926> TOT REGRESSSION: Crash
3129 occurs when attempting to view image in slideshow mode at
3130 http://d.smugmug.com/gallery/581716 ( KJS::IfNode::execute
3131 (KJS::ExecState*) + 312)
3133 On alternate threads, DOMObjects remain in the
3134 ScriptInterpreter's cache because they're not collected. So, they
3135 need an opportunity to mark their children.
3137 I'm not particularly happy with this solution because it fails to
3138 resolve many outstanding issues with the DOM object cache. Since none
3139 of those issues is a crasher or a serious compatibility concern,
3140 and since the behavior of other browsers is not much to go on in this
3141 case, I've filed <rdar://problem/4561439> about that, and I'm moving on
3144 * JavaScriptCore.xcodeproj/project.pbxproj:
3145 * kjs/collector.cpp:
3146 (KJS::Collector::collect):
3148 (KJS::InterpreterImp::mark):
3150 * kjs/interpreter.cpp:
3151 (KJS::Interpreter::mark):
3152 * kjs/interpreter.h:
3154 === JavaScriptCore-521.10 ===
3156 2006-05-22 Timothy Hatcher <timothy@apple.com>
3158 Reviewed by Eric, Kevin and Geoff.
3160 Merge open source build fixes. <rdar://problem/4555500>
3162 * kjs/collector.cpp: look at the rsp register in x86_64
3163 (KJS::Collector::markOtherThreadConservatively):
3164 * wtf/Platform.h: add x86_64 to the platform list
3166 2006-05-19 Anders Carlsson <acarlsson@apple.com>
3170 http://bugzilla.opendarwin.org/show_bug.cgi?id=8993
3171 Support function declaration in case statements
3173 * kjs/grammar.y: Get rid of StatementList and use SourceElements instead.
3176 (CaseClauseNode::evalStatements):
3177 (CaseClauseNode::processVarDecls):
3178 (CaseClauseNode::processFuncDecl):
3179 (ClauseListNode::processFuncDecl):
3180 (CaseBlockNode::processFuncDecl):
3181 (SwitchNode::processFuncDecl):
3183 (KJS::CaseClauseNode::CaseClauseNode):
3184 (KJS::ClauseListNode::ClauseListNode):
3185 (KJS::ClauseListNode::getClause):
3186 (KJS::ClauseListNode::getNext):
3187 (KJS::ClauseListNode::releaseNext):
3188 (KJS::SwitchNode::SwitchNode):
3189 Add processFuncDecl for the relevant nodes.
3191 * kjs/nodes2string.cpp:
3192 (CaseClauseNode::streamTo):
3193 next got renamed to source.
3195 2006-05-17 George Staikos <staikos@kde.org>
3197 Reviewed by Maciej, Alexey, and Eric.
3199 * pcre/pcre_compile.c:
3202 * wtf/UnusedParam.h:
3203 Use /**/ in .c files to compile with non-C99 and non-GCC compilers.
3206 Change include to <wtf/HashTraits.h> from "HashTraits.h" to avoid -I
3208 * wtf/unicode/qt4/UnicodeQt4.h:
3209 Use correct parentheses and correct mask for utf-32 support.
3211 2006-05-17 Alexey Proskuryakov <ap@nypop.com>
3215 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8870
3216 Crash typing in Yahoo auto-complete widget.
3218 Test: fast/js/regexp-stack-overflow.html
3220 * pcre/pcre-config.h: Define NO_RECURSE.
3222 2006-05-16 George Staikos <staikos@kde.org>
3226 Fix some warnings and strict compilation errors.
3231 2006-05-15 Alexey Proskuryakov <ap@nypop.com>
3233 * make-generated-sources.sh: Changed to be executable and removed
3234 text in the file generated by "svn diff".
3236 2006-05-15 Geoffrey Garen <ggaren@apple.com>
3240 - Fixed <rdar://problem/4534904> please do not treat "debugger" as
3241 a reserved word while parsing JavaScript (and other ECMA reserved
3246 http://bugzilla.opendarwin.org/show_bug.cgi?id=6179
3247 We treat "char" as a reserved word in JavaScript and firefox/IE do
3250 (1) I unreserved most of the spec's "future reserved words" because
3251 they're not reserved in IE or FF. (Most, but not all, because IE
3252 somewhat randomly *does* reserve a few of them.)
3253 (2) I made 'debugger' a legitimate statement that acts like an empty
3254 statement because FF and IE support it.
3257 * kjs/keywords.table:
3259 2006-05-15 Tim Omernick <timo@apple.com>
3261 Reviewed by John Sullivan.
3263 Part of <rdar://problem/4466508> Add 64-bit support to the Netscape Plugin API
3265 Added to the Netscape Plugin API the concept of "plugin drawing models". The drawing model
3266 determines the kind of graphics context created by the browser for the plugin, as well as
3267 the Mac types of various Netscape Plugin API data structures.
3269 There is a drawing model to represent the old QuickDraw-based API. It is used by default
3270 if QuickDraw is available on the system, unless the plugin specifies another drawing model.
3272 The big change is the addition of the CoreGraphics drawing model. A plugin may request this
3273 drawing model to obtain access to a CGContextRef for drawing, instead of a QuickDraw CGrafPtr.
3276 Define NP_NO_QUICKDRAW when compiling 64-bit; there is no 64-bit QuickDraw.
3277 Added NPNVpluginDrawingModel, NPNVsupportsQuickDrawBool, and NPNVsupportsCoreGraphicsBool
3279 Added NPDrawingModel enumeration. Currently the only drawing models are QuickDraw and
3281 NPRegion's type now depends on the drawing model specified by the plugin.
3282 NP_Port is now only defined when QuickDraw is available.
3283 Added NP_CGContext, which is the type of the NPWindow's "window" member in CoreGraphics mode.
3285 2006-05-13 Kevin M. Ollivier <kevino@theolliviers.com>
3287 Reviewed by Darin, landed by ap.
3289 - http://bugzilla.opendarwin.org/show_bug.cgi?id=8528
3290 Bakefiles (and generated Makefiles) for wx and gdk ports
3292 * make-generated-sources.sh:
3293 Added script to configure environment to run DerivedSources.make
3295 * JavaScriptCoreSources.bkl:
3296 Added JavaScriptCore sources list for Bakefile.
3299 Bakefile used to generate JavaScriptCore project files
3300 (currently only used by wx and gdk ports)
3302 2006-05-09 Steve Falkenburg <sfalken@apple.com>
3305 Minor fixes to WTF headers.
3309 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Fix include dirs, paths to files.
3310 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj: Fix include dirs.
3311 * wtf/Assertions.h: include Platform.h to get definition for COMPILER()
3312 * wtf/Vector.h: include FastMalloc.h for definition of fastMalloc, fastFree
3314 2006-05-09 Maciej Stachowiak <mjs@apple.com>
3316 Rubber stamped by Anders.
3318 - renamed kxmlcore to wtf
3324 * JavaScriptCore.xcodeproj/project.pbxproj:
3325 * bindings/c/c_instance.cpp:
3326 * bindings/objc/WebScriptObject.mm:
3327 * kjs/JSImmediate.h:
3330 * kjs/array_object.cpp:
3331 * kjs/collector.cpp:
3332 (KJS::Collector::registerThread):
3336 (KJS::isStrWhiteSpace):
3338 * kjs/identifier.cpp:
3343 (Lexer::isWhiteSpace):
3344 (Lexer::isIdentStart):
3345 (Lexer::isIdentPart):
3349 * kjs/number_object.cpp:
3351 * kjs/property_map.cpp:
3352 * kjs/property_map.h:
3353 * kjs/string_object.cpp:
3354 (StringProtoFunc::callAsFunction):
3359 * kxmlcore: Removed.
3360 * kxmlcore/AlwaysInline.h: Removed.
3361 * kxmlcore/Assertions.cpp: Removed.
3362 * kxmlcore/Assertions.h: Removed.
3363 * kxmlcore/FastMalloc.cpp: Removed.
3364 * kxmlcore/FastMalloc.h: Removed.
3365 * kxmlcore/FastMallocInternal.h: Removed.
3366 * kxmlcore/Forward.h: Removed.
3367 * kxmlcore/HashCountedSet.h: Removed.
3368 * kxmlcore/HashFunctions.h: Removed.
3369 * kxmlcore/HashMap.h: Removed.
3370 * kxmlcore/HashSet.h: Removed.
3371 * kxmlcore/HashTable.cpp: Removed.
3372 * kxmlcore/HashTable.h: Removed.
3373 * kxmlcore/HashTraits.h: Removed.
3374 * kxmlcore/ListRefPtr.h: Removed.
3375 * kxmlcore/Noncopyable.h: Removed.
3376 * kxmlcore/OwnArrayPtr.h: Removed.
3377 * kxmlcore/OwnPtr.h: Removed.
3378 * kxmlcore/PassRefPtr.h: Removed.
3379 * kxmlcore/Platform.h: Removed.
3380 * kxmlcore/RefPtr.h: Removed.
3381 * kxmlcore/TCPageMap.h: Removed.
3382 * kxmlcore/TCSpinLock.h: Removed.
3383 * kxmlcore/TCSystemAlloc.cpp: Removed.
3384 * kxmlcore/TCSystemAlloc.h: Removed.
3385 * kxmlcore/UnusedParam.h: Removed.
3386 * kxmlcore/Vector.h: Removed.
3387 * kxmlcore/VectorTraits.h: Removed.
3388 * kxmlcore/unicode: Removed.
3389 * kxmlcore/unicode/Unicode.h: Removed.
3390 * kxmlcore/unicode/UnicodeCategory.h: Removed.
3391 * kxmlcore/unicode/icu: Removed.
3392 * kxmlcore/unicode/icu/UnicodeIcu.h: Removed.
3393 * kxmlcore/unicode/posix: Removed.
3394 * kxmlcore/unicode/qt3: Removed.
3395 * kxmlcore/unicode/qt4: Removed.
3396 * kxmlcore/unicode/qt4/UnicodeQt4.h: Removed.
3399 * wtf/Assertions.cpp:
3401 * wtf/FastMalloc.cpp:
3402 (WTF::TCMalloc_ThreadCache::Scavenge):
3405 (WTF::TCMallocGuard::TCMallocGuard):
3412 * wtf/FastMallocInternal.h:
3414 * wtf/HashCountedSet.h:
3415 * wtf/HashFunctions.h:
3418 * wtf/HashTable.cpp:
3422 * wtf/Noncopyable.h:
3423 * wtf/OwnArrayPtr.h:
3427 * wtf/TCSystemAlloc.cpp:
3428 (TCMalloc_SystemAlloc):
3430 * wtf/VectorTraits.h:
3431 * wtf/unicode/UnicodeCategory.h:
3432 * wtf/unicode/icu/UnicodeIcu.h:
3434 2006-05-08 Timothy Hatcher <timothy@apple.com>
3438 * bindings/npapi.h: do not define #pragma options align=mac68k if we are 64-bit
3440 2006-05-07 Darin Adler <darin@apple.com>
3442 Reviewed and landed by Maciej.
3444 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8765
3445 Random crashes on TOT since the form state change
3447 I haven't figured out how to construct a test for this, but this does seem to fix the
3448 problem; Mitz mentioned that a double-destroy was occurring in these functions.
3450 * kxmlcore/HashMap.h: (KXMLCore::HashMap::remove): Use RefCounter::deref instead of calling
3451 ~ValueType, because ~ValueType often results in a double-destroy, since the HashTable also
3452 destroys the element based on the storage type. The RefCounter template correctly does work
3453 only in cases where ValueType and ValueStorageType differ and this class is what's used
3454 elsewhere for the same purpose; I somehow missed this case when optimizing HashMap.
3455 * kxmlcore/HashSet.h: (KXMLCore::HashSet::remove): Ditto.
3457 2006-05-05 Darin Adler <darin@apple.com>
3459 - http://bugzilla.opendarwin.org/show_bug.cgi?id=8722
3460 IE compatibility fix in date parsing
3462 * kjs/date_object.cpp: (KJS::parseDate): Merged change that George Staikos provided
3463 from KDE 3.4.3 branch that allows day values of 0 and values that are > 1000.
3465 2006-05-04 Anders Carlsson <andersca@mac.com>
3469 http://bugzilla.opendarwin.org/show_bug.cgi?id=8734
3470 Would like a Vector::append that takes another Vector
3472 * kxmlcore/Vector.h:
3473 (KXMLCore::::append):
3474 New function that takes another array.
3476 2006-05-02 Steve Falkenburg <sfalken@apple.com>
3480 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: set NDEBUG for release build
3481 * kxmlcore/FastMalloc.cpp: Prevent USE_SYSTEM_MALLOC from being defined twice
3483 2006-05-02 Anders Carlsson <andersca@mac.com>
3487 * kxmlcore/HashMap.h:
3488 (KXMLCore::::operator):
3491 2006-05-01 Tim Omernick <timo@apple.com>
3493 Reviewed by Tim Hatcher.
3495 <rdar://problem/4476875> Support printing for embedded Netscape plugins
3498 Fixed struct alignment problem in our npapi.h. Structs must be 68k-aligned on both pre-Mac OS X
3499 and Mac OS X systems, as this is what plugins expect.
3501 2006-05-01 Timothy Hatcher <timothy@apple.com>
3505 <rdar://problem/4308243> 8F36 Regression: crash in malloc_consolidate if you use a .PAC file
3507 The original fix missed the oversized cell case. Added a test for "currentThreadIsMainThread ||
3508 imp->m_destructorIsThreadSafe" where we collect oversized cells.
3510 We don't have a way to test PAC files yet, so there's no test attached.
3512 * kjs/collector.cpp:
3513 (KJS::Collector::collect): test the thread when we collect oversized cells
3515 2006-05-01 Tim Omernick <timo@apple.com>
3519 <rdar://problem/4526114> REGRESSION (two days ago): LOG() just prints @ for NSObject substitutions
3521 * kxmlcore/Assertions.cpp:
3522 Changed sense of strstr("%@") check. I already made the same fix to the WebBrowser assertions.
3524 2006-04-28 Steve Falkenburg <sfalken@apple.com>
3528 Actually apply the change that was reviewed insted of checking it in with an #if 0 (oops).
3531 (main): Suppress C runtime alerts
3533 2006-04-28 Steve Falkenburg <sfalken@apple.com>
3537 Suppress error reporting dialog that blocks Javascript tests from completing.
3539 Real error is due to an overflow in the date/time handling functions that needs
3540 to be addressed, but this will prevent the hang running the Javascript tests
3541 on the build bot (along with the related changes).
3544 (main): Suppress C runtime