1 2006-09-28 Maciej Stachowiak <mjs@apple.com>
5 - fixed REGRESSION (r16606): javascriptCore Crash on website load
9 - fixed some possible off-by-one bugs
10 - use indexing, not iterators, for Vectors
11 - store Vector by pointer instead of by value to avoid blowing out FunctionImp size
14 (KJS::FunctionImp::addParameter):
15 (KJS::FunctionImp::parameterString):
16 (KJS::FunctionImp::processParameters):
17 (KJS::FunctionImp::lengthGetter):
18 (KJS::FunctionImp::getParameterName):
21 2006-09-27 Steve Falkenburg <sfalken@apple.com>
27 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
28 * JavaScriptCore.vcproj/JavaScriptCore/dstroot-to-sdk.cmd: Removed.
30 2006-09-27 John Sullivan <sullivan@apple.com>
33 (KJS::FunctionImp::getParameterName):
34 removed assertion that displeased gcc 4.0.1 (build 5420):
35 ASSERT(static_cast<size_t>(index) == index);
37 2006-09-27 Kevin McCullough <KMcCullough@apple.com>
41 Cleanup of previous fix which was to address Radar: 4752492
44 (KJS::FunctionImp::addParameter):
45 (KJS::FunctionImp::parameterString):
46 (KJS::FunctionImp::processParameters):
47 (KJS::FunctionImp::lengthGetter):
48 (KJS::FunctionImp::getParameterName):
51 2006-09-27 Kevin McCullough <KMcCullough@apple.com>
55 Fixes a GC stack overflow crash.
56 The change is to move from a linked list implementation of Parameters to a Vector.
57 The problem with the linked list is that each one creates it's own stack frame when being destroyed and in extreme cases this caused the stack to overflow.
60 (KJS::Parameter::Parameter):
61 (KJS::FunctionImp::addParameter):
62 (KJS::FunctionImp::parameterString):
63 (KJS::FunctionImp::processParameters):
64 (KJS::FunctionImp::lengthGetter):
65 (KJS::FunctionImp::getParameterName):
68 2006-09-27 Steve Falkenburg <sfalken@apple.com>
72 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
74 2006-09-27 Steve Falkenburg <sfalken@apple.com>
76 Set path before build.
78 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
80 2006-09-27 Sean Gies <seangies@apple.com>
82 Reviewed by Adam Roben.
84 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Debug config should link to debug runtime.
85 * JavaScriptCore.vcproj/dftables/dftables.vcproj: Debug config should link to debug runtime.
87 2006-09-27 Don Melton <gramps@apple.com>
89 Reviewed by Adam Roben.
91 Changed line ending from DOS to UNIX format so it doesn't die running
94 * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
96 2006-09-23 Alexey Proskuryakov <ap@nypop.com>
100 http://bugzilla.opendarwin.org/show_bug.cgi?id=10183
101 REGRESSION: obfuscated JS decoding breaks because of soft hyphen removal
102 (Fanfiction.net author pages not listing stories)
104 Rolled out the fix for bug 4139.
109 * tests/mozilla/ecma/Array/15.4.5.1-1.js:
110 * tests/mozilla/expected.html:
112 2006-09-22 Steve Falkenburg <sfalken@apple.com>
116 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
118 2006-09-22 Darin Adler <darin@apple.com>
122 * wtf/Vector.h: Add an append that takes a pointer and length.
123 Generalize the existing Vector append to work on vectors with
124 any value for inlineCapacity. Change the append algorithm so
125 it doesn't check capacity each time through the loop.
127 2006-09-22 Steve Falkenburg <sfalken@apple.com>
131 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
133 2006-09-21 Geoffrey Garen <ggaren@apple.com>
137 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
138 Updated to include the right path.
139 * wtf/FastMalloc.h: #include Platform.h, since we use Platform macros.
141 === Safari-521.27 ===
143 2006-09-20 Anders Carlsson <acarlsson@apple.com>
145 Reviewed by Dave Hyatt.
150 2006-09-20 Sean Gies <seangies@apple.com>
152 Reviewed by Steve Falkenburg.
154 * wtf/Assertions.cpp: Debug messages should go into debugger console.
156 2006-09-20 David Hyatt <hyatt@apple.com>
158 Add an implementation of lrint for Win32.
165 2006-09-15 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
169 http://bugzilla.opendarwin.org/show_bug.cgi?id=10864
170 Bug 10864: Linux\GDK build fixes
172 * JavaScriptCoreSources.bkl:
175 2006-09-15 Adam Roben <aroben@apple.com>
179 * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
181 2006-09-15 Anders Carlsson <acarlsson@apple.com>
183 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
184 Fix the release build.
186 2006-09-15 Anders Carlsson <acarlsson@apple.com>
190 Add JavaScriptCore API to the build.
192 * API/JSCallbackConstructor.cpp:
193 * API/JSCallbackFunction.cpp:
194 * API/JSCallbackObject.cpp:
195 * API/JSClassRef.cpp:
196 * API/JSContextRef.cpp:
197 * API/JSObjectRef.cpp:
198 * API/JSStringRef.cpp:
199 * API/JSValueRef.cpp:
200 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
201 * os-win32/stdbool.h: Added.
203 2006-09-12 Steve Falkenburg <sfalken@apple.com>
207 Build tweaks (doing JavaScriptCore now since it doesn't have
210 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
211 * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
212 * JavaScriptCore.vcproj/JavaScriptCore/dstroot-to-sdk.cmd: Added.
213 * JavaScriptCore.vcproj/dftables/dftables.vcproj:
214 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
216 2006-09-11 Brady Eidson <beidson@apple.com>
218 Build fix - I think Tim's last checkin wasn't tested on Tiger, possibly. I simply
219 commented out the undefined constants until he can have a chance to make the right call
221 * bindings/objc/objc_utility.mm:
222 (KJS::Bindings::objcValueTypeForType): Commented out undefined symbols
224 2006-09-11 Timothy Hatcher <timothy@apple.com>
226 Reviewed by Tim O. and Darin.
228 Add support for more method signatures affecting ObjC methods called from JavaScript:
229 - Added unsigned types and long long.
230 - Allow methods that use const, oneway, bycopy and byref type modifiers.
232 * bindings/objc/objc_instance.mm:
233 (ObjcInstance::invokeMethod):
234 * bindings/objc/objc_utility.h:
236 * bindings/objc/objc_utility.mm:
237 (KJS::Bindings::convertValueToObjcValue):
238 (KJS::Bindings::convertObjcValueToValue):
239 (KJS::Bindings::objcValueTypeForType):
241 2006-09-05 Timothy Hatcher <timothy@apple.com>
245 <rdar://problem/4715840> SEL is not char*
247 * bindings/objc/objc_class.mm:
248 (KJS::Bindings::ObjcClass::methodsNamed): use sel_getName instead of a char* cast.
249 * bindings/objc/objc_runtime.mm:
250 (ObjcFallbackObjectImp::callAsFunction): ditto
252 2006-09-03 Alexey Proskuryakov <ap@nypop.com>
256 http://bugzilla.opendarwin.org/show_bug.cgi?id=10693
257 Convert JavaScript arrays to AppleScript lists
259 * JavaScriptCore.exp: Export ArrayInstance::info and ArrayInstance::getItem().
260 * kjs/array_instance.h:
261 * kjs/array_object.cpp:
262 (ArrayInstance::getItem): Added a method to access array items from C++.
264 2006-09-02 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
268 Bug 10454: Unix bakefile fixes
269 http://bugzilla.opendarwin.org/show_bug.cgi?id=10454
271 * JavaScriptCoreSources.bkl:
273 2006-09-01 Nikolas Zimmermann <zimmermann@kde.org>
275 Reviewed by hyatt. Landed by eseidel.
279 * pcre/CMakeLists.txt: Add wtf/ include.
281 2006-09-01 Nikolas Zimmermann <zimmermann@kde.org>
283 Reviewed and landed by ap.
285 Fix build on Linux (C89 without gcc extensions enabled).
287 * pcre/pcre_internal.h: Use C style comments.
288 * wtf/Assertions.h: Use C style comments.
289 * wtf/Platform.h: Use C style comments.
291 2006-09-01 Steve Falkenburg <sfalken@apple.com>
295 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
296 * JavaScriptCore.vcproj/dftables/dftables.vcproj:
298 2006-08-31 Anders Carlsson <acarlsson@apple.com>
302 Add new portability functions to MathExtras.h and add StringExtras.h which is for
303 string portability functions.
305 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
306 * bindings/c/c_instance.cpp:
307 * kjs/date_object.cpp:
311 * wtf/StringExtras.h: Added.
315 2006-08-31 Anders Carlsson <acarlsson@apple.com>
321 * JavaScriptCore.vcproj/dftables/dftables.vcproj:
322 * pcre/pcre_internal.h:
324 2006-08-31 Timothy Hatcher <timothy@apple.com>
328 Band-aid fix for PCRE to compile for ppc64 and x86_64 now that
329 we use -Wshorten-64-to-32. Adds an INT_CAST macro that ASSERTs
330 the value <= INT_MAX.
332 I filed <rdar://problem/4712064> to track the need to verify
333 PCRE's 64-bit compliance.
335 * pcre/pcre_compile.c:
344 (pcre_get_substring_list):
345 * pcre/pcre_internal.h:
346 * pcre/pcre_tables.c:
347 * pcre/pcre_try_flipped.c:
350 2006-08-30 Darin Adler <darin@apple.com>
352 Reviewed by Tim Hatcher.
354 - add WTF::getPtr, a function template that makes it possible to write
355 generic code that gets a raw pointer out of any of our pointer types
357 * JavaScriptCore.xcodeproj/project.pbxproj:
358 * wtf/GetPtr.h: Added.
359 * wtf/ListRefPtr.h: (WTF::getPtr): Added.
360 * wtf/OwnArrayPtr.h: (WTF::getPtr): Added.
361 * wtf/OwnPtr.h: (WTF::getPtr): Added.
362 * wtf/PassRefPtr.h: (WTF::getPtr): Added.
363 * wtf/RefPtr.h: (WTF::getPtr): Added.
365 2006-08-29 waylonis <waylonis@google.com>
367 Reviewed, tweaked by ggaren.
369 - Added storage and accessor functions for ExecState as a fix for
370 http://bugzilla.opendarwin.org/show_bug.cgi?id=10114
373 (KJS::ExecState::ExecState):
376 (KJS::Context::setExecState):
377 (KJS::Context::execState):
379 2006-08-30 Nikolas Zimmermann <zimmermann@kde.org>
383 Commit KDE related tweaks, to be able to
384 differentiate between a Qt-only or a KDE build.
386 * CMakeLists.txt: Install wtf-unity library.
387 * wtf/Platform.h: Add define for the KDE platform.
389 2006-08-28 Darin Adler <darin@apple.com>
393 * kjs/list.h: Use explicit in constructor (as appropriate).
395 2006-08-24 Nikolas Zimmermann <zimmermann@kde.org>
397 Reviewed, tweaked and landed by ap
399 http://bugzilla.opendarwin.org/show_bug.cgi?id=10467
400 WebKit should have Qt platform support (Part II)
402 * CMakeLists.txt: Adjust to Anders' build fixes.
403 * wtf/Platform.h: Fix define for the Qt platform (we don't use/need Cairo.)
405 2006-08-23 David Hyatt <hyatt@apple.com>
407 Fix Platform.h to include #defines for graphics features.
411 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
414 2006-08-23 Anders Carlsson <acarlsson@apple.com>
418 Make the bindings compile without CoreFoundation.
420 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
421 * bindings/c/c_instance.cpp:
422 * bindings/c/c_utility.cpp:
423 (KJS::Bindings::convertUTF8ToUTF16):
425 * bindings/runtime.cpp:
426 (KJS::Bindings::Instance::createBindingForLanguageInstance):
427 (KJS::Bindings::Instance::createLanguageInstanceForValue):
428 * bindings/runtime_root.cpp:
429 * bindings/runtime_root.h:
430 * kjs/interpreter.cpp:
431 (KJS::Interpreter::createLanguageInstanceForValue):
434 2006-08-22 Anders Carlsson <acarlsson@apple.com>
438 Move the npruntime code over to using HashMap and the runtime_root code over to using
439 HashMap and HashCountedSet.
441 * bindings/NP_jsobject.cpp:
442 * bindings/c/c_utility.cpp:
443 (KJS::Bindings::identifierFromNPIdentifier):
444 * bindings/c/c_utility.h:
445 * bindings/jni/jni_jsobject.cpp:
446 (JavaJSObject::invoke):
447 * bindings/npruntime.cpp:
448 (getStringIdentifierMap):
449 (getIntIdentifierMap):
450 (_NPN_GetStringIdentifier):
451 (_NPN_GetIntIdentifier):
452 * bindings/runtime_root.cpp:
453 (getReferencesByRootMap):
455 (KJS::Bindings::findReferenceSet):
456 (KJS::Bindings::rootForImp):
457 (KJS::Bindings::rootForInterpreter):
458 (KJS::Bindings::addNativeReference):
459 (KJS::Bindings::removeNativeReference):
460 (RootObject::removeAllNativeReferences):
461 * bindings/runtime_root.h:
463 2006-08-22 Anders Carlsson <acarlsson@apple.com>
467 Switch over the NPAPI and Java bindings to using HashMaps instead of dictionaries.
469 * JavaScriptCore.xcodeproj/project.pbxproj:
470 * bindings/c/c_class.cpp:
471 (KJS::Bindings::CClass::CClass):
472 (KJS::Bindings::CClass::~CClass):
473 (KJS::Bindings::CClass::classForIsA):
474 (KJS::Bindings::CClass::methodsNamed):
475 (KJS::Bindings::CClass::fieldNamed):
476 * bindings/c/c_class.h:
477 * bindings/jni/jni_class.cpp:
478 (JavaClass::JavaClass):
479 (JavaClass::~JavaClass):
480 (JavaClass::methodsNamed):
481 (JavaClass::fieldNamed):
482 * bindings/jni/jni_class.h:
483 * bindings/objc/objc_class.h:
484 * bindings/objc/objc_class.mm:
485 (KJS::Bindings::deleteMethod):
486 (KJS::Bindings::deleteField):
488 (KJS::Bindings::ObjcClass::methodsNamed):
489 (KJS::Bindings::ObjcClass::fieldNamed):
490 * bindings/runtime.cpp:
491 * bindings/runtime.h:
492 * bindings/runtime_object.cpp:
493 (RuntimeObjectImp::fieldGetter):
494 (RuntimeObjectImp::getOwnPropertySlot):
495 (RuntimeObjectImp::put):
496 (RuntimeObjectImp::canPut):
498 2006-08-21 Vladimir Olexa <vladimir.olexa@gmail.com>
502 http://bugzilla.opendarwin.org/show_bug.cgi?id=6252
503 JavaScript 1.6 Array.lastIndexOf
505 Test: fast/js/array-lastIndexOf.html
507 * kjs/array_object.cpp:
508 (ArrayProtoFunc::callAsFunction): Added a LastIndexOf case.
509 * kjs/array_object.h:
510 (KJS::ArrayProtoFunc::): Added LastIndexOf to enum.
511 * tests/mozilla/expected.html: Two more tests now pass.
513 2006-08-20 Nikolas Zimmermann <zimmermann@kde.org>
515 Reviewed by Maciej. Landed by rwlbuis.
517 Fixes parts of: http://bugzilla.opendarwin.org/show_bug.cgi?id=10463
518 WebKit should have Qt platform support
520 Removing obsolete QConstString/QString constructors in kjs code.
525 2006-08-17 Nikolas Zimmermann <zimmermann@kde.org>
527 Reviewed by Maciej. Landed by rwlbuis.
529 Fixes: http://bugzilla.opendarwin.org/show_bug.cgi?id=10463
530 WTF Changes needed for Qt platform code.
533 * wtf/unicode/UnicodeDecomposition.h: Added.
535 * wtf/unicode/UnicodeDirection.h: Added.
537 * wtf/unicode/qt4/UnicodeQt4.cpp: Added.
538 (WTF::Unicode::direction):
539 (WTF::Unicode::category):
540 (WTF::Unicode::decomposition):
541 * wtf/unicode/qt4/UnicodeQt4.h:
542 (WTF::Unicode::toLower):
543 (WTF::Unicode::toUpper):
544 (WTF::Unicode::isPrintableChar):
545 (WTF::Unicode::isSpace):
546 (WTF::Unicode::isPunct):
547 (WTF::Unicode::isDigit):
548 (WTF::Unicode::mirroredChar):
549 (WTF::Unicode::compare):
551 2006-08-17 Nikolas Zimmermann <zimmermann@kde.org>
553 Reviewed by Eric. Landed by rwlbuis.
555 Fixes: http://bugzilla.opendarwin.org/show_bug.cgi?id=10464
556 Offer a cmake build system for Qt platform.
558 * CMakeLists.txt: Added.
559 * pcre/CMakeLists.txt: Added.
561 2006-08-17 Anders Carlsson <acarlsson@apple.com>
568 2006-08-15 Steve Falkenburg <sfalken@apple.com>
574 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
577 2006-08-15 Mark Rowe <opendarwin.org@bdash.net.nz>
581 Build fix: DWARF and -gfull are incompatible with symbol separation.
583 * JavaScriptCore.xcodeproj/project.pbxproj:
585 2006-08-15 Mark Rowe <opendarwin.org@bdash.net.nz>
589 http://bugzilla.opendarwin.org/show_bug.cgi?id=10394
590 Bug 10394: WebKit Release and Production configurations should enable dead code stripping
592 * JavaScriptCore.xcodeproj/project.pbxproj:
594 2006-08-15 Mark Rowe <opendarwin.org@bdash.net.nz>
598 http://bugzilla.opendarwin.org/show_bug.cgi?id=10384
599 Bug 10384: Switch to DWARF for Release configuration
601 * JavaScriptCore.xcodeproj/project.pbxproj:
603 2006-08-13 Maks Orlovich <maksim@kde.org>
605 Reviewed (and tweaked a little) by Maciej.
607 - shrank the size of JSObject by 8 bytes and made the corresponding reduction to the cell size, resulting
608 in a 1.2% speed improvement on JS iBench (and probably overall memory savings).
610 This was done by removing _scope and _internalValue data members
611 from JSObject and moving them only to the subclasses that actually
615 (KJS::JSObject::mark): No need to mark scope or internal value here.
617 (KJS::JSObject::JSObject): Don't initialize them.
618 * kjs/JSWrapperObject.cpp: Added. New base class for object types that
619 wrap primitive values (Number, String, Boolean, Date).
620 (KJS::JSWrapperObject::mark):
621 * kjs/JSWrapperObject.h: Added.
622 (KJS::JSWrapperObject::JSWrapperObject):
623 (KJS::JSWrapperObject::internalValue):
624 (KJS::JSWrapperObject::setInternalValue):
625 * kjs/array_object.cpp:
626 (ArrayPrototype::ArrayPrototype): Don't set useless internal value.
627 * kjs/bool_object.cpp:
628 (BooleanInstance::BooleanInstance): Inherit from JSWrapperObject.
629 (BooleanProtoFunc::callAsFunction): Fixed to account for fact that not all
630 JSObjects have an internal value.
631 (BooleanObjectImp::construct): ditto.
633 * kjs/collector.cpp: Lowered cell size to 48.
634 (KJS::Collector::allocate): meaningless whitespace change
635 * kjs/date_object.cpp:
636 (KJS::DateInstance::DateInstance): Inherit from JSWrapperObject.
637 (KJS::DateProtoFunc::callAsFunction): adjusted for move of internalValue
638 (KJS::DateObjectImp::construct): ditto
640 * kjs/error_object.cpp:
641 (ErrorPrototype::ErrorPrototype): don't set internal value
642 * kjs/function.cpp: move _scope and related handling here
643 (KJS::FunctionImp::mark): mark scope
645 (KJS::FunctionImp::scope): moved here from JSObject
646 (KJS::FunctionImp::setScope): ditto
647 * kjs/number_object.cpp:
648 (NumberInstance::NumberInstance): inherit from JSWrapperObject
649 (NumberProtoFunc::callAsFunction): adjusted
650 (NumberObjectImp::construct): adjusted
651 * kjs/number_object.h: shring RegExp-related objects a little
652 * kjs/regexp_object.cpp:
653 (RegExpPrototype::RegExpPrototype): Adjust for size tweaks
654 (RegExpObjectImp::RegExpObjectImp): ditto
655 * kjs/regexp_object.h:
656 * kjs/string_object.cpp:
657 (StringInstance::StringInstance): inherit from JSWrapperObject
658 (StringProtoFunc::callAsFunction): adjusted
659 * kjs/string_object.h:
660 * JavaScriptCore.exp: Exported new methods as needed.
661 * JavaScriptCore.xcodeproj/project.pbxproj: Added new files to build.
663 2006-08-04 Brady Eidson <beidson@apple.com>
665 Reviewed by Geoff's rubber stamp
667 Fix a build break on Intel hardware causes by adapting stricter
668 compiler warnings (-Wshorten-64-to-32)
671 (assertEqualsAsNumber): manually cast some doubles to floats
674 2006-08-04 Sam Weinig <sam.weinig@gmail.com>
678 - patch for http://bugzilla.opendarwin.org/show_bug.cgi?id=10192
679 Make WebCore (and friends) compile with -Wshorten-64-to-32
681 * Adds -Wshorten-64-to-32 flag to Xcode project.
682 * Adds explicit casts where OK.
686 (JSNodeList_getProperty):
687 * JavaScriptCore.xcodeproj/project.pbxproj:
689 2006-08-04 Adam Roben <aroben@apple.com>
693 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Convert
696 2006-08-03 Sam Weinig <sam.weinig@gmail.com>
700 - patch for http://bugzilla.opendarwin.org/show_bug.cgi?id=10176
701 Make WebCore compile with -Wundef
703 * Adds -Wundef flag to Xcode project
704 * Converts #ifs to #ifdef and #ifndefs where needed.
705 * Added #define YYMAXDEPTH 10000 in kjs/grammar.y
706 to fix a warning from within Bison.
708 * JavaScriptCore.xcodeproj/project.pbxproj:
709 * bindings/jni/jni_jsobject.cpp:
710 (JavaJSObject::getSlot):
711 (JavaJSObject::setSlot):
713 * bindings/objc/objc_class.mm:
714 (KJS::Bindings::ObjcClass::methodsNamed):
715 (KJS::Bindings::ObjcClass::fieldNamed):
716 * bindings/objc/objc_instance.mm:
717 (ObjcInstance::invokeMethod):
718 * bindings/objc/objc_runtime.mm:
719 (ObjcMethod::getMethodSignature):
725 2006-08-03 Anders Carlsson <acarlsson@apple.com>
727 Reviewed by John Sullivan.
731 Return *this in operator=
733 2006-08-03 Adam Roben <aroben@apple.com>
737 - Fixed Windows build
739 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
740 * wtf/MathExtras.h: Implement inline versions of these functions
744 2006-08-02 Adam Roben <aroben@apple.com>
750 * kjs/date_object.cpp:
753 2006-07-29 Darin Adler <darin@apple.com>
755 - Removed tabs from these source files that still had them.
756 We don't use them; that way source files look fine in editors
757 that have tabs set to 8 spaces or to 4 spaces.
758 - Removed allow-tabs Subversion property from the files too.
760 * bindings/NP_jsobject.cpp:
761 * bindings/c/c_utility.cpp:
762 * bindings/jni/jni_runtime.cpp:
763 * bindings/jni/jni_utility.cpp:
764 * bindings/objc/objc_utility.mm:
765 * bindings/runtime.cpp:
766 * bindings/runtime_method.cpp:
767 * bindings/testbindings.cpp:
768 * bindings/testbindings.mm:
769 * kjs/date_object.cpp:
774 * kjs/string_object.cpp:
777 2006-07-29 Darin Adler <darin@apple.com>
779 * tests/mozilla/expected.html: Update test results now that regress-185165.js
780 is succeeding. I suspect Anders fix for bug 4620655 is the reason.
782 2006-07-29 Sam Weinig <sam.weinig@gmail.com>
786 - patch for http://bugzilla.opendarwin.org/show_bug.cgi?id=10080
787 Adopt pedantic changes from the Unity project to improve
788 cross-compiler compatibility
791 * Removing trailing semicolon from namespace braces.
792 * Removing trailing comma from last enum declaration.
793 * Updating to match style guidelines.
794 * Adding missing newline to the end of the file.
795 * Turning on gcc warning for missing newline at the end of a source file
796 (GCC_WARN_ABOUT_MISSING_NEWLINE in Xcode, -Wnewline in gcc).
797 * Alphabetical sorting of Xcode source list files.
798 * Replace use of non-portable variable-size array with Vector.
799 * Use C-style comments instead of C++ comments in files that might
800 be included by either C or C++ files.
802 * API/JSCallbackConstructor.cpp:
803 (KJS::JSCallbackConstructor::construct):
804 * API/JSCallbackFunction.cpp:
805 (KJS::JSCallbackFunction::callAsFunction):
806 * API/JSCallbackObject.cpp:
807 (KJS::JSCallbackObject::construct):
808 (KJS::JSCallbackObject::callAsFunction):
809 * JavaScriptCore.xcodeproj/project.pbxproj:
810 * JavaScriptCorePrefix.h:
811 * bindings/jni/jni_class.cpp:
812 (JavaClass::fieldNamed):
813 * bindings/jni/jni_class.h:
814 * bindings/jni/jni_instance.cpp:
815 (JavaInstance::JavaInstance):
816 (JavaInstance::valueOf):
817 * bindings/jni/jni_objc.mm:
818 (KJS::Bindings::dispatchJNICall):
819 * bindings/jni/jni_runtime.cpp:
820 (JavaParameter::JavaParameter):
821 (JavaArray::JavaArray):
822 * bindings/jni/jni_runtime.h:
823 * bindings/jni/jni_utility.h:
824 * bindings/objc/objc_instance.h:
825 * bindings/runtime_array.h:
831 2006-07-29 Mike Emmel <mike.emmel@gmail.com>
835 - fixes for Linux build
837 * JavaScriptCoreSources.bkl: Added new files to build, kjs/PropertyNameArray.cpp
838 and kjs/testkjs.cpp, and removed old files.
840 2006-07-24 Dan Waylonis <waylonis@google.com>
842 Reviewed and tweaked a bit by Darin.
844 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9902
845 jsNull and NSNull not properly converted between JS and ObjC
847 * bindings/objc/objc_utility.mm: (KJS::Bindings::convertObjcValueToValue):
848 Added case for converting NSNull to jsNull.
850 2006-07-24 Rob Buis <buis@kde.org>
854 http://bugzilla.opendarwin.org/show_bug.cgi?id=4258
855 Date().toString() only includes GMT offset, not timezone string
857 Use the info in tm_zone to append timezone abbreviation
858 to Date().toString().
860 * kjs/date_object.cpp:
863 2006-07-24 Rob Buis <buis@kde.org>
867 http://bugzilla.opendarwin.org/show_bug.cgi?id=5257
868 setYear() does not match FireFox/IE behavior
870 Make sure the right values end up in tm_year.
872 * kjs/date_object.cpp:
875 2006-07-23 Mark Rowe <opendarwin.org@bdash.net.nz>
879 Bug 9686: [Drosera] Need the ability to break into Drosera on Javascript exceptions
880 http://bugzilla.opendarwin.org/show_bug.cgi?id=9686
882 JavaScriptCore portion of the fix.
884 * JavaScriptCore.exp: Update symbol for change in argument type.
886 (Debugger::detach): Clear map of recent exceptions.
887 (Debugger::hasHandledException): Track the most recent exception
888 thrown by an interpreter.
889 (Debugger::exception): Change exception argument to a JSValue.
892 (Node::debugExceptionIfNeeded): Notify the debugger of an exception
893 if it hasn't seen it before.
894 (ThrowNode::execute): Notify the debugger that an exception is being thrown.
897 2006-07-23 Geoffrey Garen <ggaren@apple.com>
899 Patch by Eric Albert, reviewed by Darin and me.
901 - Fixed <rdar://problem/4645931> JavaScriptCore stack-scanning code
902 crashes (Collector::markStackObjectsConservatively)
904 * bindings/jni/jni_jsobject.cpp: On 64bit systems, jint is a long, not an
906 (JavaJSObject::getSlot):
907 (JavaJSObject::setSlot):
909 (KJS::Collector::markCurrentThreadConservatively): Use a pointer instead of
910 an int as 'dummy,' because on LP64 systems, an int is not pointer-aligned,
911 and we want to scan the stack for pointers.
912 * JavaScriptCore.xcodeproj/project.pbxproj: After a tense cease-fire, the
913 XCode war has started up again!
915 === Safari-521.20 ===
917 2006-07-21 Geoffrey Garen <ggaren@apple.com>
921 <rdar://problem/4507265> REGRESSION: overlays don't work on HousingMaps.com (Google Maps-based site)
923 - Added support for strings that masquerade as undefined. Currently used
924 by WebCore to implement undetectable style.filter.
926 The name is a little long, but it's only used in one line of code, so I
927 thought clarity should win over brevity.
929 * JavaScriptCore.exp:
930 * JavaScriptCore.xcodeproj/project.pbxproj:
932 * kjs/string_object.h:
933 (KJS::StringInstanceThatMasqueradesAsUndefined::StringInstanceThatMasqueradesAsUndefined):
934 (KJS::StringInstanceThatMasqueradesAsUndefined::masqueradeAsUndefined):
935 (KJS::StringInstanceThatMasqueradesAsUndefined::toBoolean):
937 === Safari-521.19 ===
939 2006-07-20 Steve Falkenburg <sfalken@apple.com>
944 (KJS::escapeStringForPrettyPrinting):
946 2006-07-19 Anders Carlsson <acarlsson@apple.com>
950 <rdar://problem/4620655> REGRESSION(10.4.7-10.5): preview button for a blogger.com post doesn't work
952 * kjs/nodes2string.cpp:
953 (StringNode::streamTo):
954 Return the escaped string.
956 (RegExpNode::streamTo):
957 Use the correct syntax.
960 (KJS::escapeStringForPrettyPrinting):
962 Add escape function which escapes a string for pretty-printing so it can be parsed again.
964 * wtf/unicode/icu/UnicodeIcu.h:
965 (WTF::Unicode::isPrintableChar):
968 2006-07-18 Maciej Stachowiak <mjs@apple.com>
970 Reviewed by Adele Peterson.
972 <rdar://problem/4589530> REGRESSION: null character in JS string causes parse error (works in Tiger and in other browsers)
981 2006-07-18 Tim Omernick <timo@apple.com>
983 Reviewed by Tim Hatcher.
985 Removed a misleading comment; we recently added support for the NPNVPluginElementNPObject
990 === Safari-521.18 ===
992 2006-07-18 Timothy Hatcher <timothy@apple.com>
994 Made the following headers public:
1003 * JavaScriptCore.xcodeproj/project.pbxproj:
1005 2006-07-17 Geoffrey Garen <ggaren@apple.com>
1009 - Added automatic prototype creation for classes.
1011 A class stores a weak reference to a prototype, which is cleared when
1012 the prototype is garbage collected, to avoid a reference cycle.
1014 We now have an attributes field in JSClassDefinition, that currently is
1015 used only to override automatic prototype creation when you want to manage your
1016 own prototypes, but can be extended in the future for other nefarious purposes.
1018 Similarly, we have JSObjectMake and JSObjectMakeWithPrototype, the latter
1019 allowing you to manage your own prototypes.
1021 JSObjectMakeConstructor is more interesting now, able to make a constructor
1022 on your behalf if you just give it a class.
1024 - Removed bogus old code from minidom.js.
1026 - Tweaked the headerdocs.
1028 - Added more GC testing, which caught some leaks, and tested more funny
1029 edge cases in lookup, which caught a lookup bug. Removed some testing
1030 we used to do with MyObject because it was redundant with the new, cool
1033 While fixing the lookup bug I retracted this change:
1035 "If a static setProperty callback returns 'false', to indicate that the
1036 property was not set, we no longer forward the set request up the class
1037 chain, because that's almost certainly not what the programmer expected."
1039 Returning false when setting a static property is a little silly, but you can see
1040 it being useful when shadowing a base class's static properties, and, regardless
1041 of usefullness, this is the defined behavior of the setProperty callback.
1043 - Plus a little ASCII art, for the kids.
1045 2006-07-17 Timothy Hatcher <timothy@apple.com>
1049 <rdar://problem/4634874> WebScriptObject and WebUndefined are no longer defined by WebKit
1051 Moves WebScriptObject and WebUndefined up to WebCore.
1052 This change does create an upwards-dependancy on WebScriptObject existing
1053 in the loaded process, but this code path in JavaScriptCore does not get used
1054 unless it is through WebKit/WebCore. Moving all of the binding code out of
1055 JavaScriptCore might make sense in the future.
1057 * JavaScriptCore.exp:
1058 * JavaScriptCore.xcodeproj/project.pbxproj:
1059 * bindings/objc/WebScriptObject.h: Replaced.
1060 * bindings/objc/WebScriptObject.mm: Removed.
1061 * bindings/objc/WebScriptObjectPrivate.h: Removed.
1062 * bindings/objc/objc_class.h:
1063 * bindings/objc/objc_instance.h:
1064 * bindings/objc/objc_instance.mm:
1065 (ObjcInstance::~ObjcInstance):
1066 * bindings/objc/objc_runtime.h:
1067 * bindings/objc/objc_runtime.mm:
1068 (convertValueToObjcObject):
1069 * bindings/objc/objc_utility.mm:
1070 (KJS::Bindings::convertValueToObjcValue):
1071 (KJS::Bindings::convertObjcValueToValue):
1072 (KJS::Bindings::createObjcInstanceForValue):
1074 2006-07-17 Darin Adler <darin@apple.com>
1076 * API/JSBase.h: Fix comment formatting where things used to be lined up but
1077 are now ragged. Got rid of spaces that attempted to line things up.
1078 * API/JSObjectRef.h: Ditto. Also add missing periods for a couple of comments.
1080 2006-07-17 Geoffrey Garen <ggaren@apple.com>
1084 - Removed the exception parameter from the initialize callback and, by extension,
1085 JSObjectMake. We have never had a need for exceptions when iniitializing,
1086 so the parameter seemed likely to "get in the way."
1088 Also, an exception in JavaScript is thrown in response to input --
1089 "invalid URL", "index not a number", etc., so it's the job of the
1090 constructor function, not the initialize method, to throw.
1092 If initialize *really* wants to throw, it can communicate the throw to
1093 the constructor through the constructed object's private data (e.g., set
1094 it to NULL, signaling to the consntructor that initialization failed.)
1096 - Added JSObjectMakeWithData, which enables a constructor to set private
1097 data on an object *before* it has been initialized. That way, the initialize
1098 methods can properly operate on the data.
1100 * API/JSNode.c: Moved ref into the initialize method, for better encapsulation,
1101 now that it's possible.
1102 * API/JSNodeList.c: ditto
1104 (main): Do more aggressive garbage collection to test ref/deref and
1105 initialize/finalize.
1106 * API/minidom.js: store childNodes in a temporary so it doesn't get re-created
1107 like a thousand times. This makes debugging ref/deref easier
1109 2006-07-17 Geoffrey Garen <ggaren@apple.com>
1113 - Changed the initialize callback to run from least derived class (parent
1114 class) to most derived class. This enables C++ style initialization,
1115 and derived class overriding of member data.
1117 - Added excpetion propopgation to JSObjectMake, to support initialize
1118 exceptions, and generally round out our policy of making function
1119 signatures as long as possible.
1121 * API/JSCallbackObject.h: Use ExecState instead of ContextRef, cuz we're
1124 2006-07-17 Geoffrey Garen <ggaren@apple.com>
1128 - Changed JSObjectMakeConstructor to JSObjectMakeConstructorWithCallback,
1129 to match JSObjectMakeFunctionWithCallback.
1131 - Added prototype parameter, so the generated constructor
1132 automatically works with hasInstance / instanceof
1134 - Moved hasInstance implementation from InternalFunctionImp to JSObject
1135 so that subclasses can inherit it without inheriting function-related baggage.
1136 More refactoring here would be good, but this seems like a good short-term
1139 (KJS::JSCallbackFunction::implementsHasInstance): override and return false,
1140 because callback functions aren't constructors.
1142 2006-07-17 Maciej Stachowiak <mjs@apple.com>
1146 - add a JSContextRef parameter to all JSValueRef, JSObjectRef, and JSContextRef operations;
1147 except JSObject{Get,Set}PrivateData which can be assumed to be simple pure accessors.
1149 Also renamed the parameter "context" to "ctx" because it makes the code read better with this pervasive
1150 but usually uninteresting parameter.
1154 (JSCheckScriptSyntax):
1157 * API/JSCallbackObject.cpp:
1158 (KJS::JSCallbackObject::JSCallbackObject):
1159 (KJS::JSCallbackObject::init):
1160 (KJS::JSCallbackObject::getOwnPropertySlot):
1161 (KJS::JSCallbackObject::put):
1162 (KJS::JSCallbackObject::deleteProperty):
1163 (KJS::JSCallbackObject::toNumber):
1164 (KJS::JSCallbackObject::toString):
1165 * API/JSContextRef.cpp:
1166 (JSGlobalContextCreate):
1167 (JSGlobalContextRetain):
1168 (JSGlobalContextRelease):
1169 (JSContextGetGlobalObject):
1170 * API/JSContextRef.h:
1172 (JSNodePrototype_appendChild):
1173 (JSNodePrototype_removeChild):
1174 (JSNodePrototype_replaceChild):
1175 (JSNode_getNodeType):
1176 (JSNode_getFirstChild):
1179 (JSNodeListPrototype_item):
1180 (JSNodeList_length):
1181 (JSNodeList_getProperty):
1182 (JSNodeList_prototype):
1183 * API/JSObjectRef.cpp:
1185 (JSObjectMakeFunctionWithCallback):
1186 (JSObjectMakeConstructor):
1187 (JSObjectMakeFunction):
1188 (JSObjectGetPrototype):
1189 (JSObjectSetPrototype):
1190 (JSObjectHasProperty):
1191 (JSObjectGetProperty):
1192 (JSObjectSetProperty):
1193 (JSObjectGetPropertyAtIndex):
1194 (JSObjectSetPropertyAtIndex):
1195 (JSObjectDeleteProperty):
1196 (JSObjectIsFunction):
1197 (JSObjectCallAsFunction):
1198 (JSObjectIsConstructor):
1199 (JSObjectCallAsConstructor):
1200 (JSObjectCopyPropertyNames):
1201 * API/JSObjectRef.h:
1202 * API/JSStringRef.cpp:
1203 * API/JSValueRef.cpp:
1205 (JSValueIsUndefined):
1211 (JSValueIsObjectOfClass):
1213 (JSValueIsStrictEqual):
1214 (JSValueIsInstanceOfConstructor):
1215 (JSValueMakeUndefined):
1217 (JSValueMakeBoolean):
1218 (JSValueMakeNumber):
1219 (JSValueMakeString):
1222 (JSValueToStringCopy):
1230 (MyObject_getProperty):
1231 (MyObject_deleteProperty):
1232 (MyObject_callAsFunction):
1233 (MyObject_callAsConstructor):
1234 (MyObject_convertToType):
1235 (print_callAsFunction):
1238 2006-07-16 Geoffrey Garen <ggaren@apple.com>
1240 Approved by Maciej, RS by Beth.
1242 JSObjectMakeFunction -> JSObjectMakeFunctionWithCallback
1243 JSObjectMakeFunctionWithBody -> JSObjectMakeFunction
1245 because the latter is more common, and more fundamental, than the former.
1250 * API/JSCallbackObject.cpp:
1251 (KJS::JSCallbackObject::getOwnPropertySlot):
1252 (KJS::JSCallbackObject::put):
1253 (KJS::JSCallbackObject::deleteProperty):
1254 (KJS::JSCallbackObject::getPropertyNames):
1255 (KJS::JSCallbackObject::staticValueGetter):
1256 (KJS::JSCallbackObject::staticFunctionGetter):
1257 * API/JSClassRef.cpp:
1258 (OpaqueJSClass::OpaqueJSClass):
1259 (OpaqueJSClass::~OpaqueJSClass):
1261 * API/JSObjectRef.cpp:
1263 (JSObjectMakeFunctionWithCallback):
1264 (JSObjectMakeFunction):
1265 (OpaqueJSPropertyNameArray::OpaqueJSPropertyNameArray):
1266 (JSObjectCopyPropertyNames):
1267 * API/JSObjectRef.h:
1273 * JavaScriptCore.exp:
1275 2006-07-16 Geoffrey Garen <ggaren@apple.com>
1279 Replace __JS with OpaqueJS because the former, while used by CF, is
1280 a prefix that's triply-reserved by the compiler. (_* is reserved in global
1281 names, _[A-Z] is reserved in all names, and __ is reserved in all names
1284 Opaque is an alternative used by other Mac OS X framewokrs.
1289 * API/JSCallbackObject.cpp:
1290 (KJS::JSCallbackObject::getOwnPropertySlot):
1291 (KJS::JSCallbackObject::put):
1292 (KJS::JSCallbackObject::deleteProperty):
1293 (KJS::JSCallbackObject::getPropertyNames):
1294 (KJS::JSCallbackObject::staticValueGetter):
1295 (KJS::JSCallbackObject::staticFunctionGetter):
1296 * API/JSClassRef.cpp:
1297 (OpaqueJSClass::OpaqueJSClass):
1298 (OpaqueJSClass::~OpaqueJSClass):
1300 * API/JSObjectRef.cpp:
1302 (OpaqueJSPropertyNameArray::OpaqueJSPropertyNameArray):
1303 (JSObjectCopyPropertyNames):
1305 2006-07-16 Darin Adler <darin@apple.com>
1307 - try to fix Windows build
1309 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1310 Added some recently added files, removed some recently removed.
1312 2006-07-16 Geoffrey Garen <ggaren@apple.com>
1316 - Change getProperty* to return undefined, rather than NULL, for missing
1317 properties, since that's what the spec says. Also added exception out
1318 parameters to the *Index functions, because they can call through to the
1319 regular functions, which can throw for custom objects.
1321 * API/JSObjectRef.cpp:
1322 (JSObjectGetProperty):
1323 (JSObjectGetPropertyAtIndex):
1324 (JSObjectSetPropertyAtIndex):
1325 * API/JSObjectRef.h:
1329 2006-07-16 Geoffrey Garen <ggaren@apple.com>
1333 - Properly document and handle NULL callbacks for static properties. We
1334 throw an exception in any case other than a ReadOnly property with a NULL
1335 setProperty callback, because a NULL callback almost certainly indicates
1336 a programming error. Also throw an exception if hasProperty returns true
1337 for a property that getProperty can't get.
1339 - If a static setProperty callback returns 'false', to indicate that the
1340 property was not set, we no longer forward the set request up the class
1341 chain, because that's almost certainly not what the programmer expected.
1343 * API/JSCallbackObject.cpp:
1344 (KJS::JSCallbackObject::getOwnPropertySlot):
1345 (KJS::JSCallbackObject::put):
1346 (KJS::JSCallbackObject::staticValueGetter):
1347 (KJS::JSCallbackObject::staticFunctionGetter):
1348 (KJS::JSCallbackObject::callbackGetter):
1349 * API/JSObjectRef.h:
1352 (MyObject_hasProperty):
1355 2006-07-16 Geoffrey Garen <ggaren@apple.com>
1359 - Added names to functions.
1361 - Removed GetPrivate/SetPrivate from callbackFunctions and callbackConstructors.
1362 The private data idiom is that a JS object stores its native implementation
1363 as private data. For functions and constructors, the native implementation is nothing
1364 more than the callback they already store, so supporting private data, too,
1365 confuses the idiom. If you *really* want, you can still create a custom
1366 function with private data.
1368 * API/JSCallbackConstructor.cpp:
1369 * API/JSCallbackConstructor.h:
1370 * API/JSCallbackFunction.cpp:
1371 (KJS::JSCallbackFunction::JSCallbackFunction):
1372 * API/JSCallbackFunction.h:
1373 * API/JSCallbackObject.cpp:
1374 (KJS::JSCallbackObject::staticFunctionGetter):
1375 * API/JSObjectRef.cpp:
1376 (JSObjectMakeFunction):
1377 (JSObjectMakeFunctionWithBody):
1378 (JSObjectGetPrivate):
1379 (JSObjectSetPrivate):
1380 * API/JSObjectRef.h:
1386 2006-07-15 Maciej Stachowiak <mjs@apple.com>
1390 - switch property lists to be vector+set of Identifiers instead of list of References
1392 This has the following benefits:
1394 - no duplicates in property lists
1395 - simplifies API calls
1396 - probably more efficient, since linked list is gone
1397 - entirely removed Reference, ReferenceList and ProtectedReference types from the API
1399 * kjs/PropertyNameArray.cpp: Added.
1400 (KJS::PropertyNameArray::add): Check set, if not already there, add to
1402 * kjs/PropertyNameArray.h: Added.
1403 (KJS::PropertyNameArray::PropertyNameArray): Newly added type, combines
1404 a set and a vector to make a unique but ordered list of identifiers.
1405 (KJS::PropertyNameArray::begin): ditto
1406 (KJS::PropertyNameArray::end): ditto
1407 (KJS::PropertyNameArray::size): ditto
1408 (KJS::PropertyNameArray::operator[]): ditto
1409 * kjs/array_instance.h:
1410 * kjs/array_object.cpp:
1411 (ArrayInstance::getPropertyNames): renamed from getPropertyList, updated
1412 for PropertyNameArray
1413 (ArrayInstance::setLength): updated for PropertyNameArray
1414 (ArrayInstance::pushUndefinedObjectsToEnd): ditto
1416 (ForInNode::execute): updated for PropertyNameArray
1419 (KJS::JSObject::getPropertyNames): renamed from getPropertyList, updated
1420 for PropertyNameArray
1422 * kjs/property_map.cpp:
1423 (KJS::PropertyMap::getEnumerablePropertyNames): updated for PropertyNameArray
1424 (KJS::PropertyMap::getSparseArrayPropertyNames): ditto
1425 * kjs/property_map.h:
1426 * kjs/protected_reference.h: Removed.
1427 * kjs/reference.cpp: Removed.
1428 * kjs/reference.h: Removed.
1429 * kjs/reference_list.cpp: Removed.
1430 * kjs/reference_list.h: Removed.
1431 * kjs/scope_chain.cpp:
1432 (KJS::ScopeChain::print): Use PropertyNamesArray instead of ReferenceList.
1433 * kjs/string_object.cpp:
1434 (StringInstance::getPropertyNames): Updated for new approach.
1435 * kjs/string_object.h:
1438 (toJS): Added overload for PropertyNameAccumulatorRef / PropertyNameArray*
1441 * API/JSCallbackObject.cpp:
1442 (KJS::JSCallbackObject::getPropertyNames): Fixed for new API.
1443 * API/JSCallbackObject.h:
1444 * API/JSObjectRef.cpp:
1445 (__JSPropertyNameArray::__JSPropertyNameArray): Type used for a publicly vended
1446 JSPropertyNameArrayRef.
1447 (JSObjectCopyPropertyNames): New API call - renamed / refactored from
1448 JSObjectCreatePropertyList
1449 (JSPropertyNameArrayRetain): new retain call for JSPropertyNameArray.
1450 (JSPropertyNameArrayRelease): new release call for - " -.
1451 (JSPropertyNameArrayGetCount): Instead of having to use a stateful enumerator you
1452 can now get the count and items in any order.
1453 (JSPropertyNameArrayGetNameAtIndex): See above.
1454 (JSPropertyNameAccumulatorAddName): What you add properties to is now an opaque
1456 * API/JSObjectRef.h: Prototyped new functions, removed old ones
1457 * JavaScriptCore.exp: Updated exported symbols.
1458 * JavaScriptCore.xcodeproj/project.pbxproj: Added new files, removed old.
1460 (MyObject_getPropertyNames): Renamed / fixed callback to fit new paradigm.
1461 (main): Updated for new API.
1463 2006-07-15 Darin Adler <darin@apple.com>
1465 - oops, missed a few more arrays that had to be const
1468 (JSNodePrototype_appendChild): Added const.
1469 (JSNodePrototype_removeChild): Ditto.
1470 (JSNodePrototype_replaceChild): Ditto.
1471 (JSNode_construct): Ditto.
1473 (JSNodeListPrototype_item): Ditto.
1474 * API/JSObjectRef.cpp:
1475 (JSObjectMakeFunctionWithBody): Ditto.
1476 (JSObjectCallAsFunction): Ditto.
1477 (JSObjectCallAsConstructor): Ditto.
1481 (MyObject_callAsFunction): Ditto.
1482 (MyObject_callAsConstructor): Ditto.
1483 (print_callAsFunction): Ditto.
1484 (myConstructor_callAsConstructor): Ditto.
1486 2006-07-15 Darin Adler <darin@apple.com>
1490 * API/JSNode.h: Made an array parameter const.
1491 * API/JSObjectRef.h: Made array parameters const. Fixed a comment.
1493 2006-07-15 Geoffrey Garen <ggaren@apple.com>
1497 - JSObjectMakeFunctionWithBody includes a function name and named parameters now.
1499 * API/JSObjectRef.cpp:
1500 (JSObjectMakeFunctionWithBody):
1501 * API/JSObjectRef.h:
1503 (assertEqualsAsUTF8String): More informative failure reporting.
1504 (main): Test more function cases.
1506 2006-07-15 Geoffrey Garen <ggaren@apple.com>
1510 - Moved the arguments passed to JSClassCreate into a single structure,
1511 called JSClassDefinition. This will enable easier structure
1512 migration/versioning in the future, if necessary.
1514 - Added support for class names.
1516 - kJSClassDefinitionNull replaces kJSObjectCallbacksNone.
1518 - JSClass is becoming a fairly complex struct, so I migrated all of its
1519 implementation other than reference counting to the sruct.
1521 - Also moved JSClass* functions in the API to JSObjectRef.cpp, since they're
1522 declared in JSObjectRef.h
1524 - Also added some more informative explanation to the class structure doc.
1526 2006-07-15 Darin Adler <darin@apple.com>
1530 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8395
1531 <rdar://problem/4613467>
1532 REGRESSION: RegEx seems broken for hex escaped non breaking space
1534 Test: fast/js/regexp-extended-characters-more.html
1537 (match): Got rid of utf16Length local variable to guarantee there's no
1538 extra stack usage in recursive calls. Fixed two places in the PCRE_UTF16
1539 code that were using the length variable, which is the UTF-8 length of
1540 a character in the pattern, to move in the UTF-16 subject string. Instead
1541 they hardcode lengths of 1 and 2 since the code already handles BMP
1542 characters and surrogate pairs separately. Also fixed some DPRINTF so
1543 I could compile with DEBUG on.
1544 (pcre_exec): Changed a place that was checking for multibyte characters
1545 in the subject string to use ISMIDCHAR. Instead it was using hardcoded
1546 logic that was right for UTF-8 but wrong for UTF-16.
1548 * pcre/pcre_compile.c: (pcre_compile2): Fixed a DPRINTF so I could compile
1551 2006-07-14 Geoffrey Garen <ggaren@apple.com>
1555 Global replace in the API of argc/argv with argumentCount/arguments.
1557 2006-07-14 Geoffrey Garen <ggaren@apple.com>
1561 - Finalized exception handling in the API.
1563 setProperty can throw because it throws for built-in arrays. getProperty
1564 and deleteProperty can throw because setProperty can throw and we want
1565 to be consistent, and also because they seem like "actions." callAsFunction,
1566 callAsConstructor, and hasInstance can throw, because they caan throw for
1569 toBoolean can't throw because it's defined that way in the spec.
1571 - Documented that toBoolean and toObject can't be overridden by custom
1572 objects because they're defined that way in the spec.
1574 === Safari-521.17 ===
1576 2006-07-14 Geoffrey Garen <ggaren@apple.com>
1580 - Implemented ref-counting of JSContexts by splitting into two datatypes:
1581 JSGlobalContext, which you can create/retain/release, and JSContext, which
1584 Internally, you retain a JSGlobalContext/ExecState by retaining its
1585 interpreter, which, in the case of a global ExecState, owns it.
1587 - Also made ~Interpreter() protected to catch places where Interpreter
1588 is manually deleted. (Can't make it private because some crazy fool
1589 decided it would be a good idea to subclass Interpreter in other frameworks.
1593 (toJS): Added cast for new JSGlobalContext
1594 * API/JSStringRef.h: Changed vague "you must" language to more specific
1595 (but, ultimately, equally vague) "behavior is undefined if you don't"
1597 (KJS::Interpreter::Interpreter): Factored more common initialization into
1599 * kjs/interpreter.h:
1600 (KJS::Interpreter::ref): new
1601 (KJS::Interpreter::deref): new
1602 (KJS::Interpreter::refCount): new
1604 (doIt): Ref-count the interpreter.
1606 2006-07-14 Maciej Stachowiak <mjs@apple.com>
1610 - removed bool return value from JSObjectSetProperty, since it is inefficient and
1611 also doesn't work quite right
1612 - added JSObjectGetPropertyAtIndex and JSObjectSetPropertyAtIndex
1614 * API/JSObjectRef.cpp:
1615 (JSObjectSetProperty): Removed return value and canPut stuff.
1616 (JSObjectGetPropertyAtIndex): Added.
1617 (JSObjectSetPropertyAtIndex): Added.
1618 * API/JSObjectRef.h: Prototyped and documented new functions.
1620 2006-07-14 Geoffrey Garen <ggaren@apple.com>
1624 Moved JSCheckScriptSyntax, JSEvaluateScript, and JSGarbageCollect into
1625 JSBase.h/.cpp. They don't belong in the value-specific or context-specific
1626 files because they're not part of the value or context implementations.
1629 * API/JSContextRef.cpp:
1630 (JSContextGetGlobalObject):
1631 * API/JSContextRef.h:
1632 * API/JSValueRef.cpp:
1635 * JavaScriptCore.xcodeproj/project.pbxproj:
1637 2006-07-13 Timothy Hatcher <timothy@apple.com>
1641 Moved JavaScriptCore to be a public framework.
1643 * JavaScriptCore.xcodeproj/project.pbxproj:
1645 2006-07-13 Mark Rowe <opendarwin.org@bdash.net.nz>
1647 Reviewed by Geoffrey.
1649 http://bugzilla.opendarwin.org/show_bug.cgi?id=9742
1650 Bug 9742: REGRESSION: WebKit hangs when loading <http://www.vtbook.com>
1653 (KJS::JSValue::getUInt32): Only types tagged as numeric can be converted to UInt32.
1655 2006-07-13 Geoffrey Garen <ggaren@apple.com>
1659 - Renamed JSEvaluate -> JSEvaluateScript, JSCheckSyntax -> JSCheckScriptSyntax
1660 - Added exception out parameters to JSValueTo* and JSValueIsEqual because
1662 - Removed JSObjectGetDescription because it's useless and vague, and
1663 JSValueToString/JSValueIsObjectOfClass do a better job, anyway
1664 - Clarified comments about "IsFunction/Constructor" to indicate that they
1665 are true of all functions/constructors, not just those created by JSObjectMake*
1667 2006-07-12 Geoffrey Garen <ggaren@apple.com>
1671 Finished previously approved JSInternalString -> JSString conversion
1672 by renaming the files.
1674 * API/JSCallbackObject.cpp:
1675 * API/JSInternalStringRef.cpp: Removed.
1676 * API/JSInternalStringRef.h: Removed.
1677 * API/JSStringRef.cpp: Added.
1678 * API/JSStringRef.h: Added.
1679 * API/JavaScriptCore.h:
1680 * JavaScriptCore.xcodeproj/project.pbxproj:
1682 2006-07-12 Geoffrey Garen <ggaren@apple.com>
1686 - Removed context and exception parameters from JSObjectGetPropertyEnumerator,
1687 removing the spurious use of ExecState inside JavaScriptCore that made
1688 us think this was necessary in the first place.
1690 (StringInstance::getPropertyList): Use getString instead of toString because
1691 we know we're dealing with a string -- we put it there in the first place.
1692 While we're at it, store the string's size instead of retrieving it each time
1693 through the loop, to avoid the unnecessary killing of puppies.
1694 * kjs/string_object.h:
1696 2006-07-12 Maciej Stachowiak <mjs@apple.com>
1700 - add handling of hasInstance callback for API objects
1702 * API/JSCallbackObject.cpp:
1703 (KJS::JSCallbackObject::implementsHasInstance): Check if callback is present.
1704 (KJS::JSCallbackObject::hasInstance): Invoke appropriate callback.
1705 * API/JSCallbackObject.h:
1706 * API/JSClassRef.cpp:
1707 * API/JSObjectRef.h:
1709 (MyObject_hasInstance): Test case; should match what construct would do.
1712 2006-07-11 Geoffrey Garen <ggaren@apple.com>
1716 - Implemented a vast number of renames and comment clarifications
1717 suggested during API review.
1719 JSInternalString -> JSString
1720 JS*Make -> JSValueMake*, JSObjectMake*
1721 JSTypeCode -> JSType
1722 JSValueIsInstanceOf -> JSValueIsInstanceOfConstructor (reads strangely well in client code)
1723 JSGC*Protect -> JSValue*Protect
1724 JS*Callback -> JSObject*Callback
1725 JSGetPropertyListCallback -> JSObjectAddPropertiesToListCallback
1726 JSPropertyEnumeratorGetNext -> JSPropertyEnumeratorGetNextName
1728 JSStringCreateWithUTF8CString, JSStringGetUTF8CString,
1729 JSStringGetMaximumUTF8CStringSize JSStringIsEqualToUTF8CString,
1730 JSStringCreateWithCFString, JSStringCopyCFString, JSStringCreateWithCharacters.
1732 - Changed functions taking a JSValue out arg and returning a bool indicating
1733 whether it was set to simply return a JSValue or NULL.
1735 - Removed JSStringGetCharacters because it's more documentation than code,
1736 and it's just a glorified memcpy built on existing API functionality.
1738 - Moved standard library includes into the headers that actually require them.
1740 - Standardized use of the phrase "Create Rule."
1742 - Removed JSLock from make functions that don't allocate.
1744 - Added exception handling to JSValueToBoolean, since we now allow
1745 callback objects to throw exceptions upon converting to boolean.
1747 - Renamed JSGCCollect to JSGarbageCollect.
1749 2006-07-10 Geoffrey Garen <ggaren@apple.com>
1753 - Changed public header includes to the <JavaScriptCore/ style.
1754 - Changed instances of 'buffer' to 'string' since we decided on
1755 JSInternalString instead of JSStringBuffer.
1757 * API/JSContextRef.h:
1758 * API/JSInternalStringRef.cpp:
1760 (JSInternalStringRetain):
1761 (JSInternalStringRelease):
1762 (JSValueCopyStringValue):
1763 (JSInternalStringGetLength):
1764 (JSInternalStringGetCharactersPtr):
1765 (JSInternalStringGetCharacters):
1766 (JSInternalStringGetMaxLengthUTF8):
1767 (JSInternalStringGetCharactersUTF8):
1768 (CFStringCreateWithJSInternalString):
1769 * API/JSInternalStringRef.h:
1771 (JSNodePrototype_appendChild):
1772 (JSNode_getNodeType):
1773 * API/JSObjectRef.cpp:
1774 (JSObjectCallAsConstructor):
1776 * API/JavaScriptCore.h:
1781 (MyObject_getPropertyList):
1782 (myConstructor_callAsConstructor):
1783 (main): I noticed that we were prematurely releasing some string buffers,
1784 so I moved their release calls to the end of main(). I got rid of 'Buf' in *Buf
1785 (sometimes changing to 'IString', when necessary to differentiate a variable)
1786 to match the buffer->string change.
1788 === Safari-521.16 ===
1790 2006-07-10 Darin Adler <darin@apple.com>
1792 * kjs/value.cpp: (KJS::JSValue::toInt32Inline): Added inline keyword one more place.
1795 2006-07-10 Darin Adler <darin@apple.com>
1797 - fix the release build
1801 (KJS::JSValue::toInt32Inline): Move the code here to an inline.
1802 (KJS::JSValue::toInt32): Call the inline from both overloaded toInt32 functions.
1804 2006-07-10 David Kilzer <ddkilzer@kilzer.net>
1808 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9179
1809 Implement select.options.add() method
1811 * JavaScriptCore.exp: Added overloaded KJS::JSValue::toInt32() method.
1812 * JavaScriptCore.xcodeproj/project.pbxproj: Altered attributes metadata for
1813 kjs/value.h to make it available as a forwarded header.
1815 (KJS::lookupPut): Extracted a lookupPut() method from the existing lookupPut() method.
1816 The new method returns a boolean value if no entry is found in the lookup table.
1818 (KJS::JSValue::toInt32): Overloaded toInt32() method with boolean "Ok" argument.
1819 * kjs/value.h: Ditto.
1821 2006-07-10 Geoffrey Garen <ggaren@apple.com>
1823 No review necessary. Removed bogus file I accidentally checked in before.
1825 * API/JSInternalSringRef.h: Removed.
1827 2006-07-10 Geoffrey Garen <ggaren@apple.com>
1831 Added exception out parameter to API object callbacks, removed semi-bogus
1832 JSContext(.*)Exception functions.
1834 To make these calls syntactically simple, I added an exceptionSlot()
1835 method to the ExecState class, which provides a JSValue** slot in which to
1836 store a JSValue* exception.
1840 * API/JSCallbackConstructor.cpp:
1841 (KJS::JSCallbackConstructor::construct):
1842 * API/JSCallbackFunction.cpp:
1843 (KJS::JSCallbackFunction::callAsFunction):
1844 * API/JSCallbackObject.cpp:
1845 (KJS::JSCallbackObject::init):
1846 (KJS::JSCallbackObject::getOwnPropertySlot):
1847 (KJS::JSCallbackObject::put):
1848 (KJS::JSCallbackObject::deleteProperty):
1849 (KJS::JSCallbackObject::construct):
1850 (KJS::JSCallbackObject::callAsFunction):
1851 (KJS::JSCallbackObject::getPropertyList):
1852 (KJS::JSCallbackObject::toBoolean):
1853 (KJS::JSCallbackObject::toNumber):
1854 (KJS::JSCallbackObject::toString):
1855 (KJS::JSCallbackObject::staticValueGetter):
1856 (KJS::JSCallbackObject::callbackGetter):
1857 * API/JSContextRef.cpp:
1859 * API/JSContextRef.h:
1861 (JSNodePrototype_appendChild):
1862 (JSNodePrototype_removeChild):
1863 (JSNodePrototype_replaceChild):
1864 (JSNode_getNodeType):
1865 (JSNode_getChildNodes):
1866 (JSNode_getFirstChild):
1870 (JSNodeListPrototype_item):
1871 (JSNodeList_length):
1872 (JSNodeList_getProperty):
1873 * API/JSObjectRef.h:
1877 (MyObject_initialize):
1878 (MyObject_hasProperty):
1879 (MyObject_getProperty):
1880 (MyObject_setProperty):
1881 (MyObject_deleteProperty):
1882 (MyObject_getPropertyList):
1883 (MyObject_callAsFunction):
1884 (MyObject_callAsConstructor):
1885 (MyObject_convertToType):
1886 (print_callAsFunction):
1887 (myConstructor_callAsConstructor):
1889 * JavaScriptCore.exp:
1891 (KJS::ExecState::exceptionHandle):
1893 2006-07-10 Geoffrey Garen <ggaren@apple.com>
1897 Improved type safety by implementing opaque JSValue/JSObject typing through
1898 abuse of 'const', not void*. Also fixed an alarming number of bugs
1899 exposed by this new type safety.
1901 I made one design change in JavaScriptCore, which is that the JSObject
1902 constructor should take a JSValue* as its prototype argument, not a JSObject*,
1903 since we allow the prototype to be any JSValue*, including jsNull(), for
1909 * API/JSCallbackConstructor.cpp:
1910 (KJS::JSCallbackConstructor::construct):
1911 * API/JSCallbackFunction.cpp:
1912 (KJS::JSCallbackFunction::callAsFunction):
1913 * API/JSCallbackObject.cpp:
1914 (KJS::JSCallbackObject::JSCallbackObject):
1915 (KJS::JSCallbackObject::getOwnPropertySlot):
1916 (KJS::JSCallbackObject::put):
1917 (KJS::JSCallbackObject::construct):
1918 (KJS::JSCallbackObject::callAsFunction):
1919 (KJS::JSCallbackObject::staticFunctionGetter):
1920 * API/JSCallbackObject.h:
1921 * API/JSContextRef.cpp:
1924 (JSNodePrototype_appendChild):
1925 (JSNodePrototype_removeChild):
1926 (JSNodePrototype_replaceChild):
1927 * API/JSObjectRef.cpp:
1929 (JSFunctionMakeWithBody):
1930 (JSObjectGetProperty):
1931 (JSObjectCallAsFunction):
1932 (JSObjectCallAsConstructor):
1933 * API/JSObjectRef.h:
1938 (KJS::JSObject::JSObject):
1940 2006-07-10 Geoffrey Garen <ggaren@apple.com>
1942 Approved by Maciej, Darin.
1944 Renamed JSStringBufferRef to JSInternalStringRef. "Internal string" means the
1945 JavaScript engine's internal string representation, which is the most
1946 low-level and efficient representation to use when interfacing with JavaScript.
1952 * API/JSCallbackObject.cpp:
1953 (KJS::JSCallbackObject::getOwnPropertySlot):
1954 (KJS::JSCallbackObject::put):
1955 (KJS::JSCallbackObject::deleteProperty):
1956 (KJS::JSCallbackObject::staticValueGetter):
1957 (KJS::JSCallbackObject::callbackGetter):
1958 * API/JSContextRef.cpp:
1961 * API/JSContextRef.h:
1962 * API/JSInternalStringRef.cpp: Added.
1964 (JSInternalStringCreate):
1965 (JSInternalStringCreateUTF8):
1966 (JSInternalStringRetain):
1967 (JSInternalStringRelease):
1968 (JSValueCopyStringValue):
1969 (JSInternalStringGetLength):
1970 (JSInternalStringGetCharactersPtr):
1971 (JSInternalStringGetCharacters):
1972 (JSInternalStringGetMaxLengthUTF8):
1973 (JSInternalStringGetCharactersUTF8):
1974 (JSInternalStringIsEqual):
1975 (JSInternalStringIsEqualUTF8):
1976 (JSInternalStringCreateCF):
1977 (CFStringCreateWithJSInternalString):
1978 * API/JSInternalStringRef.h: Added.
1980 (JSNodePrototype_appendChild):
1981 (JSNode_getNodeType):
1982 (JSNode_getChildNodes):
1983 (JSNode_getFirstChild):
1985 (JSNodeList_length):
1986 (JSNodeList_getProperty):
1987 * API/JSObjectRef.cpp:
1988 (JSFunctionMakeWithBody):
1989 (JSObjectGetDescription):
1990 (JSObjectHasProperty):
1991 (JSObjectGetProperty):
1992 (JSObjectSetProperty):
1993 (JSObjectDeleteProperty):
1994 (JSPropertyEnumeratorGetNext):
1995 (JSPropertyListAdd):
1996 * API/JSObjectRef.h:
1997 * API/JSStringBufferRef.cpp: Removed.
1998 * API/JSStringBufferRef.h: Removed.
2000 * API/JavaScriptCore.h:
2005 (assertEqualsAsUTF8String):
2006 (assertEqualsAsCharactersPtr):
2007 (assertEqualsAsCharacters):
2008 (MyObject_hasProperty):
2009 (MyObject_getProperty):
2010 (MyObject_setProperty):
2011 (MyObject_deleteProperty):
2012 (MyObject_getPropertyList):
2013 (print_callAsFunction):
2014 (myConstructor_callAsConstructor):
2016 * JavaScriptCore.exp:
2017 * JavaScriptCore.xcodeproj/project.pbxproj:
2019 2006-07-08 Tim Omernick <timo@apple.com>
2023 Added an OpenGL drawing model to the Netscape Plug-in API.
2027 2006-07-08 Timothy Hatcher <timothy@apple.com>
2031 Moved KJS_GetCreatedJavaVMs to jni_utility.cpp.
2032 Switched KJS_GetCreatedJavaVMs over to use dlopen and dlsym
2033 now that NSAddImage, NSLookupSymbolInImage and NSAddressOfSymbol
2034 are deprecated in Leopard.
2036 * JavaScriptCore.exp:
2037 * JavaScriptCore.xcodeproj/project.pbxproj:
2038 * bindings/jni/jni_utility.cpp:
2039 (KJS::Bindings::KJS_GetCreatedJavaVMs):
2040 * bindings/softlinking.c: Removed.
2041 * bindings/softlinking.h: Removed.
2043 2006-07-08 Geoffrey Garen <ggaren@apple.com>
2047 - Make JSObjectGetProperty return a JSValue or NULL, like JSEvaluate does.
2049 * API/JSObjectRef.cpp:
2050 (JSObjectGetProperty):
2051 * API/JSObjectRef.h:
2055 2006-07-08 Geoffrey Garen <ggaren@apple.com>
2057 Style change -- no review necessary.
2059 Use 0 instead of NULL in API .cpp files, to match our style guidelines.
2061 * API/JSContextRef.cpp:
2063 * API/JSObjectRef.cpp:
2064 (JSFunctionMakeWithBody):
2065 (JSObjectCallAsFunction):
2066 (JSObjectCallAsConstructor):
2067 * API/JSValueRef.cpp:
2070 2006-07-08 Geoffrey Garen <ggaren@apple.com>
2074 - Added ability to pass NULL for thisObject when calling JSObjectCallAsFunction,
2075 to match JSEvaluate.
2077 * API/JSObjectRef.cpp:
2078 (JSObjectCallAsFunction):
2079 * API/JSObjectRef.h:
2083 === Safari-521.15 ===
2085 2006-07-07 Geoffrey Garen <ggaren@apple.com>
2089 - Standardized which functions take a JSContext as an argument. The rule is:
2090 if you might execute JavaScript, you take a JSContext, otherwise you don't.
2092 The FIXME in JSObjectRef.h requires refactoring some parts of Interpreter,
2093 but not API changes, so I'm putting it off until later.
2095 * API/JSCallbackObject.cpp:
2096 (KJS::JSCallbackObject::JSCallbackObject):
2097 (KJS::JSCallbackObject::init):
2098 * API/JSCallbackObject.h:
2099 * API/JSContextRef.cpp:
2101 * API/JSContextRef.h:
2102 * API/JSObjectRef.cpp:
2104 (JSPropertyEnumeratorGetNext):
2105 * API/JSObjectRef.h:
2107 (MyObject_initialize):
2109 * JavaScriptCore.exp:
2110 * kjs/array_object.cpp:
2111 (ArrayInstance::setLength):
2112 (ArrayInstance::pushUndefinedObjectsToEnd):
2114 (ForInNode::execute):
2115 * kjs/reference.cpp:
2116 (KJS::Reference::getPropertyName):
2117 (KJS::Reference::getValue):
2119 * kjs/scope_chain.cpp:
2120 (KJS::ScopeChain::print):
2122 2006-07-06 Geoffrey Garen <ggaren@apple.com>
2128 - Headerdoc finished
2131 - Added a JSContextRef argument to many functions, because you need a
2132 JSContextRef for doing virtually anything. I expect to add this argument
2133 to even more functions in a future patch.
2135 - Removed the globalObjectPrototype argument to JSContextCreate because
2136 you can't create an object until you have a context, so it's impossible
2137 to pass a prototype object to JSContextCreate. That's OK because (1) there's
2138 no reason to give the global object a prototype and (2) if you really want
2139 to, you can just use a separate call to JSObjectSetPrototype.
2141 - Removed the JSClassRef argument to JSClassCreate because it was unnecessary,
2142 and you need to be able to make the global object's class before you've
2143 created a JSContext.
2145 - Added an optional exception parameter to JSFunctionMakeWithBody because anything
2146 less would be uncivilized.
2148 - Made the return value parameter to JSObjectGetProperty optional to match
2149 all other return value parameters in the API.
2151 - Made JSObjectSetPrivate/JSObjectGetPrivate work on JSCallbackFunctions
2152 and JSCallbackConstructors. You could use an abstract base class or strategic
2153 placement of m_privateData in the class structure to implement this, but
2154 the former seemed like overkill, and the latter seemed too dangerous.
2156 - Fixed a bug where JSPropertyEnumeratorGetNext would skip the first property.
2159 - Reversed the logic of the JSChar #ifdef to avoid confusing headerdoc
2161 - Removed function names from @function declarations because headeroc
2162 can parse them automatically, and I wanted to rule out manual mismatch.
2164 - Changed Error::create to take a const UString& instead of a UString*
2165 because it was looking at me funny.
2167 - Renamed JSStringBufferCreateWithCFString to JSStringBufferCreateCF
2168 because the latter is more concise and it matches JSStringBufferCreateUTF8.
2170 * API/JSCallbackObject.cpp:
2171 (KJS::JSCallbackObject::getOwnPropertySlot):
2172 (KJS::JSCallbackObject::put):
2173 (KJS::JSCallbackObject::deleteProperty):
2174 (KJS::JSCallbackObject::getPropertyList):
2175 (KJS::JSCallbackObject::toBoolean):
2176 (KJS::JSCallbackObject::toNumber):
2177 (KJS::JSCallbackObject::toString):
2178 * API/JSClassRef.cpp:
2180 * API/JSContextRef.cpp:
2182 (JSContextSetException):
2183 * API/JSContextRef.h:
2185 (JSNodePrototype_class):
2188 (JSNodeListPrototype_class):
2190 * API/JSObjectRef.cpp:
2191 (JSObjectGetProperty):
2192 (JSObjectGetPrivate):
2193 (JSObjectSetPrivate):
2194 (JSObjectCallAsFunction):
2195 (JSObjectCallAsConstructor):
2196 (JSPropertyEnumeratorGetNext):
2197 * API/JSObjectRef.h:
2198 * API/JSStringBufferRef.cpp:
2199 (JSStringBufferCreateCF):
2200 * API/JSStringBufferRef.h:
2201 * API/JSValueRef.cpp:
2202 (JSValueIsInstanceOf):
2208 (MyObject_hasProperty):
2209 (MyObject_setProperty):
2210 (MyObject_deleteProperty):
2211 (MyObject_getPropertyList):
2212 (MyObject_convertToType):
2215 * JavaScriptCore.exp:
2217 2006-07-07 Geoffrey Garen <ggaren@apple.com>
2221 - Fixed a few crashes resulting from NULL parameters to JSClassCreate.
2223 * API/JSClassRef.cpp:
2226 * API/testapi.c: Added test for NULL parameters.
2229 2006-07-07 Geoffrey Garen <ggaren@apple.com>
2231 Reviewed by John, mocked by Darin.
2233 - Changed JSEvaluate to take a JSObjectRef instead of a JSValueRef as
2234 "this," since "this" must be an object.
2236 * API/JSContextRef.cpp:
2238 * API/JSContextRef.h:
2240 2006-07-07 Geoffrey Garen <ggaren@apple.com>
2247 * JavaScriptCore.xcodeproj/project.pbxproj:
2249 2006-07-05 Geoffrey Garen <ggaren@apple.com>
2253 Renamed JSCharBufferRef, which was universally unpopular, to JSStringBufferRef,
2254 which, hopefully, will be less unpopular.
2260 * API/JSCallbackObject.cpp:
2261 (KJS::JSCallbackObject::getOwnPropertySlot):
2262 (KJS::JSCallbackObject::put):
2263 (KJS::JSCallbackObject::deleteProperty):
2264 (KJS::JSCallbackObject::staticValueGetter):
2265 (KJS::JSCallbackObject::callbackGetter):
2266 * API/JSCharBufferRef.cpp: Removed.
2267 * API/JSCharBufferRef.h: Removed.
2268 * API/JSContextRef.cpp:
2271 * API/JSContextRef.h:
2273 (JSNodePrototype_appendChild):
2274 (JSNode_getNodeType):
2275 (JSNode_getChildNodes):
2276 (JSNode_getFirstChild):
2278 (JSNodeList_length):
2279 (JSNodeList_getProperty):
2280 * API/JSObjectRef.cpp:
2281 (JSFunctionMakeWithBody):
2282 (JSObjectGetDescription):
2283 (JSObjectHasProperty):
2284 (JSObjectGetProperty):
2285 (JSObjectSetProperty):
2286 (JSObjectDeleteProperty):
2287 (JSPropertyEnumeratorGetNext):
2288 (JSPropertyListAdd):
2289 * API/JSObjectRef.h:
2290 * API/JSStringBufferRef.cpp: Added.
2292 (JSStringBufferCreate):
2293 (JSStringBufferCreateUTF8):
2294 (JSStringBufferRetain):
2295 (JSStringBufferRelease):
2296 (JSValueCopyStringValue):
2297 (JSStringBufferGetLength):
2298 (JSStringBufferGetCharactersPtr):
2299 (JSStringBufferGetCharacters):
2300 (JSStringBufferGetMaxLengthUTF8):
2301 (JSStringBufferGetCharactersUTF8):
2302 (JSStringBufferIsEqual):
2303 (JSStringBufferIsEqualUTF8):
2304 (JSStringBufferCreateWithCFString):
2305 (CFStringCreateWithJSStringBuffer):
2306 * API/JSStringBufferRef.h: Added.
2308 * API/JavaScriptCore.h:
2313 (assertEqualsAsUTF8String):
2314 (assertEqualsAsCharactersPtr):
2315 (assertEqualsAsCharacters):
2316 (MyObject_hasProperty):
2317 (MyObject_getProperty):
2318 (MyObject_setProperty):
2319 (MyObject_deleteProperty):
2320 (MyObject_getPropertyList):
2321 (print_callAsFunction):
2322 (myConstructor_callAsConstructor):
2324 * JavaScriptCore.exp:
2325 * JavaScriptCore.xcodeproj/project.pbxproj:
2327 2006-07-05 Geoffrey Garen <ggaren@apple.com>
2331 Moved some code around for more logical file separation.
2334 * API/JSContextRef.h:
2335 * API/JSObjectRef.cpp:
2336 * API/JSValueRef.cpp:
2340 2006-07-03 Geoffrey Garen <ggaren@apple.com>
2344 Implemented JSFunctionMakeWithBody, which parses a script as a function body
2345 in the global scope, and returns the resulting anonymous function.
2347 I also removed private data from JSCallbackFunction. It never worked,
2348 since JSCallbackFunction doesn't inherit from JSCallbackObject.
2350 * API/JSCallbackConstructor.cpp: Removed.
2351 * API/JSCallbackConstructor.h: Removed.
2352 * API/JSCallbackFunction.cpp:
2353 (KJS::JSCallbackFunction::JSCallbackFunction):
2354 (KJS::JSCallbackFunction::implementsConstruct):
2355 (KJS::JSCallbackFunction::construct):
2356 (KJS::JSCallbackFunction::implementsCall):
2357 (KJS::JSCallbackFunction::callAsFunction):
2358 * API/JSCallbackFunction.h:
2359 * API/JSCallbackObject.cpp:
2360 (KJS::JSCallbackObject::staticFunctionGetter):
2361 * API/JSObjectRef.cpp:
2363 (JSFunctionMakeWithCallbacks):
2364 * API/JSObjectRef.h:
2370 * JavaScriptCore.exp: Programmatically added all symbols exported by
2371 API object files, and sorted results
2372 * JavaScriptCore.xcodeproj/project.pbxproj:
2374 2006-07-03 Geoffrey Garen <ggaren@apple.com>
2378 - Return syntax error in JSCheckSyntax through a JSValueRef* exception
2382 * API/JSContextRef.cpp:
2386 * JavaScriptCore.exp:
2387 * kjs/interpreter.cpp:
2388 (KJS::Interpreter::checkSyntax):
2389 * kjs/interpreter.h:
2391 2006-07-04 Darin Adler <darin@apple.com>
2395 * wtf/MathExtras.h: Oops. Added missing #endif.
2397 2006-07-04 Bjoern Graf <bjoern.graf@gmail.com>
2400 Tweaked a bit by Darin.
2402 - http://bugzilla.opendarwin.org/show_bug.cgi?id=9678
2403 work around MSVCRT's fmod function returning NaN for fmod(x, infinity) instead of x
2405 * wtf/MathExtras.h: Added include of <float.h>.
2406 (isinf): Fix to return false for NAN.
2407 (wtf_fmod): Added. An inline that works around the bug.
2410 * kjs/number_object.cpp:
2411 * kjs/operations.cpp:
2413 Added includes of MathExtras.h to all files using fmod.
2415 * JavaScriptCore.xcodeproj/project.pbxproj: Let Xcode 2.3 have its way with
2418 2006-07-01 Geoffrey Garen <ggaren@apple.com>
2422 - Refined value conversions in the API:
2423 - failed toNumber returns NaN
2424 - failed toObject returns NULL
2425 - failed toString returns empty string
2427 - Refined excpetion handling in the API:
2428 - failed value conversions do not throw exceptions
2429 - uncaught exceptions in JSEvaluate, JSObjectCallAsFunction, and
2430 JSObjectCallAsConstructor are returned through a JSValueRef* exception
2432 - removed JSContextHasException, because JSContextGetException does
2436 * API/JSCharBufferRef.cpp:
2437 (JSValueCopyStringValue):
2438 * API/JSContextRef.cpp:
2440 * API/JSContextRef.h:
2441 * API/JSNodeList.c: Added test code demonstrating how you would use
2442 toNumber, and why you probably don't need toUInt32, etc.
2443 (JSNodeListPrototype_item):
2444 (JSNodeList_getProperty):
2445 * API/JSObjectRef.cpp:
2447 (JSObjectCallAsFunction):
2448 (JSObjectCallAsConstructor):
2449 * API/JSObjectRef.h:
2450 * API/JSValueRef.cpp:
2456 (main): Added tests for new rules, and call to JSGCProtect to fix Intel
2458 * JavaScriptCore.exp:
2460 2006-07-03 Darin Adler <darin@apple.com>
2462 - Rolled out HashMap implementation of NPRuntime, at least temporarily.
2464 Fixes hang in the bindings section of layout tests seen on the
2467 This code was using HashMap<const char*, PrivateIdentifier*>.
2468 But that hashes based on pointer identity, not string value.
2469 The default hash for any pointer type is to hash based on the pointer.
2470 And WTF doesn't currently have a string hash for char*.
2471 We'll need to fix that before re-landing this patch.
2473 (Formatting was also incorrect -- extra spaces in parentheses.)
2475 * bindings/npruntime.cpp: Rolled out last change.
2477 2006-07-02 Justin Haygood <jhaygood@spsu.edu>
2479 Reviewed, tweaked, landed by ggaren.
2481 - Port NPRuntime from CFDictionary to HashMap.
2483 * bindings/npruntime.cpp:
2484 (getStringIdentifierDictionary):
2485 (getIntIdentifierDictionary):
2486 (_NPN_GetStringIdentifier):
2487 (_NPN_GetIntIdentifier):
2488 * bindings/npruntime.h:
2490 2006-07-01 Geoffrey Garen <ggaren@apple.com>
2494 - Fixed <rdar://problem/4611197> REGRESSION: Liveconnect with Java test
2495 fails at http://www-sor.inria.fr/~dedieu/notes/liveconnect/simple_example.html
2497 * JavaScriptCore.exp: Export symbols used by liveconnect
2499 2006-06-29 Geoffrey Garen <ggaren@apple.com>
2503 - Phase 2 in the JS API.
2505 - Added support for specifying static tables of values -- this should
2506 obviate the need for using complicated callbacks for most lookups.
2508 - API objects are now created with classes (JSClassRef) -- in order to support
2509 static values, and in order to prevent API objects from storing their
2510 data inline, and thus falling into the oversized (read: slow and prone to
2511 giving Maciej the frowny face) heap.
2513 - Added two specialized JSObject subclasses -- JSCallbackFunction and JSCallbackConstructor --
2514 to allow JSFunctionMake and JSConstructorMake to continue to work with
2515 the new class model. Another solution to this problem would be to create
2516 a custom class object for each function and constructor you make. This
2517 solution is more code but also more efficient.
2519 - Substantially beefed up the minidom example to demonstrate and test a
2520 lot of these techniques. Its output is still pretty haphazard, though.
2522 - Gave the <kjs/ preface to some includes -- I'm told this matters to
2523 building on some versions of Linux.
2525 - Implemented JSValueIsInstanceOf and JSValueIsObjectOfClass
2527 - Removed GetDescription callback. Something in the class datastructure
2528 should take care of this.
2531 * API/JSCallbackConstructor.cpp: Added.
2533 (KJS::JSCallbackConstructor::JSCallbackConstructor):
2534 (KJS::JSCallbackConstructor::implementsConstruct):
2535 (KJS::JSCallbackConstructor::construct):
2536 (KJS::JSCallbackConstructor::setPrivate):
2537 (KJS::JSCallbackConstructor::getPrivate):
2538 * API/JSCallbackConstructor.h: Added.
2539 (KJS::JSCallbackConstructor::classInfo):
2540 * API/JSCallbackFunction.cpp: Added.
2542 (KJS::JSCallbackFunction::JSCallbackFunction):
2543 (KJS::JSCallbackFunction::implementsCall):
2544 (KJS::JSCallbackFunction::callAsFunction):
2545 (KJS::JSCallbackFunction::setPrivate):
2546 (KJS::JSCallbackFunction::getPrivate):
2547 * API/JSCallbackFunction.h: Added.
2548 (KJS::JSCallbackFunction::classInfo):
2549 * API/JSCallbackObject.cpp:
2551 (KJS::JSCallbackObject::JSCallbackObject):
2552 (KJS::JSCallbackObject::init):
2553 (KJS::JSCallbackObject::~JSCallbackObject):
2554 (KJS::JSCallbackObject::className):
2555 (KJS::JSCallbackObject::getOwnPropertySlot):
2556 (KJS::JSCallbackObject::put):
2557 (KJS::JSCallbackObject::deleteProperty):
2558 (KJS::JSCallbackObject::implementsConstruct):
2559 (KJS::JSCallbackObject::construct):
2560 (KJS::JSCallbackObject::implementsCall):
2561 (KJS::JSCallbackObject::callAsFunction):
2562 (KJS::JSCallbackObject::getPropertyList):
2563 (KJS::JSCallbackObject::toBoolean):
2564 (KJS::JSCallbackObject::toNumber):
2565 (KJS::JSCallbackObject::toString):
2566 (KJS::JSCallbackObject::inherits):
2567 (KJS::JSCallbackObject::staticValueGetter):
2568 (KJS::JSCallbackObject::staticFunctionGetter):
2569 (KJS::JSCallbackObject::callbackGetter):
2570 * API/JSCallbackObject.h:
2571 * API/JSCharBufferRef.cpp:
2572 * API/JSClassRef.cpp: Added.
2576 * API/JSClassRef.h: Added.
2577 (StaticValueEntry::StaticValueEntry):
2578 (StaticFunctionEntry::StaticFunctionEntry):
2579 (__JSClass::__JSClass):
2580 * API/JSContextRef.cpp:
2583 * API/JSContextRef.h:
2584 * API/JSNode.c: Added.
2585 (JSNodePrototype_appendChild):
2586 (JSNodePrototype_removeChild):
2587 (JSNodePrototype_replaceChild):
2588 (JSNodePrototype_class):
2589 (JSNode_getNodeType):
2590 (JSNode_getChildNodes):
2591 (JSNode_getFirstChild):
2597 * API/JSNode.h: Added.
2598 * API/JSNodeList.c: Added.
2599 (JSNodeListPrototype_item):
2600 (JSNodeListPrototype_class):
2601 (JSNodeList_length):
2602 (JSNodeList_getProperty):
2603 (JSNodeList_finalize):
2605 (JSNodeList_prototype):
2607 * API/JSNodeList.h: Added.
2608 * API/JSObjectRef.cpp:
2611 (JSConstructorMake):
2612 (__JSPropertyEnumerator::__JSPropertyEnumerator):
2613 (JSObjectCreatePropertyEnumerator):
2614 (JSPropertyEnumeratorGetNext):
2615 (JSPropertyEnumeratorRetain):
2616 (JSPropertyEnumeratorRelease):
2617 * API/JSObjectRef.h:
2618 (__JSObjectCallbacks::):
2619 * API/JSValueRef.cpp:
2620 (JSValueIsObjectOfClass):
2621 (JSValueIsInstanceOf):
2623 * API/Node.c: Added.
2627 (Node_replaceChild):
2630 * API/Node.h: Added.
2631 * API/NodeList.c: Added.
2637 * API/NodeList.h: Added.
2641 (createStringWithContentsOfFile):
2644 (assertEqualsAsCharacters):
2645 (MyObject_getProperty):
2647 (myConstructor_callAsConstructor):
2650 * JavaScriptCore.xcodeproj/project.pbxproj:
2652 2006-06-26 Kevin Ollivier <kevino@theolliviers.com>
2654 Reviewed and tweaked by Darin.
2656 - Compile fixes for wx port / gcc 4.0.2
2658 * kjs/array_object.cpp:
2659 Added missing headers.
2662 gcc needs class prototypes before defining those classes as friend classes
2664 2006-06-30 Mike Emmel <mike.emmel@gmail.com>
2668 Compilation fixes for Linux/Gdk.
2670 * JavaScriptCore/kjs/interpreter.cpp: added include of signal.h
2671 * JavaScriptCore/kjs/ExecState.h: added missing class declaration
2672 * JavaScriptCore/kjs/ExecState.cpp: case wrong on include of context.h
2673 * JavaScriptCore/JavaScriptCoreSources.bkl: added Context.cpp and ExecState.cpp
2675 === Safari-521.14 ===
2677 2006-06-29 Maciej Stachowiak <mjs@apple.com>
2681 - add headerdoc comments to some of the new JS API headers
2686 2006-06-28 Timothy Hatcher <timothy@apple.com>
2688 Prefer the Stabs debugging symbols format until DWARF bugs are fixed.
2690 * JavaScriptCore.xcodeproj/project.pbxproj:
2692 2006-06-27 Timothy Hatcher <timothy@apple.com>
2696 <rdar://problem/4448350> Deprecated ObjC language API used in JavaScriptCore, WebCore, WebKit and WebBrowser
2698 Switch to the new ObjC 2 API, ifdefed the old code around OBJC_API_VERSION so it still works on Tiger.
2699 Removed the use of the old stringWithCString, switched to the new Tiger version that accepts an encoding.
2700 Lots of code style cleanup.
2702 * JavaScriptCore.xcodeproj/project.pbxproj:
2703 * bindings/objc/objc_class.h:
2704 * bindings/objc/objc_class.mm:
2705 (KJS::Bindings::ObjcClass::~ObjcClass):
2706 (KJS::Bindings::_createClassesByIsAIfNecessary):
2707 (KJS::Bindings::ObjcClass::classForIsA):
2708 (KJS::Bindings::ObjcClass::name):
2709 (KJS::Bindings::ObjcClass::methodsNamed):
2710 (KJS::Bindings::ObjcClass::fieldNamed):
2711 (KJS::Bindings::ObjcClass::fallbackObject):
2712 * bindings/objc/objc_header.h:
2713 * bindings/objc/objc_instance.h:
2714 * bindings/objc/objc_instance.mm:
2715 (ObjcInstance::ObjcInstance):
2716 (ObjcInstance::~ObjcInstance):
2717 (ObjcInstance::operator=):
2718 (ObjcInstance::begin):
2719 (ObjcInstance::end):
2720 (ObjcInstance::getClass):
2721 (ObjcInstance::invokeMethod):
2722 (ObjcInstance::invokeDefaultMethod):
2723 (ObjcInstance::setValueOfField):
2724 (ObjcInstance::supportsSetValueOfUndefinedField):
2725 (ObjcInstance::setValueOfUndefinedField):
2726 (ObjcInstance::getValueOfField):
2727 (ObjcInstance::getValueOfUndefinedField):
2728 (ObjcInstance::defaultValue):
2729 (ObjcInstance::stringValue):
2730 (ObjcInstance::numberValue):
2731 (ObjcInstance::booleanValue):
2732 (ObjcInstance::valueOf):
2733 * bindings/objc/objc_runtime.h:
2734 * bindings/objc/objc_runtime.mm:
2735 (ObjcMethod::ObjcMethod):
2737 (ObjcMethod::getMethodSignature):
2738 (ObjcMethod::setJavaScriptName):
2741 (ObjcField::valueFromInstance):
2742 (convertValueToObjcObject):
2743 (ObjcField::setValueToInstance):
2744 (ObjcArray::operator=):
2745 (ObjcArray::setValueAt):
2746 (ObjcArray::valueAt):
2747 (ObjcFallbackObjectImp::ObjcFallbackObjectImp):
2748 (ObjcFallbackObjectImp::callAsFunction):
2749 (ObjcFallbackObjectImp::defaultValue):
2751 2006-06-28 Anders Carlsson <acarlsson@apple.com>
2755 http://bugzilla.opendarwin.org/show_bug.cgi?id=8636
2756 REGRESSION: JavaScript access to Java applet causes hang (_webViewURL not implemented)
2758 * bindings/jni/jni_objc.mm:
2759 (KJS::Bindings::dispatchJNICall):
2760 Just pass nil as the calling URL. This will cause the Java plugin to use the URL of the page
2761 containing the applet (which is what we used to do).
2763 2006-06-27 Timothy Hatcher <timothy@apple.com>
2767 <rdar://problem/4406785> Add an export file to TOT JavaScriptCore like the Safari-2-0-branch
2769 * JavaScriptCore.exp: Added.
2770 * JavaScriptCore.xcodeproj/project.pbxproj:
2772 2006-06-25 Geoffrey Garen <ggaren@apple.com>
2776 - Added JSConstructorMake to match JSFunctionMake, along with test code.
2778 [ I checked in the ChangeLog before without the actual files. ]
2780 * API/JSObjectRef.cpp:
2781 (JSConstructorMake):
2782 * API/JSObjectRef.h:
2784 (myConstructor_callAsConstructor):
2788 * JavaScriptCore.xcodeproj/project.pbxproj: Moved testapi.c to the testapi
2789 target -- this was an oversight in my earlier check-in.
2791 2006-06-25 Timothy Hatcher <timothy@apple.com>
2795 Bug 9574: Drosera should show inline scripts within the original HTML
2796 http://bugzilla.opendarwin.org/show_bug.cgi?id=9574
2798 Pass the starting line number and error message to the debugger.
2801 (Debugger::sourceParsed):
2804 (KJS::GlobalFuncImp::callAsFunction):
2805 * kjs/function_object.cpp:
2806 (FunctionObjectImp::construct):
2807 * kjs/interpreter.cpp:
2808 (KJS::Interpreter::evaluate):
2810 2006-06-24 Alexey Proskuryakov <ap@nypop.com>
2812 Rubber-stamped by Eric.
2814 Add a -h (do not follow symlinks) option to ln in derived sources build script (without it,
2815 a symlink was created inside the source directory on second build).
2817 * JavaScriptCore.xcodeproj/project.pbxproj:
2819 2006-06-24 David Kilzer <ddkilzer@kilzer.net>
2821 Reviewed by Timothy.
2823 * Info.plist: Fixed copyright to include 2003-2006.
2825 2006-06-24 Alexey Proskuryakov <ap@nypop.com>
2829 - http://bugzilla.opendarwin.org/show_bug.cgi?id=9418
2830 WebKit will not build when Space exists in path
2832 * JavaScriptCore.xcodeproj/project.pbxproj: Enclose search paths in quotes; create symlinks to
2833 avoid passing paths with spaces to make.
2835 2006-06-23 Timothy Hatcher <timothy@apple.com>
2839 Adding more operator[] overloads for long and short types.
2842 (WTF::Vector::operator[]):
2844 === JavaScriptCore-521.13 ===
2846 2006-06-22 Alexey Proskuryakov <ap@nypop.com>
2850 - http://bugzilla.opendarwin.org/show_bug.cgi?id=9539
2851 Another case error preventing build
2853 * API/JSObjectRef.cpp: Changed "identifier.h" to "Identifier.h"
2855 2006-06-22 David Kilzer <ddkilzer@kilzer.net>
2859 http://bugzilla.opendarwin.org/show_bug.cgi?id=9539
2860 Another case error preventing build
2862 * API/APICast.h: Changed "UString.h" to "ustring.h".
2864 2006-06-21 Geoffrey Garen <ggaren@apple.com>
2866 Fixed release build, fixed accidental infinite recursion due to
2867 last minute global replace gone awry.
2872 (assertEqualsAsBoolean):
2873 (assertEqualsAsNumber):
2874 (assertEqualsAsUTF8String):
2875 (assertEqualsAsCharactersPtr):
2876 * JavaScriptCore.xcodeproj/project.pbxproj:
2878 2006-06-21 Geoffrey Garen <ggaren@apple.com>
2882 - First cut at C API to JavaScript. Includes a unit test, 'testapi.c',
2883 and the outline of a test app, 'minidom.c'.
2885 Includes one change to JSC internals: Rename propList to getPropertyList and have it
2886 take its target property list by reference so that subclasses can
2887 add properties to the list before calling through to their superclasses.
2889 Also, I just ran prepare-ChangeLog in about 10 seconds, and I would like
2890 to give a shout-out to that.
2892 * API/APICast.h: Added.
2895 * API/JSBase.h: Added.
2896 * API/JSCallbackObject.cpp: Added.
2898 (KJS::JSCallbackObject::JSCallbackObject):
2899 (KJS::JSCallbackObject::~JSCallbackObject):
2900 (KJS::JSCallbackObject::className):
2901 (KJS::JSCallbackObject::getOwnPropertySlot):
2902 (KJS::JSCallbackObject::put):
2903 (KJS::JSCallbackObject::deleteProperty):
2904 (KJS::JSCallbackObject::implementsConstruct):
2905 (KJS::JSCallbackObject::construct):
2906 (KJS::JSCallbackObject::implementsCall):
2907 (KJS::JSCallbackObject::callAsFunction):
2908 (KJS::JSCallbackObject::getPropertyList):
2909 (KJS::JSCallbackObject::toBoolean):
2910 (KJS::JSCallbackObject::toNumber):
2911 (KJS::JSCallbackObject::toString):
2912 (KJS::JSCallbackObject::setPrivate):
2913 (KJS::JSCallbackObject::getPrivate):
2914 (KJS::JSCallbackObject::cachedValueGetter):
2915 (KJS::JSCallbackObject::callbackGetter):
2916 * API/JSCallbackObject.h: Added.
2917 (KJS::JSCallbackObject::classInfo):
2918 * API/JSCharBufferRef.cpp: Added.
2920 (JSCharBufferCreate):
2921 (JSCharBufferCreateUTF8):
2922 (JSCharBufferRetain):
2923 (JSCharBufferRelease):
2924 (JSValueCopyStringValue):
2925 (JSCharBufferGetLength):
2926 (JSCharBufferGetCharactersPtr):
2927 (JSCharBufferGetCharacters):
2928 (JSCharBufferGetMaxLengthUTF8):
2929 (JSCharBufferGetCharactersUTF8):
2930 (JSCharBufferIsEqual):
2931 (JSCharBufferIsEqualUTF8):
2932 (JSCharBufferCreateWithCFString):
2933 (CFStringCreateWithJSCharBuffer):
2934 * API/JSCharBufferRef.h: Added.
2935 * API/JSContextRef.cpp: Added.
2938 (JSContextGetGlobalObject):
2941 (JSContextHasException):
2942 (JSContextGetException):
2943 (JSContextClearException):
2944 (JSContextSetException):
2945 * API/JSContextRef.h: Added.
2946 * API/JSObjectRef.cpp: Added.
2950 (JSObjectGetDescription):
2951 (JSObjectGetPrototype):
2952 (JSObjectSetPrototype):
2953 (JSObjectHasProperty):
2954 (JSObjectGetProperty):
2955 (JSObjectSetProperty):
2956 (JSObjectDeleteProperty):
2957 (JSObjectGetPrivate):
2958 (JSObjectSetPrivate):
2959 (JSObjectIsFunction):
2960 (JSObjectCallAsFunction):
2961 (JSObjectIsConstructor):
2962 (JSObjectCallAsConstructor):
2963 (__JSPropertyListEnumerator::__JSPropertyListEnumerator):
2964 (JSObjectCreatePropertyEnumerator):
2965 (JSPropertyEnumeratorGetNext):
2966 (JSPropertyEnumeratorRetain):
2967 (JSPropertyEnumeratorRelease):
2968 (JSPropertyListAdd):
2969 * API/JSObjectRef.h: Added.
2970 * API/JSValueRef.cpp: Added.
2972 (JSValueIsUndefined):
2979 (JSValueIsStrictEqual):
2989 * API/JSValueRef.h: Added.
2990 * API/JavaScriptCore.h: Added.
2991 * API/minidom.c: Added.
2993 * API/minidom.html: Added.
2994 * API/minidom.js: Added.
2995 * API/testapi.c: Added.
2996 (assertEqualsAsBoolean):
2997 (assertEqualsAsNumber):
2998 (assertEqualsAsUTF8String):
2999 (assertEqualsAsCharactersPtr):
3000 (assertEqualsAsCharacters):
3001 (MyObject_initialize):
3002 (MyObject_copyDescription):
3003 (MyObject_hasProperty):
3004 (MyObject_getProperty):
3005 (MyObject_setProperty):
3006 (MyObject_deleteProperty):
3007 (MyObject_getPropertyList):
3008 (MyObject_callAsFunction):
3009 (MyObject_callAsConstructor):
3010 (MyObject_convertToType):
3011 (MyObject_finalize):
3012 (print_callAsFunction):
3014 (createStringWithContentsOfFile):
3015 * API/testapi.js: Added.
3017 * JavaScriptCore.xcodeproj/project.pbxproj:
3018 * bindings/npruntime_impl.h:
3019 * kjs/array_instance.h:
3020 * kjs/array_object.cpp:
3021 (ArrayInstance::getPropertyList):
3022 * kjs/interpreter.cpp:
3023 (KJS::Interpreter::evaluate):
3025 (ForInNode::execute):
3027 (KJS::JSObject::put):
3028 (KJS::JSObject::canPut):
3029 (KJS::JSObject::deleteProperty):
3030 (KJS::JSObject::propertyIsEnumerable):
3031 (KJS::JSObject::getPropertyAttributes):
3032 (KJS::JSObject::getPropertyList):
3034 * kjs/property_map.cpp:
3035 (KJS::PropertyMap::get):
3036 * kjs/property_map.h:
3037 * kjs/scope_chain.cpp:
3038 (KJS::ScopeChain::print):
3039 * kjs/string_object.cpp:
3040 (StringInstance::getPropertyList):
3041 * kjs/string_object.h:
3043 (KJS::UString::Rep::ref):
3045 2006-06-20 Timothy Hatcher <timothy@apple.com>
3049 Make sure we clear the exception before returning so
3050 that future calls will not fail because of an earlier
3051 exception state. Assert on entry that the WebScriptObject
3052 is working with an ExecState that dose not have an exception.
3053 Document that evaluateWebScript and callWebScriptMethod return
3054 WebUndefined when an exception is thrown.
3056 * bindings/objc/WebScriptObject.h:
3057 * bindings/objc/WebScriptObject.mm:
3058 (-[WebScriptObject callWebScriptMethod:withArguments:]):
3059 (-[WebScriptObject evaluateWebScript:]):
3060 (-[WebScriptObject setValue:forKey:]):
3061 (-[WebScriptObject valueForKey:]):
3062 (-[WebScriptObject removeWebScriptKey:]):
3063 (-[WebScriptObject webScriptValueAtIndex:]):
3064 (-[WebScriptObject setWebScriptValueAtIndex:value:]):
3066 2006-06-19 Anders Carlsson <acarlsson@apple.com>
3070 * kjs/interpreter.cpp:
3071 (KJS::TimeoutChecker::pauseTimeoutCheck):
3072 (KJS::TimeoutChecker::resumeTimeoutCheck):
3073 Fix argument order in setitimer calls.
3075 2006-06-18 Anders Carlsson <acarlsson@apple.com>
3079 * kjs/interpreter.cpp:
3080 (KJS::TimeoutChecker::pauseTimeoutCheck):
3081 Do nothing if the timeout check hasn't been started.
3083 (KJS::TimeoutChecker::resumeTimeoutCheck):
3084 Do nothing if the timeout check hasn't been started.
3085 Use the right signal handler when unblocking.
3087 (KJS::Interpreter::handleTimeout):
3088 pause/resume the timeout check around the call to
3089 shouldInterruptScript().
3091 2006-06-16 Ben Goodger <beng@google.com>
3095 http://bugzilla.opendarwin.org/show_bug.cgi?id=9491
3096 Windows build breaks in interpreter.cpp
3098 * kjs/interpreter.cpp
3099 (KJS::TimeoutChecker::pauseTimeoutCheck):
3100 (KJS::TimeoutChecker::resumeTimeoutCheck):
3101 Make sure to only assert equality with s_executingInterpreter when it
3102 is being used (i.e. when HAVE(SYS_TIME_H) == true)
3104 2006-06-17 David Kilzer <ddkilzer@kilzer.net>
3108 http://bugzilla.opendarwin.org/show_bug.cgi?id=9477
3109 REGRESSION: fast/dom/replaceChild.html crashes on WebKit ToT in debug build
3112 (KJS::FunctionImp::callAsFunction): Refetch the debugger after executing the function
3113 in case the WebFrame it was running in has since been destroyed.
3115 2006-06-17 David Kilzer <ddkilzer@kilzer.net>
3119 http://bugzilla.opendarwin.org/show_bug.cgi?id=9476
3120 REGRESSION: Reproducible crash after closing window after viewing
3121 css2.1/t0803-c5501-imrgn-t-00-b-ag.html
3124 (Debugger::detach): Call setDebugger(0) for all interpreters removed from
3125 the 'attached to a debugger' list.
3127 2006-06-17 Anders Carlsson <acarlsson@apple.com>
3129 Reviewed by Maciej and Geoff.
3131 http://bugzilla.opendarwin.org/show_bug.cgi?id=7080
3132 Provide some way to stop a JavaScript infinite loop
3136 Add Interrupted completion type.
3139 (KJS::FunctionImp::callAsFunction):
3140 (KJS::GlobalFuncImp::callAsFunction):
3141 Only set the exception on the new ExecState if the current one has had one.
3143 * kjs/interpreter.cpp:
3144 (KJS::TimeoutChecker::startTimeoutCheck):
3145 (KJS::TimeoutChecker::stopTimeoutCheck):
3146 (KJS::TimeoutChecker::alarmHandler):
3147 (KJS::TimeoutChecker::pauseTimeoutCheck):
3148 (KJS::TimeoutChecker::resumeTimeoutCheck):
3149 New TimeoutChecker class which handles setting Interpreter::m_timedOut flag after a given
3150 period of time. This currently only works on Unix platforms where setitimer and signals are used.
3152 (KJS::Interpreter::Interpreter):
3153 Initialize new member variables.
3155 (KJS::Interpreter::~Interpreter):
3156 Destroy the timeout checker.
3158 (KJS::Interpreter::startTimeoutCheck):
3159 (KJS::Interpreter::stopTimeoutCheck):
3160 (KJS::Interpreter::pauseTimeoutCheck):
3161 (KJS::Interpreter::resumeTimeoutCheck):
3162 Call the timeout checker.
3164 (KJS::Interpreter::handleTimeout):
3165 Called on timeout. Resets the m_timedOut flag and calls shouldInterruptScript.
3167 * kjs/interpreter.h:
3168 (KJS::Interpreter::setTimeoutTime):
3169 New function for setting the timeout time.
3171 (KJS::Interpreter::shouldInterruptScript):
3172 New function. The idea is that this should be overridden by subclasses in order to for example
3173 pop up a dialog asking the user if the script should be interrupted.
3175 (KJS::Interpreter::checkTimeout):
3176 New function which checks the m_timedOut flag and calls handleTimeout if it's set.
3179 (DoWhileNode::execute):
3180 (WhileNode::execute):
3182 Call Interpreter::checkTimeout after each iteration of the loop.
3184 2006-06-15 Timothy Hatcher <timothy@apple.com>
3186 Reviewed by Geoff and Darin.
3188 Prefer the DWARF debugging symbols format for use in Xcode 2.3.
3190 * JavaScriptCore.xcodeproj/project.pbxproj:
3192 2006-06-14 Geoffrey Garen <ggaren@apple.com>
3196 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=9438
3197 Someone broke ToT: cannot build
3199 * JavaScriptCore.xcodeproj/project.pbxproj:
3200 * bindings/runtime_root.h: Changed "Interpreter.h" to "interpreter.h"
3202 2006-06-12 Geoffrey Garen <ggaren@apple.com>
3206 * bindings/objc/WebScriptObject.mm:
3207 (+[WebScriptObject throwException:]): Restore assignment I accidentally
3208 deleted in previous commit
3210 2006-06-12 Geoffrey Garen <ggaren@apple.com>
3212 Reviewed by TimO, Maciej.
3214 - Merged InterpreterImp code into Interpreter, which implements
3215 all interpreter functionality now. This is part of my continuing quest
3216 to create an external notion of JS "execution context" that is unified and simple --
3217 something to replace the mix of Context, ContextImp, ExecState, Interpreter,
3218 InterpreterImp, and JSRun.
3220 All tests pass. Leaks test has not regressed from its baseline ~207 leaks
3221 with ~3460 leaked nodes.
3223 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3224 * JavaScriptCore.xcodeproj/project.pbxproj:
3225 * bindings/NP_jsobject.cpp:
3226 * bindings/objc/WebScriptObject.mm:
3227 (+[WebScriptObject throwException:]):
3228 * bindings/runtime_root.cpp:
3229 * bindings/runtime_root.h:
3231 (KJS::Context::Context):
3232 * kjs/ExecState.cpp: Added.
3233 (KJS::ExecState::lexicalInterpreter):
3234 * kjs/ExecState.h: Added.
3235 (KJS::ExecState::dynamicInterpreter):
3236 * kjs/SavedBuiltins.h: Added.
3237 * kjs/bool_object.cpp:
3238 (BooleanPrototype::BooleanPrototype):
3239 * kjs/collector.cpp:
3240 (KJS::Collector::collect):
3241 (KJS::Collector::numInterpreters):
3247 (KJS::FunctionImp::callAsFunction):
3248 (KJS::GlobalFuncImp::callAsFunction):
3249 * kjs/function_object.cpp:
3250 (FunctionObjectImp::construct):
3253 * kjs/interpreter.cpp:
3254 (KJS::interpreterMap):
3255 (KJS::Interpreter::Interpreter):
3256 (KJS::Interpreter::init):
3257 (KJS::Interpreter::~Interpreter):
3258 (KJS::Interpreter::globalObject):
3259 (KJS::Interpreter::initGlobalObject):
3260 (KJS::Interpreter::globalExec):
3261 (KJS::Interpreter::checkSyntax):
3262 (KJS::Interpreter::evaluate):
3263 (KJS::Interpreter::builtinObject):
3264 (KJS::Interpreter::builtinFunction):
3265 (KJS::Interpreter::builtinArray):
3266 (KJS::Interpreter::builtinBoolean):
3267 (KJS::Interpreter::builtinString):
3268 (KJS::Interpreter::builtinNumber):
3269 (KJS::Interpreter::builtinDate):
3270 (KJS::Interpreter::builtinRegExp):
3271 (KJS::Interpreter::builtinError):
3272 (KJS::Interpreter::builtinObjectPrototype):
3273 (KJS::Interpreter::builtinFunctionPrototype):
3274 (KJS::Interpreter::builtinArrayPrototype):
3275 (KJS::Interpreter::builtinBooleanPrototype):
3276 (KJS::Interpreter::builtinStringPrototype):
3277 (KJS::Interpreter::builtinNumberPrototype):
3278 (KJS::Interpreter::builtinDatePrototype):
3279 (KJS::Interpreter::builtinRegExpPrototype):
3280 (KJS::Interpreter::builtinErrorPrototype):
3281 (KJS::Interpreter::builtinEvalError):
3282 (KJS::Interpreter::builtinRangeError):
3283 (KJS::Interpreter::builtinReferenceError):
3284 (KJS::Interpreter::builtinSyntaxError):
3285 (KJS::Interpreter::builtinTypeError):
3286 (KJS::Interpreter::builtinURIError):
3287 (KJS::Interpreter::builtinEvalErrorPrototype):
3288 (KJS::Interpreter::builtinRangeErrorPrototype):
3289 (KJS::Interpreter::builtinReferenceErrorPrototype):
3290 (KJS::Interpreter::builtinSyntaxErrorPrototype):
3291 (KJS::Interpreter::builtinTypeErrorPrototype):
3292 (KJS::Interpreter::builtinURIErrorPrototype):
3293 (KJS::Interpreter::mark):
3294 (KJS::Interpreter::interpreterWithGlobalObject):
3295 (KJS::Interpreter::saveBuiltins):
3296 (KJS::Interpreter::restoreBuiltins):
3297 * kjs/interpreter.h:
3298 (KJS::Interpreter::setCompatMode):
3299 (KJS::Interpreter::compatMode):
3300 (KJS::Interpreter::firstInterpreter):
3301 (KJS::Interpreter::nextInterpreter):
3302 (KJS::Interpreter::prevInterpreter):
3303 (KJS::Interpreter::debugger):
3304 (KJS::Interpreter::setDebugger):
3305 (KJS::Interpreter::setContext):
3306 (KJS::Interpreter::context):
3308 (StatementNode::hitStatement):
3309 (RegExpNode::evaluate):
3312 2006-06-12 Geoffrey Garen <ggaren@apple.com>
3316 - Have *.lut.h files #include lookup.h to eliminate surprising header
3317 include order dependency.
3319 * DerivedSources.make:
3320 * kjs/array_object.cpp:
3321 * kjs/date_object.cpp:
3322 * kjs/date_object.h:
3323 (KJS::DateProtoFunc::):
3325 * kjs/math_object.cpp:
3326 * kjs/number_object.cpp:
3327 * kjs/regexp_object.cpp:
3328 * kjs/string_object.cpp:
3330 2006-06-10 Geoffrey Garen <ggaren@apple.com>
3332 - http://bugzilla.opendarwin.org/show_bug.cgi?id=8515
3333 Linux porting compile bug
3335 Fix by Mike Emmel, Reviewed by Darin.
3337 * JavaScriptCoreSources.bkl:
3341 2006-06-09 Geoffrey Garen <ggaren@apple.com>
3343 Build fix -- I think :).
3345 * JavaScriptCore.xcodeproj/project.pbxproj:
3348 2006-06-09 Geoffrey Garen <ggaren@apple.com>
3350 Reviewed by Eric (yay!).
3352 - Removed Context wrapper for ContextImp, renamed ContextImp to Context,
3353 split Context into its own file -- Context.cpp -- renamed _var to m_var,
3354 change ' *' to '* '.
3356 * JavaScriptCore.xcodeproj/project.pbxproj:
3357 * kjs/Context.cpp: Added.
3358 (KJS::Context::Context):
3359 (KJS::Context::~Context):
3360 (KJS::Context::mark):
3362 (KJS::Context::scopeChain):
3363 (KJS::Context::variableObject):
3364 (KJS::Context::setVariableObject):
3365 (KJS::Context::thisValue):
3366 (KJS::Context::callingContext):
3367 (KJS::Context::activationObject):
3368 (KJS::Context::currentBody):
3369 (KJS::Context::function):
3370 (KJS::Context::arguments):
3371 (KJS::Context::pushScope):
3372 (KJS::Context::seenLabels):
3374 (KJS::FunctionImp::callAsFunction):
3375 (KJS::FunctionImp::processParameters):
3376 (KJS::FunctionImp::argumentsGetter):
3377 (KJS::GlobalFuncImp::callAsFunction):
3379 (KJS::InterpreterImp::evaluate):
3381 (KJS::InterpreterImp::setContext):
3382 (KJS::InterpreterImp::context):
3383 * kjs/interpreter.cpp:
3384 * kjs/interpreter.h:
3385 (KJS::ExecState::context):
3386 (KJS::ExecState::ExecState):
3390 (ThisNode::evaluate):
3391 (ResolveNode::evaluate):
3392 (FunctionCallResolveNode::evaluate):
3393 (PostfixResolveNode::evaluate):
3394 (DeleteResolveNode::evaluate):
3395 (TypeOfResolveNode::evaluate):
3396 (PrefixResolveNode::evaluate):
3397 (AssignResolveNode::evaluate):
3398 (VarDeclNode::evaluate):
3399 (VarDeclNode::processVarDecls):
3400 (DoWhileNode::execute):
3401 (WhileNode::execute):
3403 (ForInNode::execute):
3404 (ContinueNode::execute):
3405 (BreakNode::execute):
3406 (ReturnNode::execute):
3407 (WithNode::execute):
3408 (SwitchNode::execute):
3409 (LabelNode::execute):
3411 (FuncDeclNode::processFuncDecl):
3412 (FuncExprNode::evaluate):
3414 2006-06-07 Geoffrey Garen <ggaren@apple.com>
3416 Removed API directory I prematurely/accidentally added.
3420 2006-06-05 Mitz Pettel <opendarwin.org@mitzpettel.com>
3422 Reviewed and landed by Geoff.
3424 - fix a regression in ecma_3/String/regress-104375.js
3426 * kjs/string_object.cpp:
3427 (substituteBackreferences): If a 2-digit back reference is out of range,
3428 parse it as a 1-digit reference (followed by the other digit). This matches
3431 2006-06-05 Geoffrey Garen <ggaren@apple.com>
3434 Darin already reviewed this change on the branch. See <rdar://problem/4317701>.
3436 - Fixed <rdar://problem/4291345> PCRE overflow in Safari JavaScriptCore
3438 No test case because there's no behavior change.
3440 * pcre/pcre_compile.c:
3441 (read_repeat_counts): Check for integer overflow / out of bounds
3443 2006-06-05 Geoffrey Garen <ggaren@apple.com>
3447 - Changed CString length from int to size_t. We sould probably do this
3448 for UString, too. (Darin, if you're reading this: Maciej said so.)
3453 (KJS::CString::CString):
3456 (KJS::CString::size):
3458 2006-06-04 Geoffrey Garen <ggaren@apple.com>
3462 - http://bugzilla.opendarwin.org/show_bug.cgi?id=9304
3463 Minor cleanup in JavaScriptCore
3465 * kjs/value.h: Removed redundant declarations
3467 2006-06-04 Darin Adler <darin@apple.com>
3471 - changed deleteAllValues so it can work on "const" collections
3472 Deleting the values affects the values, not the pointers in the
3473 collection, so it's legitimate to do it to a const collection,
3474 and a case of that actually came up in the XPath code.
3477 (WTF::deleteAllPairSeconds): Use const iterators.
3478 (WTF::deleteAllValues): Take const HashMap reference as a parameter.
3480 (WTF::deleteAllValues): Take const HashSet reference as a parameter,
3481 and use const iterators.
3483 (WTF::deleteAllValues): Take const Vector reference as a parameter.
3485 - added more functions that are present in <math.h> on some platforms,
3486 but not on others; moved here from various files in WebCore
3497 2006-06-02 Mitz Pettel <opendarwin.org@mitzpettel.com>
3501 - http://bugzilla.opendarwin.org/show_bug.cgi?id=9234
3502 Implement $&, $' and $` replacement codes in String.prototype.replace
3504 Test: fast/js/string-replace-3.html
3506 * kjs/string_object.cpp:
3507 (substituteBackreferences): Added support for $& (matched substring),
3508 $` (everything preceding matched substring), $' (everything following
3509 matched substring) and 2-digit back references, and cleaned up a little.
3511 2006-06-02 Adele Peterson <adele@apple.com>
3515 Set incremental linking to no. This seems to fix a build problem I was seeing
3516 where dftables couldn't find a dll.
3518 * JavaScriptCore.vcproj/dftables/dftables.vcproj:
3520 2006-05-26 Steve Falkenburg <sfalken@apple.com>
3524 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3526 === JavaScriptCore-521.11 ===
3528 2006-05-24 Geoffrey Garen <ggaren@apple.com>
3532 - JSC half of fix for <rdar://problem/4557926> TOT REGRESSSION: Crash
3533 occurs when attempting to view image in slideshow mode at
3534 http://d.smugmug.com/gallery/581716 ( KJS::IfNode::execute
3535 (KJS::ExecState*) + 312)
3537 On alternate threads, DOMObjects remain in the
3538 ScriptInterpreter's cache because they're not collected. So, they
3539 need an opportunity to mark their children.
3541 I'm not particularly happy with this solution because it fails to
3542 resolve many outstanding issues with the DOM object cache. Since none
3543 of those issues is a crasher or a serious compatibility concern,
3544 and since the behavior of other browsers is not much to go on in this
3545 case, I've filed <rdar://problem/4561439> about that, and I'm moving on
3548 * JavaScriptCore.xcodeproj/project.pbxproj:
3549 * kjs/collector.cpp:
3550 (KJS::Collector::collect):
3552 (KJS::InterpreterImp::mark):
3554 * kjs/interpreter.cpp:
3555 (KJS::Interpreter::mark):
3556 * kjs/interpreter.h:
3558 === JavaScriptCore-521.10 ===
3560 2006-05-22 Timothy Hatcher <timothy@apple.com>
3562 Reviewed by Eric, Kevin and Geoff.
3564 Merge open source build fixes. <rdar://problem/4555500>
3566 * kjs/collector.cpp: look at the rsp register in x86_64
3567 (KJS::Collector::markOtherThreadConservatively):
3568 * wtf/Platform.h: add x86_64 to the platform list
3570 2006-05-19 Anders Carlsson <acarlsson@apple.com>
3574 http://bugzilla.opendarwin.org/show_bug.cgi?id=8993
3575 Support function declaration in case statements
3577 * kjs/grammar.y: Get rid of StatementList and use SourceElements instead.
3580 (CaseClauseNode::evalStatements):
3581 (CaseClauseNode::processVarDecls):
3582 (CaseClauseNode::processFuncDecl):
3583 (ClauseListNode::processFuncDecl):
3584 (CaseBlockNode::processFuncDecl):
3585 (SwitchNode::processFuncDecl):
3587 (KJS::CaseClauseNode::CaseClauseNode):
3588 (KJS::ClauseListNode::ClauseListNode):
3589 (KJS::ClauseListNode::getClause):
3590 (KJS::ClauseListNode::getNext):
3591 (KJS::ClauseListNode::releaseNext):
3592 (KJS::SwitchNode::SwitchNode):
3593 Add processFuncDecl for the relevant nodes.
3595 * kjs/nodes2string.cpp:
3596 (CaseClauseNode::streamTo):
3597 next got renamed to source.
3599 2006-05-17 George Staikos <staikos@kde.org>
3601 Reviewed by Maciej, Alexey, and Eric.
3603 * pcre/pcre_compile.c:
3606 * wtf/UnusedParam.h:
3607 Use /**/ in .c files to compile with non-C99 and non-GCC compilers.
3610 Change include to <wtf/HashTraits.h> from "HashTraits.h" to avoid -I
3612 * wtf/unicode/qt4/UnicodeQt4.h:
3613 Use correct parentheses and correct mask for utf-32 support.
3615 2006-05-17 Alexey Proskuryakov <ap@nypop.com>
3619 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8870
3620 Crash typing in Yahoo auto-complete widget.
3622 Test: fast/js/regexp-stack-overflow.html
3624 * pcre/pcre-config.h: Define NO_RECURSE.
3626 2006-05-16 George Staikos <staikos@kde.org>
3630 Fix some warnings and strict compilation errors.
3635 2006-05-15 Alexey Proskuryakov <ap@nypop.com>
3637 * make-generated-sources.sh: Changed to be executable and removed
3638 text in the file generated by "svn diff".
3640 2006-05-15 Geoffrey Garen <ggaren@apple.com>
3644 - Fixed <rdar://problem/4534904> please do not treat "debugger" as
3645 a reserved word while parsing JavaScript (and other ECMA reserved
3650 http://bugzilla.opendarwin.org/show_bug.cgi?id=6179
3651 We treat "char" as a reserved word in JavaScript and firefox/IE do
3654 (1) I unreserved most of the spec's "future reserved words" because
3655 they're not reserved in IE or FF. (Most, but not all, because IE
3656 somewhat randomly *does* reserve a few of them.)
3657 (2) I made 'debugger' a legitimate statement that acts like an empty
3658 statement because FF and IE support it.
3661 * kjs/keywords.table:
3663 2006-05-15 Tim Omernick <timo@apple.com>
3665 Reviewed by John Sullivan.
3667 Part of <rdar://problem/4466508> Add 64-bit support to the Netscape Plugin API
3669 Added to the Netscape Plugin API the concept of "plugin drawing models". The drawing model
3670 determines the kind of graphics context created by the browser for the plugin, as well as
3671 the Mac types of various Netscape Plugin API data structures.
3673 There is a drawing model to represent the old QuickDraw-based API. It is used by default
3674 if QuickDraw is available on the system, unless the plugin specifies another drawing model.
3676 The big change is the addition of the CoreGraphics drawing model. A plugin may request this
3677 drawing model to obtain access to a CGContextRef for drawing, instead of a QuickDraw CGrafPtr.
3680 Define NP_NO_QUICKDRAW when compiling 64-bit; there is no 64-bit QuickDraw.
3681 Added NPNVpluginDrawingModel, NPNVsupportsQuickDrawBool, and NPNVsupportsCoreGraphicsBool
3683 Added NPDrawingModel enumeration. Currently the only drawing models are QuickDraw and
3685 NPRegion's type now depends on the drawing model specified by the plugin.
3686 NP_Port is now only defined when QuickDraw is available.
3687 Added NP_CGContext, which is the type of the NPWindow's "window" member in CoreGraphics mode.
3689 2006-05-13 Kevin M. Ollivier <kevino@theolliviers.com>
3691 Reviewed by Darin, landed by ap.
3693 - http://bugzilla.opendarwin.org/show_bug.cgi?id=8528
3694 Bakefiles (and generated Makefiles) for wx and gdk ports
3696 * make-generated-sources.sh:
3697 Added script to configure environment to run DerivedSources.make
3699 * JavaScriptCoreSources.bkl:
3700 Added JavaScriptCore sources list for Bakefile.
3703 Bakefile used to generate JavaScriptCore project files
3704 (currently only used by wx and gdk ports)
3706 2006-05-09 Steve Falkenburg <sfalken@apple.com>
3709 Minor fixes to WTF headers.
3713 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Fix include dirs, paths to files.
3714 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj: Fix include dirs.
3715 * wtf/Assertions.h: include Platform.h to get definition for COMPILER()
3716 * wtf/Vector.h: include FastMalloc.h for definition of fastMalloc, fastFree
3718 2006-05-09 Maciej Stachowiak <mjs@apple.com>
3720 Rubber stamped by Anders.
3722 - renamed kxmlcore to wtf
3728 * JavaScriptCore.xcodeproj/project.pbxproj:
3729 * bindings/c/c_instance.cpp:
3730 * bindings/objc/WebScriptObject.mm:
3731 * kjs/JSImmediate.h:
3734 * kjs/array_object.cpp:
3735 * kjs/collector.cpp:
3736 (KJS::Collector::registerThread):
3740 (KJS::isStrWhiteSpace):
3742 * kjs/identifier.cpp:
3747 (Lexer::isWhiteSpace):
3748 (Lexer::isIdentStart):
3749 (Lexer::isIdentPart):
3753 * kjs/number_object.cpp:
3755 * kjs/property_map.cpp:
3756 * kjs/property_map.h:
3757 * kjs/string_object.cpp:
3758 (StringProtoFunc::callAsFunction):
3763 * kxmlcore: Removed.
3764 * kxmlcore/AlwaysInline.h: Removed.
3765 * kxmlcore/Assertions.cpp: Removed.
3766 * kxmlcore/Assertions.h: Removed.
3767 * kxmlcore/FastMalloc.cpp: Removed.
3768 * kxmlcore/FastMalloc.h: Removed.
3769 * kxmlcore/FastMallocInternal.h: Removed.
3770 * kxmlcore/Forward.h: Removed.
3771 * kxmlcore/HashCountedSet.h: Removed.
3772 * kxmlcore/HashFunctions.h: Removed.
3773 * kxmlcore/HashMap.h: Removed.
3774 * kxmlcore/HashSet.h: Removed.
3775 * kxmlcore/HashTable.cpp: Removed.
3776 * kxmlcore/HashTable.h: Removed.
3777 * kxmlcore/HashTraits.h: Removed.
3778 * kxmlcore/ListRefPtr.h: Removed.
3779 * kxmlcore/Noncopyable.h: Removed.
3780 * kxmlcore/OwnArrayPtr.h: Removed.
3781 * kxmlcore/OwnPtr.h: Removed.
3782 * kxmlcore/PassRefPtr.h: Removed.
3783 * kxmlcore/Platform.h: Removed.
3784 * kxmlcore/RefPtr.h: Removed.
3785 * kxmlcore/TCPageMap.h: Removed.
3786 * kxmlcore/TCSpinLock.h: Removed.
3787 * kxmlcore/TCSystemAlloc.cpp: Removed.
3788 * kxmlcore/TCSystemAlloc.h: Removed.
3789 * kxmlcore/UnusedParam.h: Removed.
3790 * kxmlcore/Vector.h: Removed.
3791 * kxmlcore/VectorTraits.h: Removed.
3792 * kxmlcore/unicode: Removed.
3793 * kxmlcore/unicode/Unicode.h: Removed.
3794 * kxmlcore/unicode/UnicodeCategory.h: Removed.
3795 * kxmlcore/unicode/icu: Removed.
3796 * kxmlcore/unicode/icu/UnicodeIcu.h: Removed.
3797 * kxmlcore/unicode/posix: Removed.
3798 * kxmlcore/unicode/qt3: Removed.
3799 * kxmlcore/unicode/qt4: Removed.
3800 * kxmlcore/unicode/qt4/UnicodeQt4.h: Removed.
3803 * wtf/Assertions.cpp:
3805 * wtf/FastMalloc.cpp:
3806 (WTF::TCMalloc_ThreadCache::Scavenge):
3809 (WTF::TCMallocGuard::TCMallocGuard):
3816 * wtf/FastMallocInternal.h:
3818 * wtf/HashCountedSet.h:
3819 * wtf/HashFunctions.h:
3822 * wtf/HashTable.cpp:
3826 * wtf/Noncopyable.h:
3827 * wtf/OwnArrayPtr.h:
3831 * wtf/TCSystemAlloc.cpp:
3832 (TCMalloc_SystemAlloc):
3834 * wtf/VectorTraits.h:
3835 * wtf/unicode/UnicodeCategory.h:
3836 * wtf/unicode/icu/UnicodeIcu.h:
3838 2006-05-08 Timothy Hatcher <timothy@apple.com>
3842 * bindings/npapi.h: do not define #pragma options align=mac68k if we are 64-bit
3844 2006-05-07 Darin Adler <darin@apple.com>
3846 Reviewed and landed by Maciej.
3848 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8765
3849 Random crashes on TOT since the form state change
3851 I haven't figured out how to construct a test for this, but this does seem to fix the
3852 problem; Mitz mentioned that a double-destroy was occurring in these functions.
3854 * kxmlcore/HashMap.h: (KXMLCore::HashMap::remove): Use RefCounter::deref instead of calling
3855 ~ValueType, because ~ValueType often results in a double-destroy, since the HashTable also
3856 destroys the element based on the storage type. The RefCounter template correctly does work
3857 only in cases where ValueType and ValueStorageType differ and this class is what's used
3858 elsewhere for the same purpose; I somehow missed this case when optimizing HashMap.
3859 * kxmlcore/HashSet.h: (KXMLCore::HashSet::remove): Ditto.
3861 2006-05-05 Darin Adler <darin@apple.com>
3863 - http://bugzilla.opendarwin.org/show_bug.cgi?id=8722
3864 IE compatibility fix in date parsing
3866 * kjs/date_object.cpp: (KJS::parseDate): Merged change that George Staikos provided
3867 from KDE 3.4.3 branch that allows day values of 0 and values that are > 1000.
3869 2006-05-04 Anders Carlsson <andersca@mac.com>
3873 http://bugzilla.opendarwin.org/show_bug.cgi?id=8734
3874 Would like a Vector::append that takes another Vector
3876 * kxmlcore/Vector.h:
3877 (KXMLCore::::append):
3878 New function that takes another array.
3880 2006-05-02 Steve Falkenburg <sfalken@apple.com>
3884 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: set NDEBUG for release build
3885 * kxmlcore/FastMalloc.cpp: Prevent USE_SYSTEM_MALLOC from being defined twice
3887 2006-05-02 Anders Carlsson <andersca@mac.com>
3891 * kxmlcore/HashMap.h:
3892 (KXMLCore::::operator):
3895 2006-05-01 Tim Omernick <timo@apple.com>
3897 Reviewed by Tim Hatcher.
3899 <rdar://problem/4476875> Support printing for embedded Netscape plugins
3902 Fixed struct alignment problem in our npapi.h. Structs must be 68k-aligned on both pre-Mac OS X
3903 and Mac OS X systems, as this is what plugins expect.
3905 2006-05-01 Timothy Hatcher <timothy@apple.com>
3909 <rdar://problem/4308243> 8F36 Regression: crash in malloc_consolidate if you use a .PAC file
3911 The original fix missed the oversized cell case. Added a test for "currentThreadIsMainThread ||
3912 imp->m_destructorIsThreadSafe" where we collect oversized cells.
3914 We don't have a way to test PAC files yet, so there's no test attached.
3916 * kjs/collector.cpp:
3917 (KJS::Collector::collect): test the thread when we collect oversized cells
3919 2006-05-01 Tim Omernick <timo@apple.com>
3923 <rdar://problem/4526114> REGRESSION (two days ago): LOG() just prints @ for NSObject substitutions
3925 * kxmlcore/Assertions.cpp:
3926 Changed sense of strstr("%@") check. I already made the same fix to the WebBrowser assertions.
3928 2006-04-28 Steve Falkenburg <sfalken@apple.com>
3932 Actually apply the change that was reviewed insted of checking it in with an #if 0 (oops).
3935 (main): Suppress C runtime alerts
3937 2006-04-28 Steve Falkenburg <sfalken@apple.com>
3941 Suppress error reporting dialog that blocks Javascript tests from completing.
3943 Real error is due to an overflow in the date/time handling functions that needs
3944 to be addressed, but this will prevent the hang running the Javascript tests
3945 on the build bot (along with the related changes).
3948 (main): Suppress C runtime alerts
3950 2006-04-27 Geoffrey Garen <ggaren@apple.com>
3954 - Minor fixups I discovered while working on the autogenerator.
3957 (findEntry): ASSERT that size is not 0, because otherwise we'll % by 0,
3958 compute a garbage address, and possibly crash.
3960 (cacheGlobalObject): Don't enumerate cached objects -- ideally, they
3961 would be hidden entirely.
3963 2006-04-21 Kevin M. Ollivier <kevino@theolliviers.com>
3967 - http://bugzilla.opendarwin.org/show_bug.cgi?id=8507
3968 Compilation fixes for building on gcc 4.0.2, and without precomp headers
3971 * kxmlcore/Assertions.cpp:
3972 * kxmlcore/FastMalloc.cpp:
3973 Added necessary headers to resolve compilation issues when not using
3974 precompiled headers.
3976 * kjs/value.h: Declare the JSCell class before friend declaration
3977 to resolve compilation issues with gcc 4.0.2.
3979 * kxmlcore/Platform.h: Set Unicode support to use ICU on platforms
3980 other than KDE (previously only defined for Win and Mac OS)
3982 2006-04-18 Eric Seidel <eseidel@apple.com>
3986 Fix "new Function()" to correctly use lexical scoping.
3987 Add ScopeChain::print() function for debugging.
3988 <rdar://problem/4067864> REGRESSION (125-407): JavaScript failure on PeopleSoft REN Server
3990 * kjs/function_object.cpp:
3991 (FunctionObjectImp::construct):
3992 * kjs/scope_chain.cpp:
3993 (KJS::ScopeChain::print):
3994 * kjs/scope_chain.h:
3996 2006-04-14 James G. Speth <speth@end.com>
3998 Reviewed by Timothy.
4000 Bug 8389: support for Cocoa bindings - binding an NSTreeController to the WebView's DOM
4001 http://bugzilla.opendarwin.org/show_bug.cgi?id=8389
4003 Adds a category to WebScriptObject with array accessors for KVC/KVO.
4005 If super valueForKey: fails it will call valueForUndefinedKey:, which is
4006 important because it causes the right behavior to happen with bindings using
4007 the "Raises for Not Applicable Keys" flag and the "Not Applicable Placeholder"
4009 * bindings/objc/WebScriptObject.mm:
4010 (-[WebScriptObject valueForKey:]):
4011 (-[WebScriptObject count]):
4012 (-[WebScriptObject objectAtIndex:]):
4013 (-[WebUndefined description]): return "undefined"
4015 2006-04-13 Geoffrey Garen <ggaren@apple.com>
4020 (KJS::InterpreterImp::initGlobalObject): Add the built-in object
4021 prototype to the end of the global object's prototype chain instead of
4022 just blowing away its existing prototype. We need to do this because
4023 the window object has a meaningful prototype now.
4025 2006-04-13 Maciej Stachowiak <mjs@apple.com>
4029 - fix testkjs to not show false-positive KJS::Node leaks in debug builds
4035 2006-04-11 Geoffrey Garen <ggaren@apple.com>
4039 Minor code cleanup -- passes all the JS tests.
4041 * kjs/object_object.cpp:
4042 (ObjectObjectImp::construct):
4043 (ObjectObjectImp::callAsFunction):
4045 2006-04-11 Darin Adler <darin@apple.com>
4047 - another attempt to fix Windows build -- Vector in Forward.h was not working
4049 * kxmlcore/Forward.h: Remove Vector.
4050 * kxmlcore/Vector.h: Add back default arguments, remove include of
4053 2006-04-11 Darin Adler <darin@apple.com>
4055 - try to fix Windows build -- HashForward.h was not working
4057 * kxmlcore/HashForward.h: Removed.
4059 * JavaScriptCore.xcodeproj/project.pbxproj: Remove HashForward.h.
4060 * kjs/collector.h: Remove use of HashForward.h.
4061 * kxmlcore/HashCountedSet.h: Remove include of HashForward.h, restore
4063 * kxmlcore/HashMap.h: Ditto.
4064 * kxmlcore/HashSet.h: Ditto.
4066 2006-04-11 David Harrison <harrison@apple.com>
4070 - fixed clean build, broken by Darin's check-in
4072 * kjs/date_object.cpp: Add needed include of lookup.h.
4073 * kjs/regexp_object.cpp: Move include of .lut.h file below other includes.
4075 2006-04-10 Darin Adler <darin@apple.com>
4077 Rubber-stamped by John Sullivan.
4079 - switched from a shell script to a makefile for generated files
4080 - removed lots of unneeded includes
4081 - added new Forward.h and HashForward.h headers that allow compiling with
4082 fewer unneeded templates
4084 * DerivedSources.make: Added.
4085 * generate-derived-sources: Removed.
4086 * JavaScriptCore.xcodeproj/project.pbxproj: Added new files, changed to use
4087 DerivedSources.make.
4089 * kxmlcore/Forward.h: Added.
4090 * kxmlcore/HashForward.h: Added.
4092 * kxmlcore/HashCountedSet.h: Include HashForward for default args.
4093 * kxmlcore/HashMap.h: Ditto.
4094 * kxmlcore/HashSet.h: Ditto.
4098 Moved KJS_MAX_STACK into the .cpp file.
4100 * bindings/NP_jsobject.cpp:
4101 * bindings/c/c_instance.h:
4102 * bindings/jni/jni_class.h:
4103 * bindings/jni/jni_runtime.h:
4104 * bindings/jni/jni_utility.h:
4105 * bindings/objc/WebScriptObject.mm:
4106 * bindings/objc/WebScriptObjectPrivate.h:
4107 * bindings/objc/objc_class.h:
4108 * bindings/objc/objc_class.mm:
4109 * bindings/objc/objc_instance.h:
4110 * bindings/objc/objc_instance.mm:
4111 * bindings/objc/objc_runtime.mm:
4112 * bindings/objc/objc_utility.mm:
4113 * bindings/runtime.h:
4114 * bindings/runtime_array.cpp:
4115 * bindings/runtime_array.h:
4116 * bindings/runtime_method.cpp:
4117 * bindings/runtime_method.h:
4118 * bindings/runtime_object.cpp:
4119 * bindings/runtime_root.h:
4120 * kjs/JSImmediate.cpp:
4122 * kjs/array_object.cpp:
4123 * kjs/array_object.h:
4124 * kjs/bool_object.cpp:
4125 * kjs/bool_object.h:
4129 * kjs/error_object.h:
4130 * kjs/function_object.h:
4133 * kjs/math_object.cpp:
4134 * kjs/math_object.h:
4137 * kjs/number_object.cpp:
4138 * kjs/number_object.h:
4139 * kjs/object_object.cpp:
4140 * kjs/operations.cpp:
4141 * kjs/protected_reference.h:
4143 * kjs/reference_list.h:
4144 * kjs/regexp_object.h:
4145 * kjs/string_object.cpp:
4146 * kjs/string_object.h:
4150 * kxmlcore/HashTable.h:
4151 * kxmlcore/ListRefPtr.h:
4152 * kxmlcore/TCPageMap.h:
4153 * kxmlcore/Vector.h:
4154 Removed unneeded header includes.
4156 2006-04-09 Geoffrey Garen <ggaren@apple.com>
4160 - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=8284
4161 prevent unnecessary entries in the "nodes with extra refs" hash table
4163 This patch switches manually RefPtr exchange with use of
4164 RefPtr::release to ensure that a node's ref count never tops 1
4165 (in the normal case).
4168 (BlockNode::BlockNode):
4169 (CaseBlockNode::CaseBlockNode):
4171 (KJS::ArrayNode::ArrayNode):
4172 (KJS::ObjectLiteralNode::ObjectLiteralNode):
4173 (KJS::ArgumentsNode::ArgumentsNode):
4174 (KJS::VarStatementNode::VarStatementNode):
4175 (KJS::ForNode::ForNode):
4176 (KJS::CaseClauseNode::CaseClauseNode):
4177 (KJS::FuncExprNode::FuncExprNode):
4178 (KJS::FuncDeclNode::FuncDeclNode):
4180 2006-04-08 Alexey Proskuryakov <ap@nypop.com>
4184 One more attempt - use reinterpret_cast, rather than static_cast.
4186 2006-04-08 Alexey Proskuryakov <ap@nypop.com>
4190 An attempt to fix Win32 build - ICU uses wchar_t on Windows, so we need a type cast.
4192 * kxmlcore/unicode/icu/UnicodeIcu.h:
4193 (KXMLCore::Unicode::toLower):
4194 (KXMLCore::Unicode::toUpper):