1 2006-10-23 Kevin McCullough <KMcCullough@apple.com>
7 * JavaScriptCore.xcodeproj/project.pbxproj:
10 2006-10-23 Kevin McCullough <KMcCullough@apple.com>
14 - Makes the toTM function an operator. Was going to piggy back on a patch but the patch needs more work.
17 (KJS::equivalentYearForDST):
19 (KJS::GregorianDateTime::operator tm):
20 * kjs/date_object.cpp:
22 (KJS::DateProtoFunc::callAsFunction):
24 2006-10-23 Kevin McCullough <KMcCullough@apple.com>
28 - Fixes two regressions on win. Both are stack overflows. For one the number of recursions is capped at 100, and for the other, nested parenthesis pairs are not evaluated (since they would evaluate to whatever is in them anyway).
33 2006-10-21 Steve Falkenburg <sfalken@apple.com>
37 Add minimal compatibility with MSVCRT leak checker
41 2006-10-23 Kevin McCullough <KMcCullough@apple.com>
45 - Sets the lowercase range correctly in the test and consolidates a variable to make the test more readable.
47 * tests/mozilla/ecma/String/15.5.4.11-2.js:
49 2006-10-21 Darin Adler <darin@apple.com>
53 - http://bugs.webkit.org/show_bug.cgi?id=11377
54 swap(Vector, Vector) should be O(1) instead of O(n)
57 (WTF::VectorBuffer::swap): Added.
58 (WTF::Vector::swap): Added.
59 (WTF::swap): Added overload that takes two Vector objects.
61 2006-10-21 Darin Adler <darin@apple.com>
65 - http://bugs.webkit.org/show_bug.cgi?id=11376
66 build scripts should invoke make with "-j" option for multiple processors
68 * JavaScriptCore.xcodeproj/project.pbxproj: Pass -j `sysctl -n hw.ncpu` to make.
70 2006-10-19 Kevin McCullough <KMcCullough@apple.com>
74 Changed test to make us pass Georgian case changing for Unicode 4.0 and 5.0. This incorporates changes from the 1.4 revision of the same mozilla test.
75 On Tiger we are still using Unicode 4.0 but on win and Leopard we are using Unicode 5.0, so this test currently allows for either answer.
77 * tests/mozilla/ecma/String/15.5.4.11-2.js:
79 2006-10-18 Maciej Stachowiak <mjs@apple.com>
83 - remove vestiges of KXMLCore name (former name of WTF).
91 * wtf/FastMallocInternal.h:
94 * wtf/HashCountedSet.h:
95 * wtf/HashFunctions.h:
108 * wtf/StringExtras.h:
112 * wtf/VectorTraits.h:
114 2006-10-17 Steve Falkenburg <sfalken@apple.com>
120 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
122 2006-10-17 Kevin McCullough <KMcCullough@apple.com>
126 Fixed a date issue where the UTC offset was not set in win.
129 (KJS::getDSTOffsetSimple):
131 (KJS::msToGregorianDateTime):
134 (KJS::GregorianDateTime::GregorianDateTime):
136 2006-10-17 Kevin McCullough <KMcCullough@apple.com>
140 Fixes a JavaScriptCore math issue on win.
142 * kjs/math_object.cpp:
143 (MathFuncImp::callAsFunction):
147 2006-10-16 Kevin McCullough <kmccullough@apple.com>
151 Removed unecessary global specifiers.
153 * kjs/math_object.cpp:
154 (MathFuncImp::callAsFunction):
156 2006-10-16 Kevin McCullough <KMcCullough@apple.com>
160 Fixes a compile order issue for testkjs on win.
162 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
164 2006-10-15 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
168 Remove junk (as gcc calls it) after #else clause.
170 * wtf/FastMalloc.cpp:
173 2006-10-14 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
177 Define KXMLCORE_USE_CURL for platforms that wish to use CURL as
178 networking, and set it for GDK build
182 2006-10-13 Marvin Decker <marv.decker@gmail.com>
184 Reviewed by Kevin McCullough.
186 Fixes http://bugs.webkit.org/show_bug.cgi?id=11283
187 Fixes Qt/Linux and Windows build
191 * kjs/date_object.cpp:
192 (KJS::DateProtoFunc::callAsFunction):
194 2006-10-13 Kevin McCullough <KMcCullough@apple.com>
196 Reviewed by Adam, Geoff, Darin.
198 Fixed displaying the UTC offset and time zone string, as well as renamed the GregorianDateTime structure and clean up.
203 (KJS::getDSTOffsetSimple):
204 (KJS::gregorianDateTimeToMS):
205 (KJS::msToGregorianDateTime):
207 (KJS::GregorianDateTime::GregorianDateTime):
208 (KJS::GregorianDateTime::~GregorianDateTime):
209 (KJS::GregorianDateTime::toTM):
210 * kjs/date_object.cpp:
213 (KJS::formatDateUTCVariant):
215 (KJS::fillStructuresUsingTimeArgs):
216 (KJS::fillStructuresUsingDateArgs):
217 (KJS::DateInstance::getTime):
218 (KJS::DateInstance::getUTCTime):
219 (KJS::DateProtoFunc::callAsFunction):
220 (KJS::DateObjectImp::construct):
221 (KJS::DateObjectImp::callAsFunction):
222 (KJS::DateObjectFuncImp::callAsFunction):
226 2006-10-13 Kevin McCullough <KMcCullough@apple.com>
230 Gets JavaScripCore tests running on windows.
232 * Scripts/run-javascriptcore-tests:
233 * Scripts/webkitdirs.pm:
235 2006-10-12 Geoffrey Garen <ggaren@apple.com>
239 Removed JSObjectMakeWithPrototype, clarified some comments. We really
240 don't want people to manage their own prototypes, so we don't want an
241 extra function in the API devoted to just that. People can still manage
242 their own prototypes if they really want by using JSObjectSetPrototype.
244 * API/JSClassRef.cpp:
245 (OpaqueJSClass::createNoAutomaticPrototype):
246 (OpaqueJSClass::create):
248 * API/JSObjectRef.cpp:
254 * JavaScriptCore.exp:
256 2006-10-12 Kevin McCullough <KMcCullough@apple.com>
264 * kjs/date_object.cpp:
267 2006-10-11 Kevin McCullough <KMcCullough@apple.com>
271 Added our own tm struct to have a consistent set of fields, which lets us display the DST offset and timezone strings correctly. Also there is some code cleanup.
276 (KJS::getDSTOffsetSimple):
282 * kjs/date_object.cpp:
285 (KJS::DateProtoFunc::callAsFunction):
286 (KJS::DateObjectImp::construct):
287 (KJS::DateObjectImp::callAsFunction):
288 (KJS::DateObjectFuncImp::callAsFunction):
292 2006-10-09 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
296 Improve gdk build compiler flags (show warning, no rtti and exceptions).
300 2006-10-06 Kevin McCullough <KMcCullough@apple.com>
304 DST and TimeZones were wrong in some cases, specifically on some of the dates where DST changes.
307 (KJS::equivalentYearForDST):
309 (KJS::getDSTOffsetSimple):
311 (KJS::dateToMseconds):
314 * kjs/date_object.cpp:
317 2006-10-05 Darin Adler <darin@apple.com>
319 Reviewed by Kevin McCullough.
321 * wtf/Assertions.cpp: Fix build when _DEBUG is not defined.
323 2006-10-04 Kevin McCullough <KMcCullough@apple.com>
327 - Removed an unnecessary assert that was stopping many pages. tm_gmtoff was not set for UTC time in mozilla but is always set for us.
332 * kjs/date_object.cpp:
336 2006-10-04 Geoffrey Garen <ggaren@apple.com>
338 Patch by Darin and me, reviewed by Maciej.
340 Fixed <rdar://problem/4518397> REGRESSION(?): Oft-seen but unrepro crash
341 in JavaScript garbage collection (KJS::Collector::collect())
342 <rdar://problem/4752492> Crash in KJS::collect
344 The issue here was allocating one garbage-collected object in the midst
345 of allocating a second garbage-collected object. In such a case, the
346 zeroIfFree word lies.
349 (KJS::Collector::allocate):
350 (KJS::Collector::collect):
352 2006-10-04 Kevin McCullough <KMcCullough@apple.com>
359 (KJS::dateToDayInYear): accept and correctly handle negative months
361 2006-10-05 Kevin McCullough <KMcCullough@apple.com>
366 (KJS::dateToDayInYear):
368 2006-10-05 Mark Rowe <bdash@webkit.org>
370 Reviewed by maculloch.
374 * JavaScriptCoreSources.bkl: Add DateMath.cpp to file list.
376 2006-10-05 Kevin McCullough <KMcCullough@apple.com>
382 * JavaScriptCore.xcodeproj/project.pbxproj:
384 2006-10-04 Nikolas Zimmermann <zimmermann@kde.org>
388 Fix Qt/Linux build by adding DateMath.cpp to compilation.
390 * CMakeLists.txt: Also replace tabs with spaces.
392 2006-10-04 Kevin McCullough <KMcCullough@apple.com>
394 Reviewed by DethBakin.
396 - Apparently the build bot uses an older version of XCode which warns about conversions and the newest version does not. I hope this fixes the build but I cann't be sure on my system.
401 (KJS::dateToDayInYear):
403 2006-10-05 Darin Adler <darin@apple.com>
407 * wtf/Assertions.cpp: Changed assertion formatting to omit the "======"
408 lines so you can see more assertions in less space. Also improved format
409 of file/line information so it works with more development environments.
411 2006-10-04 Kevin McCullough <KMcCullough@apple.com>
415 - The build machine is more sensitive about automatic conversions. These fixes exp
416 licitly cast or change the input and return types of functions to avoid conversions.
418 * JavaScriptCore.xcodeproj/project.pbxproj:
424 (KJS::monthToDayInYear):
425 (KJS::dateToDayInYear):
426 (KJS::getDSTOffsetSimple):
428 (KJS::dateToMseconds):
431 2006-10-04 Kevin McCullough <KMcCullough@apple.com>
435 - This is a big makeover for our Date implemenetation. This solves many platform specific issues, specifically dates before 1970, and simplifies some ugly code. The purpose of this was to get us to pass many of the JavaScriptCore tests on windows.
437 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
438 * JavaScriptCore.xcodeproj/project.pbxproj:
439 * kjs/DateMath.cpp: Added.
442 (KJS::daysFrom1970ToYear):
443 (KJS::msFrom1970ToYear):
449 (KJS::msToMilliseconds):
455 (KJS::msToDayInMonth):
456 (KJS::monthToDayInYear):
457 (KJS::timeToMseconds):
458 (KJS::dateToDayInYear):
459 (KJS::equivalentYearForDST):
461 (KJS::getDSTOffsetSimple):
463 (KJS::localTimeToUTC):
464 (KJS::UTCToLocalTime):
465 (KJS::dateToMseconds):
468 * kjs/DateMath.h: Added.
470 * kjs/date_object.cpp:
473 (KJS::DateInstance::getTime):
474 (KJS::DateInstance::getUTCTime):
475 (KJS::DateProtoFunc::callAsFunction):
476 (KJS::DateObjectImp::construct):
477 (KJS::DateObjectFuncImp::callAsFunction):
482 2006-10-02 Nikolas Zimmermann <zimmermann@kde.org>
484 Reviewed/landed by Adam.
486 Build testkjs on Qt/Linux.
490 2006-10-02 Nikolas Zimmermann <zimmermann@kde.org>
492 Reviewed by eseidel. Landed by eseidel.
494 Fix win32 build, which has no inttypes.h
498 2006-10-02 Nikolas Zimmermann <zimmermann@kde.org>
500 Reviewed by eseidel & mjs. Landed by eseidel.
502 Fix Qt/Linux build with older gcc 3.3.4.
503 http://bugs.webkit.org/show_bug.cgi?id=11116
505 * kjs/lookup.h: Move cacheGlobalObject into KJS namespace.
506 (KJS::cacheGlobalObject): Also remove GCC_ROOT_NS_HACK.
507 * wtf/Assertions.h: Include inttypes.h for uintptr_t.
509 2006-09-28 Steve Falkenburg <sfalken@apple.com>
513 Use $(ConfigSuffix) set via vsprops files to add _debug
514 to end of debug filenames.
516 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
517 * JavaScriptCore.vcproj/debug.vsprops: Added.
518 * JavaScriptCore.vcproj/dftables/dftables.vcproj:
519 * JavaScriptCore.vcproj/release.vsprops: Added.
520 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
522 2006-09-28 Darin Adler <darin@apple.com>
526 - support for change that should fix <rdar://problem/4733044>
527 REGRESSION: XML iBench shows 10% perf. regression (copying
528 strings while decoding)
530 * wtf/Vector.h: Changed VectorBuffer so that the general case
531 contains an instance of the 0 case, since deriving from it
532 was violating the Liskov Substitution Principle.
533 (WTF::VectorBuffer::releaseBuffer): Added. Releases the buffer so it can
534 be adopted by another data structure that uses the FastMalloc.h allocator.
535 Returns 0 if the internal buffer was being used.
536 (WTF::Vector::releaseBuffer): Added. Releases the buffer as above or creates
537 a new one in the case where the internal buffer was being used.
539 2006-09-28 Maciej Stachowiak <mjs@apple.com>
543 - change garbage collection to happen at increments proportional to number of live objects, not always
544 every 1000 allocations
547 (KJS::Collector::allocate):
549 2006-09-28 Maciej Stachowiak <mjs@apple.com>
553 - fixed REGRESSION (r16606): javascriptCore Crash on website load
557 - fixed some possible off-by-one bugs
558 - use indexing, not iterators, for Vectors
559 - store Vector by pointer instead of by value to avoid blowing out FunctionImp size
562 (KJS::FunctionImp::addParameter):
563 (KJS::FunctionImp::parameterString):
564 (KJS::FunctionImp::processParameters):
565 (KJS::FunctionImp::lengthGetter):
566 (KJS::FunctionImp::getParameterName):
569 2006-09-27 Steve Falkenburg <sfalken@apple.com>
575 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
576 * JavaScriptCore.vcproj/JavaScriptCore/dstroot-to-sdk.cmd: Removed.
578 2006-09-27 John Sullivan <sullivan@apple.com>
581 (KJS::FunctionImp::getParameterName):
582 removed assertion that displeased gcc 4.0.1 (build 5420):
583 ASSERT(static_cast<size_t>(index) == index);
585 2006-09-27 Kevin McCullough <KMcCullough@apple.com>
589 Cleanup of previous fix which was to address Radar: 4752492
592 (KJS::FunctionImp::addParameter):
593 (KJS::FunctionImp::parameterString):
594 (KJS::FunctionImp::processParameters):
595 (KJS::FunctionImp::lengthGetter):
596 (KJS::FunctionImp::getParameterName):
599 2006-09-27 Kevin McCullough <KMcCullough@apple.com>
603 Fixes a GC stack overflow crash.
604 The change is to move from a linked list implementation of Parameters to a Vector.
605 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.
608 (KJS::Parameter::Parameter):
609 (KJS::FunctionImp::addParameter):
610 (KJS::FunctionImp::parameterString):
611 (KJS::FunctionImp::processParameters):
612 (KJS::FunctionImp::lengthGetter):
613 (KJS::FunctionImp::getParameterName):
616 2006-09-27 Steve Falkenburg <sfalken@apple.com>
620 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
622 2006-09-27 Steve Falkenburg <sfalken@apple.com>
624 Set path before build.
626 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
628 2006-09-27 Sean Gies <seangies@apple.com>
630 Reviewed by Adam Roben.
632 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Debug config should link to debug runtime.
633 * JavaScriptCore.vcproj/dftables/dftables.vcproj: Debug config should link to debug runtime.
635 2006-09-27 Don Melton <gramps@apple.com>
637 Reviewed by Adam Roben.
639 Changed line ending from DOS to UNIX format so it doesn't die running
642 * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
644 2006-09-23 Alexey Proskuryakov <ap@nypop.com>
648 http://bugs.webkit.org/show_bug.cgi?id=10183
649 REGRESSION: obfuscated JS decoding breaks because of soft hyphen removal
650 (Fanfiction.net author pages not listing stories)
652 Rolled out the fix for bug 4139.
657 * tests/mozilla/ecma/Array/15.4.5.1-1.js:
658 * tests/mozilla/expected.html:
660 2006-09-22 Steve Falkenburg <sfalken@apple.com>
664 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
666 2006-09-22 Darin Adler <darin@apple.com>
670 * wtf/Vector.h: Add an append that takes a pointer and length.
671 Generalize the existing Vector append to work on vectors with
672 any value for inlineCapacity. Change the append algorithm so
673 it doesn't check capacity each time through the loop.
675 2006-09-22 Steve Falkenburg <sfalken@apple.com>
679 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
681 2006-09-21 Geoffrey Garen <ggaren@apple.com>
685 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
686 Updated to include the right path.
687 * wtf/FastMalloc.h: #include Platform.h, since we use Platform macros.
689 === Safari-521.27 ===
691 2006-09-20 Anders Carlsson <acarlsson@apple.com>
693 Reviewed by Dave Hyatt.
698 2006-09-20 Sean Gies <seangies@apple.com>
700 Reviewed by Steve Falkenburg.
702 * wtf/Assertions.cpp: Debug messages should go into debugger console.
704 2006-09-20 David Hyatt <hyatt@apple.com>
706 Add an implementation of lrint for Win32.
713 2006-09-15 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
717 http://bugs.webkit.org/show_bug.cgi?id=10864
718 Bug 10864: Linux\GDK build fixes
720 * JavaScriptCoreSources.bkl:
723 2006-09-15 Adam Roben <aroben@apple.com>
727 * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
729 2006-09-15 Anders Carlsson <acarlsson@apple.com>
731 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
732 Fix the release build.
734 2006-09-15 Anders Carlsson <acarlsson@apple.com>
738 Add JavaScriptCore API to the build.
740 * API/JSCallbackConstructor.cpp:
741 * API/JSCallbackFunction.cpp:
742 * API/JSCallbackObject.cpp:
743 * API/JSClassRef.cpp:
744 * API/JSContextRef.cpp:
745 * API/JSObjectRef.cpp:
746 * API/JSStringRef.cpp:
747 * API/JSValueRef.cpp:
748 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
749 * os-win32/stdbool.h: Added.
751 2006-09-12 Steve Falkenburg <sfalken@apple.com>
755 Build tweaks (doing JavaScriptCore now since it doesn't have
758 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
759 * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
760 * JavaScriptCore.vcproj/JavaScriptCore/dstroot-to-sdk.cmd: Added.
761 * JavaScriptCore.vcproj/dftables/dftables.vcproj:
762 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
764 2006-09-11 Brady Eidson <beidson@apple.com>
766 Build fix - I think Tim's last checkin wasn't tested on Tiger, possibly. I simply
767 commented out the undefined constants until he can have a chance to make the right call
769 * bindings/objc/objc_utility.mm:
770 (KJS::Bindings::objcValueTypeForType): Commented out undefined symbols
772 2006-09-11 Timothy Hatcher <timothy@apple.com>
774 Reviewed by Tim O. and Darin.
776 Add support for more method signatures affecting ObjC methods called from JavaScript:
777 - Added unsigned types and long long.
778 - Allow methods that use const, oneway, bycopy and byref type modifiers.
780 * bindings/objc/objc_instance.mm:
781 (ObjcInstance::invokeMethod):
782 * bindings/objc/objc_utility.h:
784 * bindings/objc/objc_utility.mm:
785 (KJS::Bindings::convertValueToObjcValue):
786 (KJS::Bindings::convertObjcValueToValue):
787 (KJS::Bindings::objcValueTypeForType):
789 2006-09-05 Timothy Hatcher <timothy@apple.com>
793 <rdar://problem/4715840> SEL is not char*
795 * bindings/objc/objc_class.mm:
796 (KJS::Bindings::ObjcClass::methodsNamed): use sel_getName instead of a char* cast.
797 * bindings/objc/objc_runtime.mm:
798 (ObjcFallbackObjectImp::callAsFunction): ditto
800 2006-09-03 Alexey Proskuryakov <ap@nypop.com>
804 http://bugs.webkit.org/show_bug.cgi?id=10693
805 Convert JavaScript arrays to AppleScript lists
807 * JavaScriptCore.exp: Export ArrayInstance::info and ArrayInstance::getItem().
808 * kjs/array_instance.h:
809 * kjs/array_object.cpp:
810 (ArrayInstance::getItem): Added a method to access array items from C++.
812 2006-09-02 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
816 Bug 10454: Unix bakefile fixes
817 http://bugs.webkit.org/show_bug.cgi?id=10454
819 * JavaScriptCoreSources.bkl:
821 2006-09-01 Nikolas Zimmermann <zimmermann@kde.org>
823 Reviewed by hyatt. Landed by eseidel.
827 * pcre/CMakeLists.txt: Add wtf/ include.
829 2006-09-01 Nikolas Zimmermann <zimmermann@kde.org>
831 Reviewed and landed by ap.
833 Fix build on Linux (C89 without gcc extensions enabled).
835 * pcre/pcre_internal.h: Use C style comments.
836 * wtf/Assertions.h: Use C style comments.
837 * wtf/Platform.h: Use C style comments.
839 2006-09-01 Steve Falkenburg <sfalken@apple.com>
843 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
844 * JavaScriptCore.vcproj/dftables/dftables.vcproj:
846 2006-08-31 Anders Carlsson <acarlsson@apple.com>
850 Add new portability functions to MathExtras.h and add StringExtras.h which is for
851 string portability functions.
853 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
854 * bindings/c/c_instance.cpp:
855 * kjs/date_object.cpp:
859 * wtf/StringExtras.h: Added.
863 2006-08-31 Anders Carlsson <acarlsson@apple.com>
869 * JavaScriptCore.vcproj/dftables/dftables.vcproj:
870 * pcre/pcre_internal.h:
872 2006-08-31 Timothy Hatcher <timothy@apple.com>
876 Band-aid fix for PCRE to compile for ppc64 and x86_64 now that
877 we use -Wshorten-64-to-32. Adds an INT_CAST macro that ASSERTs
878 the value <= INT_MAX.
880 I filed <rdar://problem/4712064> to track the need to verify
881 PCRE's 64-bit compliance.
883 * pcre/pcre_compile.c:
892 (pcre_get_substring_list):
893 * pcre/pcre_internal.h:
894 * pcre/pcre_tables.c:
895 * pcre/pcre_try_flipped.c:
898 2006-08-30 Darin Adler <darin@apple.com>
900 Reviewed by Tim Hatcher.
902 - add WTF::getPtr, a function template that makes it possible to write
903 generic code that gets a raw pointer out of any of our pointer types
905 * JavaScriptCore.xcodeproj/project.pbxproj:
906 * wtf/GetPtr.h: Added.
907 * wtf/ListRefPtr.h: (WTF::getPtr): Added.
908 * wtf/OwnArrayPtr.h: (WTF::getPtr): Added.
909 * wtf/OwnPtr.h: (WTF::getPtr): Added.
910 * wtf/PassRefPtr.h: (WTF::getPtr): Added.
911 * wtf/RefPtr.h: (WTF::getPtr): Added.
913 2006-08-29 waylonis <waylonis@google.com>
915 Reviewed, tweaked by ggaren.
917 - Added storage and accessor functions for ExecState as a fix for
918 http://bugs.webkit.org/show_bug.cgi?id=10114
921 (KJS::ExecState::ExecState):
924 (KJS::Context::setExecState):
925 (KJS::Context::execState):
927 2006-08-30 Nikolas Zimmermann <zimmermann@kde.org>
931 Commit KDE related tweaks, to be able to
932 differentiate between a Qt-only or a KDE build.
934 * CMakeLists.txt: Install wtf-unity library.
935 * wtf/Platform.h: Add define for the KDE platform.
937 2006-08-28 Darin Adler <darin@apple.com>
941 * kjs/list.h: Use explicit in constructor (as appropriate).
943 2006-08-24 Nikolas Zimmermann <zimmermann@kde.org>
945 Reviewed, tweaked and landed by ap
947 http://bugs.webkit.org/show_bug.cgi?id=10467
948 WebKit should have Qt platform support (Part II)
950 * CMakeLists.txt: Adjust to Anders' build fixes.
951 * wtf/Platform.h: Fix define for the Qt platform (we don't use/need Cairo.)
953 2006-08-23 David Hyatt <hyatt@apple.com>
955 Fix Platform.h to include #defines for graphics features.
959 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
962 2006-08-23 Anders Carlsson <acarlsson@apple.com>
966 Make the bindings compile without CoreFoundation.
968 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
969 * bindings/c/c_instance.cpp:
970 * bindings/c/c_utility.cpp:
971 (KJS::Bindings::convertUTF8ToUTF16):
973 * bindings/runtime.cpp:
974 (KJS::Bindings::Instance::createBindingForLanguageInstance):
975 (KJS::Bindings::Instance::createLanguageInstanceForValue):
976 * bindings/runtime_root.cpp:
977 * bindings/runtime_root.h:
978 * kjs/interpreter.cpp:
979 (KJS::Interpreter::createLanguageInstanceForValue):
982 2006-08-22 Anders Carlsson <acarlsson@apple.com>
986 Move the npruntime code over to using HashMap and the runtime_root code over to using
987 HashMap and HashCountedSet.
989 * bindings/NP_jsobject.cpp:
990 * bindings/c/c_utility.cpp:
991 (KJS::Bindings::identifierFromNPIdentifier):
992 * bindings/c/c_utility.h:
993 * bindings/jni/jni_jsobject.cpp:
994 (JavaJSObject::invoke):
995 * bindings/npruntime.cpp:
996 (getStringIdentifierMap):
997 (getIntIdentifierMap):
998 (_NPN_GetStringIdentifier):
999 (_NPN_GetIntIdentifier):
1000 * bindings/runtime_root.cpp:
1001 (getReferencesByRootMap):
1003 (KJS::Bindings::findReferenceSet):
1004 (KJS::Bindings::rootForImp):
1005 (KJS::Bindings::rootForInterpreter):
1006 (KJS::Bindings::addNativeReference):
1007 (KJS::Bindings::removeNativeReference):
1008 (RootObject::removeAllNativeReferences):
1009 * bindings/runtime_root.h:
1011 2006-08-22 Anders Carlsson <acarlsson@apple.com>
1015 Switch over the NPAPI and Java bindings to using HashMaps instead of dictionaries.
1017 * JavaScriptCore.xcodeproj/project.pbxproj:
1018 * bindings/c/c_class.cpp:
1019 (KJS::Bindings::CClass::CClass):
1020 (KJS::Bindings::CClass::~CClass):
1021 (KJS::Bindings::CClass::classForIsA):
1022 (KJS::Bindings::CClass::methodsNamed):
1023 (KJS::Bindings::CClass::fieldNamed):
1024 * bindings/c/c_class.h:
1025 * bindings/jni/jni_class.cpp:
1026 (JavaClass::JavaClass):
1027 (JavaClass::~JavaClass):
1028 (JavaClass::methodsNamed):
1029 (JavaClass::fieldNamed):
1030 * bindings/jni/jni_class.h:
1031 * bindings/objc/objc_class.h:
1032 * bindings/objc/objc_class.mm:
1033 (KJS::Bindings::deleteMethod):
1034 (KJS::Bindings::deleteField):
1036 (KJS::Bindings::ObjcClass::methodsNamed):
1037 (KJS::Bindings::ObjcClass::fieldNamed):
1038 * bindings/runtime.cpp:
1039 * bindings/runtime.h:
1040 * bindings/runtime_object.cpp:
1041 (RuntimeObjectImp::fieldGetter):
1042 (RuntimeObjectImp::getOwnPropertySlot):
1043 (RuntimeObjectImp::put):
1044 (RuntimeObjectImp::canPut):
1046 2006-08-21 Vladimir Olexa <vladimir.olexa@gmail.com>
1050 http://bugs.webkit.org/show_bug.cgi?id=6252
1051 JavaScript 1.6 Array.lastIndexOf
1053 Test: fast/js/array-lastIndexOf.html
1055 * kjs/array_object.cpp:
1056 (ArrayProtoFunc::callAsFunction): Added a LastIndexOf case.
1057 * kjs/array_object.h:
1058 (KJS::ArrayProtoFunc::): Added LastIndexOf to enum.
1059 * tests/mozilla/expected.html: Two more tests now pass.
1061 2006-08-20 Nikolas Zimmermann <zimmermann@kde.org>
1063 Reviewed by Maciej. Landed by rwlbuis.
1065 Fixes parts of: http://bugs.webkit.org/show_bug.cgi?id=10463
1066 WebKit should have Qt platform support
1068 Removing obsolete QConstString/QString constructors in kjs code.
1073 2006-08-17 Nikolas Zimmermann <zimmermann@kde.org>
1075 Reviewed by Maciej. Landed by rwlbuis.
1077 Fixes: http://bugs.webkit.org/show_bug.cgi?id=10463
1078 WTF Changes needed for Qt platform code.
1081 * wtf/unicode/UnicodeDecomposition.h: Added.
1083 * wtf/unicode/UnicodeDirection.h: Added.
1085 * wtf/unicode/qt4/UnicodeQt4.cpp: Added.
1086 (WTF::Unicode::direction):
1087 (WTF::Unicode::category):
1088 (WTF::Unicode::decomposition):
1089 * wtf/unicode/qt4/UnicodeQt4.h:
1090 (WTF::Unicode::toLower):
1091 (WTF::Unicode::toUpper):
1092 (WTF::Unicode::isPrintableChar):
1093 (WTF::Unicode::isSpace):
1094 (WTF::Unicode::isPunct):
1095 (WTF::Unicode::isDigit):
1096 (WTF::Unicode::mirroredChar):
1097 (WTF::Unicode::compare):
1099 2006-08-17 Nikolas Zimmermann <zimmermann@kde.org>
1101 Reviewed by Eric. Landed by rwlbuis.
1103 Fixes: http://bugs.webkit.org/show_bug.cgi?id=10464
1104 Offer a cmake build system for Qt platform.
1106 * CMakeLists.txt: Added.
1107 * pcre/CMakeLists.txt: Added.
1109 2006-08-17 Anders Carlsson <acarlsson@apple.com>
1116 2006-08-15 Steve Falkenburg <sfalken@apple.com>
1122 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1125 2006-08-15 Mark Rowe <opendarwin.org@bdash.net.nz>
1129 Build fix: DWARF and -gfull are incompatible with symbol separation.
1131 * JavaScriptCore.xcodeproj/project.pbxproj:
1133 2006-08-15 Mark Rowe <opendarwin.org@bdash.net.nz>
1137 http://bugs.webkit.org/show_bug.cgi?id=10394
1138 Bug 10394: WebKit Release and Production configurations should enable dead code stripping
1140 * JavaScriptCore.xcodeproj/project.pbxproj:
1142 2006-08-15 Mark Rowe <opendarwin.org@bdash.net.nz>
1146 http://bugs.webkit.org/show_bug.cgi?id=10384
1147 Bug 10384: Switch to DWARF for Release configuration
1149 * JavaScriptCore.xcodeproj/project.pbxproj:
1151 2006-08-13 Maks Orlovich <maksim@kde.org>
1153 Reviewed (and tweaked a little) by Maciej.
1155 - shrank the size of JSObject by 8 bytes and made the corresponding reduction to the cell size, resulting
1156 in a 1.2% speed improvement on JS iBench (and probably overall memory savings).
1158 This was done by removing _scope and _internalValue data members
1159 from JSObject and moving them only to the subclasses that actually
1163 (KJS::JSObject::mark): No need to mark scope or internal value here.
1165 (KJS::JSObject::JSObject): Don't initialize them.
1166 * kjs/JSWrapperObject.cpp: Added. New base class for object types that
1167 wrap primitive values (Number, String, Boolean, Date).
1168 (KJS::JSWrapperObject::mark):
1169 * kjs/JSWrapperObject.h: Added.
1170 (KJS::JSWrapperObject::JSWrapperObject):
1171 (KJS::JSWrapperObject::internalValue):
1172 (KJS::JSWrapperObject::setInternalValue):
1173 * kjs/array_object.cpp:
1174 (ArrayPrototype::ArrayPrototype): Don't set useless internal value.
1175 * kjs/bool_object.cpp:
1176 (BooleanInstance::BooleanInstance): Inherit from JSWrapperObject.
1177 (BooleanProtoFunc::callAsFunction): Fixed to account for fact that not all
1178 JSObjects have an internal value.
1179 (BooleanObjectImp::construct): ditto.
1180 * kjs/bool_object.h:
1181 * kjs/collector.cpp: Lowered cell size to 48.
1182 (KJS::Collector::allocate): meaningless whitespace change
1183 * kjs/date_object.cpp:
1184 (KJS::DateInstance::DateInstance): Inherit from JSWrapperObject.
1185 (KJS::DateProtoFunc::callAsFunction): adjusted for move of internalValue
1186 (KJS::DateObjectImp::construct): ditto
1187 * kjs/date_object.h:
1188 * kjs/error_object.cpp:
1189 (ErrorPrototype::ErrorPrototype): don't set internal value
1190 * kjs/function.cpp: move _scope and related handling here
1191 (KJS::FunctionImp::mark): mark scope
1193 (KJS::FunctionImp::scope): moved here from JSObject
1194 (KJS::FunctionImp::setScope): ditto
1195 * kjs/number_object.cpp:
1196 (NumberInstance::NumberInstance): inherit from JSWrapperObject
1197 (NumberProtoFunc::callAsFunction): adjusted
1198 (NumberObjectImp::construct): adjusted
1199 * kjs/number_object.h: shring RegExp-related objects a little
1200 * kjs/regexp_object.cpp:
1201 (RegExpPrototype::RegExpPrototype): Adjust for size tweaks
1202 (RegExpObjectImp::RegExpObjectImp): ditto
1203 * kjs/regexp_object.h:
1204 * kjs/string_object.cpp:
1205 (StringInstance::StringInstance): inherit from JSWrapperObject
1206 (StringProtoFunc::callAsFunction): adjusted
1207 * kjs/string_object.h:
1208 * JavaScriptCore.exp: Exported new methods as needed.
1209 * JavaScriptCore.xcodeproj/project.pbxproj: Added new files to build.
1211 2006-08-04 Brady Eidson <beidson@apple.com>
1213 Reviewed by Geoff's rubber stamp
1215 Fix a build break on Intel hardware causes by adapting stricter
1216 compiler warnings (-Wshorten-64-to-32)
1219 (assertEqualsAsNumber): manually cast some doubles to floats
1222 2006-08-04 Sam Weinig <sam.weinig@gmail.com>
1226 - patch for http://bugs.webkit.org/show_bug.cgi?id=10192
1227 Make WebCore (and friends) compile with -Wshorten-64-to-32
1229 * Adds -Wshorten-64-to-32 flag to Xcode project.
1230 * Adds explicit casts where OK.
1234 (JSNodeList_getProperty):
1235 * JavaScriptCore.xcodeproj/project.pbxproj:
1237 2006-08-04 Adam Roben <aroben@apple.com>
1241 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Convert
1244 2006-08-03 Sam Weinig <sam.weinig@gmail.com>
1248 - patch for http://bugs.webkit.org/show_bug.cgi?id=10176
1249 Make WebCore compile with -Wundef
1251 * Adds -Wundef flag to Xcode project
1252 * Converts #ifs to #ifdef and #ifndefs where needed.
1253 * Added #define YYMAXDEPTH 10000 in kjs/grammar.y
1254 to fix a warning from within Bison.
1256 * JavaScriptCore.xcodeproj/project.pbxproj:
1257 * bindings/jni/jni_jsobject.cpp:
1258 (JavaJSObject::getSlot):
1259 (JavaJSObject::setSlot):
1261 * bindings/objc/objc_class.mm:
1262 (KJS::Bindings::ObjcClass::methodsNamed):
1263 (KJS::Bindings::ObjcClass::fieldNamed):
1264 * bindings/objc/objc_instance.mm:
1265 (ObjcInstance::invokeMethod):
1266 * bindings/objc/objc_runtime.mm:
1267 (ObjcMethod::getMethodSignature):
1273 2006-08-03 Anders Carlsson <acarlsson@apple.com>
1275 Reviewed by John Sullivan.
1279 Return *this in operator=
1281 2006-08-03 Adam Roben <aroben@apple.com>
1285 - Fixed Windows build
1287 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1288 * wtf/MathExtras.h: Implement inline versions of these functions
1292 2006-08-02 Adam Roben <aroben@apple.com>
1298 * kjs/date_object.cpp:
1301 2006-07-29 Darin Adler <darin@apple.com>
1303 - Removed tabs from these source files that still had them.
1304 We don't use them; that way source files look fine in editors
1305 that have tabs set to 8 spaces or to 4 spaces.
1306 - Removed allow-tabs Subversion property from the files too.
1308 * bindings/NP_jsobject.cpp:
1309 * bindings/c/c_utility.cpp:
1310 * bindings/jni/jni_runtime.cpp:
1311 * bindings/jni/jni_utility.cpp:
1312 * bindings/objc/objc_utility.mm:
1313 * bindings/runtime.cpp:
1314 * bindings/runtime_method.cpp:
1315 * bindings/testbindings.cpp:
1316 * bindings/testbindings.mm:
1317 * kjs/date_object.cpp:
1322 * kjs/string_object.cpp:
1325 2006-07-29 Darin Adler <darin@apple.com>
1327 * tests/mozilla/expected.html: Update test results now that regress-185165.js
1328 is succeeding. I suspect Anders fix for bug 4620655 is the reason.
1330 2006-07-29 Sam Weinig <sam.weinig@gmail.com>
1334 - patch for http://bugs.webkit.org/show_bug.cgi?id=10080
1335 Adopt pedantic changes from the Unity project to improve
1336 cross-compiler compatibility
1339 * Removing trailing semicolon from namespace braces.
1340 * Removing trailing comma from last enum declaration.
1341 * Updating to match style guidelines.
1342 * Adding missing newline to the end of the file.
1343 * Turning on gcc warning for missing newline at the end of a source file
1344 (GCC_WARN_ABOUT_MISSING_NEWLINE in Xcode, -Wnewline in gcc).
1345 * Alphabetical sorting of Xcode source list files.
1346 * Replace use of non-portable variable-size array with Vector.
1347 * Use C-style comments instead of C++ comments in files that might
1348 be included by either C or C++ files.
1350 * API/JSCallbackConstructor.cpp:
1351 (KJS::JSCallbackConstructor::construct):
1352 * API/JSCallbackFunction.cpp:
1353 (KJS::JSCallbackFunction::callAsFunction):
1354 * API/JSCallbackObject.cpp:
1355 (KJS::JSCallbackObject::construct):
1356 (KJS::JSCallbackObject::callAsFunction):
1357 * JavaScriptCore.xcodeproj/project.pbxproj:
1358 * JavaScriptCorePrefix.h:
1359 * bindings/jni/jni_class.cpp:
1360 (JavaClass::fieldNamed):
1361 * bindings/jni/jni_class.h:
1362 * bindings/jni/jni_instance.cpp:
1363 (JavaInstance::JavaInstance):
1364 (JavaInstance::valueOf):
1365 * bindings/jni/jni_objc.mm:
1366 (KJS::Bindings::dispatchJNICall):
1367 * bindings/jni/jni_runtime.cpp:
1368 (JavaParameter::JavaParameter):
1369 (JavaArray::JavaArray):
1370 * bindings/jni/jni_runtime.h:
1371 * bindings/jni/jni_utility.h:
1372 * bindings/objc/objc_instance.h:
1373 * bindings/runtime_array.h:
1379 2006-07-29 Mike Emmel <mike.emmel@gmail.com>
1383 - fixes for Linux build
1385 * JavaScriptCoreSources.bkl: Added new files to build, kjs/PropertyNameArray.cpp
1386 and kjs/testkjs.cpp, and removed old files.
1388 2006-07-24 Dan Waylonis <waylonis@google.com>
1390 Reviewed and tweaked a bit by Darin.
1392 - fix http://bugs.webkit.org/show_bug.cgi?id=9902
1393 jsNull and NSNull not properly converted between JS and ObjC
1395 * bindings/objc/objc_utility.mm: (KJS::Bindings::convertObjcValueToValue):
1396 Added case for converting NSNull to jsNull.
1398 2006-07-24 Rob Buis <buis@kde.org>
1402 http://bugs.webkit.org/show_bug.cgi?id=4258
1403 Date().toString() only includes GMT offset, not timezone string
1405 Use the info in tm_zone to append timezone abbreviation
1406 to Date().toString().
1408 * kjs/date_object.cpp:
1411 2006-07-24 Rob Buis <buis@kde.org>
1415 http://bugs.webkit.org/show_bug.cgi?id=5257
1416 setYear() does not match FireFox/IE behavior
1418 Make sure the right values end up in tm_year.
1420 * kjs/date_object.cpp:
1423 2006-07-23 Mark Rowe <opendarwin.org@bdash.net.nz>
1427 Bug 9686: [Drosera] Need the ability to break into Drosera on Javascript exceptions
1428 http://bugs.webkit.org/show_bug.cgi?id=9686
1430 JavaScriptCore portion of the fix.
1432 * JavaScriptCore.exp: Update symbol for change in argument type.
1434 (Debugger::detach): Clear map of recent exceptions.
1435 (Debugger::hasHandledException): Track the most recent exception
1436 thrown by an interpreter.
1437 (Debugger::exception): Change exception argument to a JSValue.
1440 (Node::debugExceptionIfNeeded): Notify the debugger of an exception
1441 if it hasn't seen it before.
1442 (ThrowNode::execute): Notify the debugger that an exception is being thrown.
1445 2006-07-23 Geoffrey Garen <ggaren@apple.com>
1447 Patch by Eric Albert, reviewed by Darin and me.
1449 - Fixed <rdar://problem/4645931> JavaScriptCore stack-scanning code
1450 crashes (Collector::markStackObjectsConservatively)
1452 * bindings/jni/jni_jsobject.cpp: On 64bit systems, jint is a long, not an
1454 (JavaJSObject::getSlot):
1455 (JavaJSObject::setSlot):
1456 * kjs/collector.cpp:
1457 (KJS::Collector::markCurrentThreadConservatively): Use a pointer instead of
1458 an int as 'dummy,' because on LP64 systems, an int is not pointer-aligned,
1459 and we want to scan the stack for pointers.
1460 * JavaScriptCore.xcodeproj/project.pbxproj: After a tense cease-fire, the
1461 XCode war has started up again!
1463 === Safari-521.20 ===
1465 2006-07-21 Geoffrey Garen <ggaren@apple.com>
1469 <rdar://problem/4507265> REGRESSION: overlays don't work on HousingMaps.com (Google Maps-based site)
1471 - Added support for strings that masquerade as undefined. Currently used
1472 by WebCore to implement undetectable style.filter.
1474 The name is a little long, but it's only used in one line of code, so I
1475 thought clarity should win over brevity.
1477 * JavaScriptCore.exp:
1478 * JavaScriptCore.xcodeproj/project.pbxproj:
1480 * kjs/string_object.h:
1481 (KJS::StringInstanceThatMasqueradesAsUndefined::StringInstanceThatMasqueradesAsUndefined):
1482 (KJS::StringInstanceThatMasqueradesAsUndefined::masqueradeAsUndefined):
1483 (KJS::StringInstanceThatMasqueradesAsUndefined::toBoolean):
1485 === Safari-521.19 ===
1487 2006-07-20 Steve Falkenburg <sfalken@apple.com>
1492 (KJS::escapeStringForPrettyPrinting):
1494 2006-07-19 Anders Carlsson <acarlsson@apple.com>
1498 <rdar://problem/4620655> REGRESSION(10.4.7-10.5): preview button for a blogger.com post doesn't work
1500 * kjs/nodes2string.cpp:
1501 (StringNode::streamTo):
1502 Return the escaped string.
1504 (RegExpNode::streamTo):
1505 Use the correct syntax.
1508 (KJS::escapeStringForPrettyPrinting):
1510 Add escape function which escapes a string for pretty-printing so it can be parsed again.
1512 * wtf/unicode/icu/UnicodeIcu.h:
1513 (WTF::Unicode::isPrintableChar):
1516 2006-07-18 Maciej Stachowiak <mjs@apple.com>
1518 Reviewed by Adele Peterson.
1520 <rdar://problem/4589530> REGRESSION: null character in JS string causes parse error (works in Tiger and in other browsers)
1526 (Lexer::scanRegExp):
1529 2006-07-18 Tim Omernick <timo@apple.com>
1531 Reviewed by Tim Hatcher.
1533 Removed a misleading comment; we recently added support for the NPNVPluginElementNPObject
1538 === Safari-521.18 ===
1540 2006-07-18 Timothy Hatcher <timothy@apple.com>
1542 Made the following headers public:
1551 * JavaScriptCore.xcodeproj/project.pbxproj:
1553 2006-07-17 Geoffrey Garen <ggaren@apple.com>
1557 - Added automatic prototype creation for classes.
1559 A class stores a weak reference to a prototype, which is cleared when
1560 the prototype is garbage collected, to avoid a reference cycle.
1562 We now have an attributes field in JSClassDefinition, that currently is
1563 used only to override automatic prototype creation when you want to manage your
1564 own prototypes, but can be extended in the future for other nefarious purposes.
1566 Similarly, we have JSObjectMake and JSObjectMakeWithPrototype, the latter
1567 allowing you to manage your own prototypes.
1569 JSObjectMakeConstructor is more interesting now, able to make a constructor
1570 on your behalf if you just give it a class.
1572 - Removed bogus old code from minidom.js.
1574 - Tweaked the headerdocs.
1576 - Added more GC testing, which caught some leaks, and tested more funny
1577 edge cases in lookup, which caught a lookup bug. Removed some testing
1578 we used to do with MyObject because it was redundant with the new, cool
1581 While fixing the lookup bug I retracted this change:
1583 "If a static setProperty callback returns 'false', to indicate that the
1584 property was not set, we no longer forward the set request up the class
1585 chain, because that's almost certainly not what the programmer expected."
1587 Returning false when setting a static property is a little silly, but you can see
1588 it being useful when shadowing a base class's static properties, and, regardless
1589 of usefullness, this is the defined behavior of the setProperty callback.
1591 - Plus a little ASCII art, for the kids.
1593 2006-07-17 Timothy Hatcher <timothy@apple.com>
1597 <rdar://problem/4634874> WebScriptObject and WebUndefined are no longer defined by WebKit
1599 Moves WebScriptObject and WebUndefined up to WebCore.
1600 This change does create an upwards-dependancy on WebScriptObject existing
1601 in the loaded process, but this code path in JavaScriptCore does not get used
1602 unless it is through WebKit/WebCore. Moving all of the binding code out of
1603 JavaScriptCore might make sense in the future.
1605 * JavaScriptCore.exp:
1606 * JavaScriptCore.xcodeproj/project.pbxproj:
1607 * bindings/objc/WebScriptObject.h: Replaced.
1608 * bindings/objc/WebScriptObject.mm: Removed.
1609 * bindings/objc/WebScriptObjectPrivate.h: Removed.
1610 * bindings/objc/objc_class.h:
1611 * bindings/objc/objc_instance.h:
1612 * bindings/objc/objc_instance.mm:
1613 (ObjcInstance::~ObjcInstance):
1614 * bindings/objc/objc_runtime.h:
1615 * bindings/objc/objc_runtime.mm:
1616 (convertValueToObjcObject):
1617 * bindings/objc/objc_utility.mm:
1618 (KJS::Bindings::convertValueToObjcValue):
1619 (KJS::Bindings::convertObjcValueToValue):
1620 (KJS::Bindings::createObjcInstanceForValue):
1622 2006-07-17 Darin Adler <darin@apple.com>
1624 * API/JSBase.h: Fix comment formatting where things used to be lined up but
1625 are now ragged. Got rid of spaces that attempted to line things up.
1626 * API/JSObjectRef.h: Ditto. Also add missing periods for a couple of comments.
1628 2006-07-17 Geoffrey Garen <ggaren@apple.com>
1632 - Removed the exception parameter from the initialize callback and, by extension,
1633 JSObjectMake. We have never had a need for exceptions when iniitializing,
1634 so the parameter seemed likely to "get in the way."
1636 Also, an exception in JavaScript is thrown in response to input --
1637 "invalid URL", "index not a number", etc., so it's the job of the
1638 constructor function, not the initialize method, to throw.
1640 If initialize *really* wants to throw, it can communicate the throw to
1641 the constructor through the constructed object's private data (e.g., set
1642 it to NULL, signaling to the consntructor that initialization failed.)
1644 - Added JSObjectMakeWithData, which enables a constructor to set private
1645 data on an object *before* it has been initialized. That way, the initialize
1646 methods can properly operate on the data.
1648 * API/JSNode.c: Moved ref into the initialize method, for better encapsulation,
1649 now that it's possible.
1650 * API/JSNodeList.c: ditto
1652 (main): Do more aggressive garbage collection to test ref/deref and
1653 initialize/finalize.
1654 * API/minidom.js: store childNodes in a temporary so it doesn't get re-created
1655 like a thousand times. This makes debugging ref/deref easier
1657 2006-07-17 Geoffrey Garen <ggaren@apple.com>
1661 - Changed the initialize callback to run from least derived class (parent
1662 class) to most derived class. This enables C++ style initialization,
1663 and derived class overriding of member data.
1665 - Added excpetion propopgation to JSObjectMake, to support initialize
1666 exceptions, and generally round out our policy of making function
1667 signatures as long as possible.
1669 * API/JSCallbackObject.h: Use ExecState instead of ContextRef, cuz we're
1672 2006-07-17 Geoffrey Garen <ggaren@apple.com>
1676 - Changed JSObjectMakeConstructor to JSObjectMakeConstructorWithCallback,
1677 to match JSObjectMakeFunctionWithCallback.
1679 - Added prototype parameter, so the generated constructor
1680 automatically works with hasInstance / instanceof
1682 - Moved hasInstance implementation from InternalFunctionImp to JSObject
1683 so that subclasses can inherit it without inheriting function-related baggage.
1684 More refactoring here would be good, but this seems like a good short-term
1687 (KJS::JSCallbackFunction::implementsHasInstance): override and return false,
1688 because callback functions aren't constructors.
1690 2006-07-17 Maciej Stachowiak <mjs@apple.com>
1694 - add a JSContextRef parameter to all JSValueRef, JSObjectRef, and JSContextRef operations;
1695 except JSObject{Get,Set}PrivateData which can be assumed to be simple pure accessors.
1697 Also renamed the parameter "context" to "ctx" because it makes the code read better with this pervasive
1698 but usually uninteresting parameter.
1702 (JSCheckScriptSyntax):
1705 * API/JSCallbackObject.cpp:
1706 (KJS::JSCallbackObject::JSCallbackObject):
1707 (KJS::JSCallbackObject::init):
1708 (KJS::JSCallbackObject::getOwnPropertySlot):
1709 (KJS::JSCallbackObject::put):
1710 (KJS::JSCallbackObject::deleteProperty):
1711 (KJS::JSCallbackObject::toNumber):
1712 (KJS::JSCallbackObject::toString):
1713 * API/JSContextRef.cpp:
1714 (JSGlobalContextCreate):
1715 (JSGlobalContextRetain):
1716 (JSGlobalContextRelease):
1717 (JSContextGetGlobalObject):
1718 * API/JSContextRef.h:
1720 (JSNodePrototype_appendChild):
1721 (JSNodePrototype_removeChild):
1722 (JSNodePrototype_replaceChild):
1723 (JSNode_getNodeType):
1724 (JSNode_getFirstChild):
1727 (JSNodeListPrototype_item):
1728 (JSNodeList_length):
1729 (JSNodeList_getProperty):
1730 (JSNodeList_prototype):
1731 * API/JSObjectRef.cpp:
1733 (JSObjectMakeFunctionWithCallback):
1734 (JSObjectMakeConstructor):
1735 (JSObjectMakeFunction):
1736 (JSObjectGetPrototype):
1737 (JSObjectSetPrototype):
1738 (JSObjectHasProperty):
1739 (JSObjectGetProperty):
1740 (JSObjectSetProperty):
1741 (JSObjectGetPropertyAtIndex):
1742 (JSObjectSetPropertyAtIndex):
1743 (JSObjectDeleteProperty):
1744 (JSObjectIsFunction):
1745 (JSObjectCallAsFunction):
1746 (JSObjectIsConstructor):
1747 (JSObjectCallAsConstructor):
1748 (JSObjectCopyPropertyNames):
1749 * API/JSObjectRef.h:
1750 * API/JSStringRef.cpp:
1751 * API/JSValueRef.cpp:
1753 (JSValueIsUndefined):
1759 (JSValueIsObjectOfClass):
1761 (JSValueIsStrictEqual):
1762 (JSValueIsInstanceOfConstructor):
1763 (JSValueMakeUndefined):
1765 (JSValueMakeBoolean):
1766 (JSValueMakeNumber):
1767 (JSValueMakeString):
1770 (JSValueToStringCopy):
1778 (MyObject_getProperty):
1779 (MyObject_deleteProperty):
1780 (MyObject_callAsFunction):
1781 (MyObject_callAsConstructor):
1782 (MyObject_convertToType):
1783 (print_callAsFunction):
1786 2006-07-16 Geoffrey Garen <ggaren@apple.com>
1788 Approved by Maciej, RS by Beth.
1790 JSObjectMakeFunction -> JSObjectMakeFunctionWithCallback
1791 JSObjectMakeFunctionWithBody -> JSObjectMakeFunction
1793 because the latter is more common, and more fundamental, than the former.
1798 * API/JSCallbackObject.cpp:
1799 (KJS::JSCallbackObject::getOwnPropertySlot):
1800 (KJS::JSCallbackObject::put):
1801 (KJS::JSCallbackObject::deleteProperty):
1802 (KJS::JSCallbackObject::getPropertyNames):
1803 (KJS::JSCallbackObject::staticValueGetter):
1804 (KJS::JSCallbackObject::staticFunctionGetter):
1805 * API/JSClassRef.cpp:
1806 (OpaqueJSClass::OpaqueJSClass):
1807 (OpaqueJSClass::~OpaqueJSClass):
1809 * API/JSObjectRef.cpp:
1811 (JSObjectMakeFunctionWithCallback):
1812 (JSObjectMakeFunction):
1813 (OpaqueJSPropertyNameArray::OpaqueJSPropertyNameArray):
1814 (JSObjectCopyPropertyNames):
1815 * API/JSObjectRef.h:
1821 * JavaScriptCore.exp:
1823 2006-07-16 Geoffrey Garen <ggaren@apple.com>
1827 Replace __JS with OpaqueJS because the former, while used by CF, is
1828 a prefix that's triply-reserved by the compiler. (_* is reserved in global
1829 names, _[A-Z] is reserved in all names, and __ is reserved in all names
1832 Opaque is an alternative used by other Mac OS X framewokrs.
1837 * API/JSCallbackObject.cpp:
1838 (KJS::JSCallbackObject::getOwnPropertySlot):
1839 (KJS::JSCallbackObject::put):
1840 (KJS::JSCallbackObject::deleteProperty):
1841 (KJS::JSCallbackObject::getPropertyNames):
1842 (KJS::JSCallbackObject::staticValueGetter):
1843 (KJS::JSCallbackObject::staticFunctionGetter):
1844 * API/JSClassRef.cpp:
1845 (OpaqueJSClass::OpaqueJSClass):
1846 (OpaqueJSClass::~OpaqueJSClass):
1848 * API/JSObjectRef.cpp:
1850 (OpaqueJSPropertyNameArray::OpaqueJSPropertyNameArray):
1851 (JSObjectCopyPropertyNames):
1853 2006-07-16 Darin Adler <darin@apple.com>
1855 - try to fix Windows build
1857 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1858 Added some recently added files, removed some recently removed.
1860 2006-07-16 Geoffrey Garen <ggaren@apple.com>
1864 - Change getProperty* to return undefined, rather than NULL, for missing
1865 properties, since that's what the spec says. Also added exception out
1866 parameters to the *Index functions, because they can call through to the
1867 regular functions, which can throw for custom objects.
1869 * API/JSObjectRef.cpp:
1870 (JSObjectGetProperty):
1871 (JSObjectGetPropertyAtIndex):
1872 (JSObjectSetPropertyAtIndex):
1873 * API/JSObjectRef.h:
1877 2006-07-16 Geoffrey Garen <ggaren@apple.com>
1881 - Properly document and handle NULL callbacks for static properties. We
1882 throw an exception in any case other than a ReadOnly property with a NULL
1883 setProperty callback, because a NULL callback almost certainly indicates
1884 a programming error. Also throw an exception if hasProperty returns true
1885 for a property that getProperty can't get.
1887 - If a static setProperty callback returns 'false', to indicate that the
1888 property was not set, we no longer forward the set request up the class
1889 chain, because that's almost certainly not what the programmer expected.
1891 * API/JSCallbackObject.cpp:
1892 (KJS::JSCallbackObject::getOwnPropertySlot):
1893 (KJS::JSCallbackObject::put):
1894 (KJS::JSCallbackObject::staticValueGetter):
1895 (KJS::JSCallbackObject::staticFunctionGetter):
1896 (KJS::JSCallbackObject::callbackGetter):
1897 * API/JSObjectRef.h:
1900 (MyObject_hasProperty):
1903 2006-07-16 Geoffrey Garen <ggaren@apple.com>
1907 - Added names to functions.
1909 - Removed GetPrivate/SetPrivate from callbackFunctions and callbackConstructors.
1910 The private data idiom is that a JS object stores its native implementation
1911 as private data. For functions and constructors, the native implementation is nothing
1912 more than the callback they already store, so supporting private data, too,
1913 confuses the idiom. If you *really* want, you can still create a custom
1914 function with private data.
1916 * API/JSCallbackConstructor.cpp:
1917 * API/JSCallbackConstructor.h:
1918 * API/JSCallbackFunction.cpp:
1919 (KJS::JSCallbackFunction::JSCallbackFunction):
1920 * API/JSCallbackFunction.h:
1921 * API/JSCallbackObject.cpp:
1922 (KJS::JSCallbackObject::staticFunctionGetter):
1923 * API/JSObjectRef.cpp:
1924 (JSObjectMakeFunction):
1925 (JSObjectMakeFunctionWithBody):
1926 (JSObjectGetPrivate):
1927 (JSObjectSetPrivate):
1928 * API/JSObjectRef.h:
1934 2006-07-15 Maciej Stachowiak <mjs@apple.com>
1938 - switch property lists to be vector+set of Identifiers instead of list of References
1940 This has the following benefits:
1942 - no duplicates in property lists
1943 - simplifies API calls
1944 - probably more efficient, since linked list is gone
1945 - entirely removed Reference, ReferenceList and ProtectedReference types from the API
1947 * kjs/PropertyNameArray.cpp: Added.
1948 (KJS::PropertyNameArray::add): Check set, if not already there, add to
1950 * kjs/PropertyNameArray.h: Added.
1951 (KJS::PropertyNameArray::PropertyNameArray): Newly added type, combines
1952 a set and a vector to make a unique but ordered list of identifiers.
1953 (KJS::PropertyNameArray::begin): ditto
1954 (KJS::PropertyNameArray::end): ditto
1955 (KJS::PropertyNameArray::size): ditto
1956 (KJS::PropertyNameArray::operator[]): ditto
1957 * kjs/array_instance.h:
1958 * kjs/array_object.cpp:
1959 (ArrayInstance::getPropertyNames): renamed from getPropertyList, updated
1960 for PropertyNameArray
1961 (ArrayInstance::setLength): updated for PropertyNameArray
1962 (ArrayInstance::pushUndefinedObjectsToEnd): ditto
1964 (ForInNode::execute): updated for PropertyNameArray
1967 (KJS::JSObject::getPropertyNames): renamed from getPropertyList, updated
1968 for PropertyNameArray
1970 * kjs/property_map.cpp:
1971 (KJS::PropertyMap::getEnumerablePropertyNames): updated for PropertyNameArray
1972 (KJS::PropertyMap::getSparseArrayPropertyNames): ditto
1973 * kjs/property_map.h:
1974 * kjs/protected_reference.h: Removed.
1975 * kjs/reference.cpp: Removed.
1976 * kjs/reference.h: Removed.
1977 * kjs/reference_list.cpp: Removed.
1978 * kjs/reference_list.h: Removed.
1979 * kjs/scope_chain.cpp:
1980 (KJS::ScopeChain::print): Use PropertyNamesArray instead of ReferenceList.
1981 * kjs/string_object.cpp:
1982 (StringInstance::getPropertyNames): Updated for new approach.
1983 * kjs/string_object.h:
1986 (toJS): Added overload for PropertyNameAccumulatorRef / PropertyNameArray*
1989 * API/JSCallbackObject.cpp:
1990 (KJS::JSCallbackObject::getPropertyNames): Fixed for new API.
1991 * API/JSCallbackObject.h:
1992 * API/JSObjectRef.cpp:
1993 (__JSPropertyNameArray::__JSPropertyNameArray): Type used for a publicly vended
1994 JSPropertyNameArrayRef.
1995 (JSObjectCopyPropertyNames): New API call - renamed / refactored from
1996 JSObjectCreatePropertyList
1997 (JSPropertyNameArrayRetain): new retain call for JSPropertyNameArray.
1998 (JSPropertyNameArrayRelease): new release call for - " -.
1999 (JSPropertyNameArrayGetCount): Instead of having to use a stateful enumerator you
2000 can now get the count and items in any order.
2001 (JSPropertyNameArrayGetNameAtIndex): See above.
2002 (JSPropertyNameAccumulatorAddName): What you add properties to is now an opaque
2004 * API/JSObjectRef.h: Prototyped new functions, removed old ones
2005 * JavaScriptCore.exp: Updated exported symbols.
2006 * JavaScriptCore.xcodeproj/project.pbxproj: Added new files, removed old.
2008 (MyObject_getPropertyNames): Renamed / fixed callback to fit new paradigm.
2009 (main): Updated for new API.
2011 2006-07-15 Darin Adler <darin@apple.com>
2013 - oops, missed a few more arrays that had to be const
2016 (JSNodePrototype_appendChild): Added const.
2017 (JSNodePrototype_removeChild): Ditto.
2018 (JSNodePrototype_replaceChild): Ditto.
2019 (JSNode_construct): Ditto.
2021 (JSNodeListPrototype_item): Ditto.
2022 * API/JSObjectRef.cpp:
2023 (JSObjectMakeFunctionWithBody): Ditto.
2024 (JSObjectCallAsFunction): Ditto.
2025 (JSObjectCallAsConstructor): Ditto.
2029 (MyObject_callAsFunction): Ditto.
2030 (MyObject_callAsConstructor): Ditto.
2031 (print_callAsFunction): Ditto.
2032 (myConstructor_callAsConstructor): Ditto.
2034 2006-07-15 Darin Adler <darin@apple.com>
2038 * API/JSNode.h: Made an array parameter const.
2039 * API/JSObjectRef.h: Made array parameters const. Fixed a comment.
2041 2006-07-15 Geoffrey Garen <ggaren@apple.com>
2045 - JSObjectMakeFunctionWithBody includes a function name and named parameters now.
2047 * API/JSObjectRef.cpp:
2048 (JSObjectMakeFunctionWithBody):
2049 * API/JSObjectRef.h:
2051 (assertEqualsAsUTF8String): More informative failure reporting.
2052 (main): Test more function cases.
2054 2006-07-15 Geoffrey Garen <ggaren@apple.com>
2058 - Moved the arguments passed to JSClassCreate into a single structure,
2059 called JSClassDefinition. This will enable easier structure
2060 migration/versioning in the future, if necessary.
2062 - Added support for class names.
2064 - kJSClassDefinitionNull replaces kJSObjectCallbacksNone.
2066 - JSClass is becoming a fairly complex struct, so I migrated all of its
2067 implementation other than reference counting to the sruct.
2069 - Also moved JSClass* functions in the API to JSObjectRef.cpp, since they're
2070 declared in JSObjectRef.h
2072 - Also added some more informative explanation to the class structure doc.
2074 2006-07-15 Darin Adler <darin@apple.com>
2078 - fix http://bugs.webkit.org/show_bug.cgi?id=8395
2079 <rdar://problem/4613467>
2080 REGRESSION: RegEx seems broken for hex escaped non breaking space
2082 Test: fast/js/regexp-extended-characters-more.html
2085 (match): Got rid of utf16Length local variable to guarantee there's no
2086 extra stack usage in recursive calls. Fixed two places in the PCRE_UTF16
2087 code that were using the length variable, which is the UTF-8 length of
2088 a character in the pattern, to move in the UTF-16 subject string. Instead
2089 they hardcode lengths of 1 and 2 since the code already handles BMP
2090 characters and surrogate pairs separately. Also fixed some DPRINTF so
2091 I could compile with DEBUG on.
2092 (pcre_exec): Changed a place that was checking for multibyte characters
2093 in the subject string to use ISMIDCHAR. Instead it was using hardcoded
2094 logic that was right for UTF-8 but wrong for UTF-16.
2096 * pcre/pcre_compile.c: (pcre_compile2): Fixed a DPRINTF so I could compile
2099 2006-07-14 Geoffrey Garen <ggaren@apple.com>
2103 Global replace in the API of argc/argv with argumentCount/arguments.
2105 2006-07-14 Geoffrey Garen <ggaren@apple.com>
2109 - Finalized exception handling in the API.
2111 setProperty can throw because it throws for built-in arrays. getProperty
2112 and deleteProperty can throw because setProperty can throw and we want
2113 to be consistent, and also because they seem like "actions." callAsFunction,
2114 callAsConstructor, and hasInstance can throw, because they caan throw for
2117 toBoolean can't throw because it's defined that way in the spec.
2119 - Documented that toBoolean and toObject can't be overridden by custom
2120 objects because they're defined that way in the spec.
2122 === Safari-521.17 ===
2124 2006-07-14 Geoffrey Garen <ggaren@apple.com>
2128 - Implemented ref-counting of JSContexts by splitting into two datatypes:
2129 JSGlobalContext, which you can create/retain/release, and JSContext, which
2132 Internally, you retain a JSGlobalContext/ExecState by retaining its
2133 interpreter, which, in the case of a global ExecState, owns it.
2135 - Also made ~Interpreter() protected to catch places where Interpreter
2136 is manually deleted. (Can't make it private because some crazy fool
2137 decided it would be a good idea to subclass Interpreter in other frameworks.
2141 (toJS): Added cast for new JSGlobalContext
2142 * API/JSStringRef.h: Changed vague "you must" language to more specific
2143 (but, ultimately, equally vague) "behavior is undefined if you don't"
2145 (KJS::Interpreter::Interpreter): Factored more common initialization into
2147 * kjs/interpreter.h:
2148 (KJS::Interpreter::ref): new
2149 (KJS::Interpreter::deref): new
2150 (KJS::Interpreter::refCount): new
2152 (doIt): Ref-count the interpreter.
2154 2006-07-14 Maciej Stachowiak <mjs@apple.com>
2158 - removed bool return value from JSObjectSetProperty, since it is inefficient and
2159 also doesn't work quite right
2160 - added JSObjectGetPropertyAtIndex and JSObjectSetPropertyAtIndex
2162 * API/JSObjectRef.cpp:
2163 (JSObjectSetProperty): Removed return value and canPut stuff.
2164 (JSObjectGetPropertyAtIndex): Added.
2165 (JSObjectSetPropertyAtIndex): Added.
2166 * API/JSObjectRef.h: Prototyped and documented new functions.
2168 2006-07-14 Geoffrey Garen <ggaren@apple.com>
2172 Moved JSCheckScriptSyntax, JSEvaluateScript, and JSGarbageCollect into
2173 JSBase.h/.cpp. They don't belong in the value-specific or context-specific
2174 files because they're not part of the value or context implementations.
2177 * API/JSContextRef.cpp:
2178 (JSContextGetGlobalObject):
2179 * API/JSContextRef.h:
2180 * API/JSValueRef.cpp:
2183 * JavaScriptCore.xcodeproj/project.pbxproj:
2185 2006-07-13 Timothy Hatcher <timothy@apple.com>
2189 Moved JavaScriptCore to be a public framework.
2191 * JavaScriptCore.xcodeproj/project.pbxproj:
2193 2006-07-13 Mark Rowe <opendarwin.org@bdash.net.nz>
2195 Reviewed by Geoffrey.
2197 http://bugs.webkit.org/show_bug.cgi?id=9742
2198 Bug 9742: REGRESSION: WebKit hangs when loading <http://www.vtbook.com>
2201 (KJS::JSValue::getUInt32): Only types tagged as numeric can be converted to UInt32.
2203 2006-07-13 Geoffrey Garen <ggaren@apple.com>
2207 - Renamed JSEvaluate -> JSEvaluateScript, JSCheckSyntax -> JSCheckScriptSyntax
2208 - Added exception out parameters to JSValueTo* and JSValueIsEqual because
2210 - Removed JSObjectGetDescription because it's useless and vague, and
2211 JSValueToString/JSValueIsObjectOfClass do a better job, anyway
2212 - Clarified comments about "IsFunction/Constructor" to indicate that they
2213 are true of all functions/constructors, not just those created by JSObjectMake*
2215 2006-07-12 Geoffrey Garen <ggaren@apple.com>
2219 Finished previously approved JSInternalString -> JSString conversion
2220 by renaming the files.
2222 * API/JSCallbackObject.cpp:
2223 * API/JSInternalStringRef.cpp: Removed.
2224 * API/JSInternalStringRef.h: Removed.
2225 * API/JSStringRef.cpp: Added.
2226 * API/JSStringRef.h: Added.
2227 * API/JavaScriptCore.h:
2228 * JavaScriptCore.xcodeproj/project.pbxproj:
2230 2006-07-12 Geoffrey Garen <ggaren@apple.com>
2234 - Removed context and exception parameters from JSObjectGetPropertyEnumerator,
2235 removing the spurious use of ExecState inside JavaScriptCore that made
2236 us think this was necessary in the first place.
2238 (StringInstance::getPropertyList): Use getString instead of toString because
2239 we know we're dealing with a string -- we put it there in the first place.
2240 While we're at it, store the string's size instead of retrieving it each time
2241 through the loop, to avoid the unnecessary killing of puppies.
2242 * kjs/string_object.h:
2244 2006-07-12 Maciej Stachowiak <mjs@apple.com>
2248 - add handling of hasInstance callback for API objects
2250 * API/JSCallbackObject.cpp:
2251 (KJS::JSCallbackObject::implementsHasInstance): Check if callback is present.
2252 (KJS::JSCallbackObject::hasInstance): Invoke appropriate callback.
2253 * API/JSCallbackObject.h:
2254 * API/JSClassRef.cpp:
2255 * API/JSObjectRef.h:
2257 (MyObject_hasInstance): Test case; should match what construct would do.
2260 2006-07-11 Geoffrey Garen <ggaren@apple.com>
2264 - Implemented a vast number of renames and comment clarifications
2265 suggested during API review.
2267 JSInternalString -> JSString
2268 JS*Make -> JSValueMake*, JSObjectMake*
2269 JSTypeCode -> JSType
2270 JSValueIsInstanceOf -> JSValueIsInstanceOfConstructor (reads strangely well in client code)
2271 JSGC*Protect -> JSValue*Protect
2272 JS*Callback -> JSObject*Callback
2273 JSGetPropertyListCallback -> JSObjectAddPropertiesToListCallback
2274 JSPropertyEnumeratorGetNext -> JSPropertyEnumeratorGetNextName
2276 JSStringCreateWithUTF8CString, JSStringGetUTF8CString,
2277 JSStringGetMaximumUTF8CStringSize JSStringIsEqualToUTF8CString,
2278 JSStringCreateWithCFString, JSStringCopyCFString, JSStringCreateWithCharacters.
2280 - Changed functions taking a JSValue out arg and returning a bool indicating
2281 whether it was set to simply return a JSValue or NULL.
2283 - Removed JSStringGetCharacters because it's more documentation than code,
2284 and it's just a glorified memcpy built on existing API functionality.
2286 - Moved standard library includes into the headers that actually require them.
2288 - Standardized use of the phrase "Create Rule."
2290 - Removed JSLock from make functions that don't allocate.
2292 - Added exception handling to JSValueToBoolean, since we now allow
2293 callback objects to throw exceptions upon converting to boolean.
2295 - Renamed JSGCCollect to JSGarbageCollect.
2297 2006-07-10 Geoffrey Garen <ggaren@apple.com>
2301 - Changed public header includes to the <JavaScriptCore/ style.
2302 - Changed instances of 'buffer' to 'string' since we decided on
2303 JSInternalString instead of JSStringBuffer.
2305 * API/JSContextRef.h:
2306 * API/JSInternalStringRef.cpp:
2308 (JSInternalStringRetain):
2309 (JSInternalStringRelease):
2310 (JSValueCopyStringValue):
2311 (JSInternalStringGetLength):
2312 (JSInternalStringGetCharactersPtr):
2313 (JSInternalStringGetCharacters):
2314 (JSInternalStringGetMaxLengthUTF8):
2315 (JSInternalStringGetCharactersUTF8):
2316 (CFStringCreateWithJSInternalString):
2317 * API/JSInternalStringRef.h:
2319 (JSNodePrototype_appendChild):
2320 (JSNode_getNodeType):
2321 * API/JSObjectRef.cpp:
2322 (JSObjectCallAsConstructor):
2324 * API/JavaScriptCore.h:
2329 (MyObject_getPropertyList):
2330 (myConstructor_callAsConstructor):
2331 (main): I noticed that we were prematurely releasing some string buffers,
2332 so I moved their release calls to the end of main(). I got rid of 'Buf' in *Buf
2333 (sometimes changing to 'IString', when necessary to differentiate a variable)
2334 to match the buffer->string change.
2336 === Safari-521.16 ===
2338 2006-07-10 Darin Adler <darin@apple.com>
2340 * kjs/value.cpp: (KJS::JSValue::toInt32Inline): Added inline keyword one more place.
2343 2006-07-10 Darin Adler <darin@apple.com>
2345 - fix the release build
2349 (KJS::JSValue::toInt32Inline): Move the code here to an inline.
2350 (KJS::JSValue::toInt32): Call the inline from both overloaded toInt32 functions.
2352 2006-07-10 David Kilzer <ddkilzer@kilzer.net>
2356 - fix http://bugs.webkit.org/show_bug.cgi?id=9179
2357 Implement select.options.add() method
2359 * JavaScriptCore.exp: Added overloaded KJS::JSValue::toInt32() method.
2360 * JavaScriptCore.xcodeproj/project.pbxproj: Altered attributes metadata for
2361 kjs/value.h to make it available as a forwarded header.
2363 (KJS::lookupPut): Extracted a lookupPut() method from the existing lookupPut() method.
2364 The new method returns a boolean value if no entry is found in the lookup table.
2366 (KJS::JSValue::toInt32): Overloaded toInt32() method with boolean "Ok" argument.
2367 * kjs/value.h: Ditto.
2369 2006-07-10 Geoffrey Garen <ggaren@apple.com>
2371 No review necessary. Removed bogus file I accidentally checked in before.
2373 * API/JSInternalSringRef.h: Removed.
2375 2006-07-10 Geoffrey Garen <ggaren@apple.com>
2379 Added exception out parameter to API object callbacks, removed semi-bogus
2380 JSContext(.*)Exception functions.
2382 To make these calls syntactically simple, I added an exceptionSlot()
2383 method to the ExecState class, which provides a JSValue** slot in which to
2384 store a JSValue* exception.
2388 * API/JSCallbackConstructor.cpp:
2389 (KJS::JSCallbackConstructor::construct):
2390 * API/JSCallbackFunction.cpp:
2391 (KJS::JSCallbackFunction::callAsFunction):
2392 * API/JSCallbackObject.cpp:
2393 (KJS::JSCallbackObject::init):
2394 (KJS::JSCallbackObject::getOwnPropertySlot):
2395 (KJS::JSCallbackObject::put):
2396 (KJS::JSCallbackObject::deleteProperty):
2397 (KJS::JSCallbackObject::construct):
2398 (KJS::JSCallbackObject::callAsFunction):
2399 (KJS::JSCallbackObject::getPropertyList):
2400 (KJS::JSCallbackObject::toBoolean):
2401 (KJS::JSCallbackObject::toNumber):
2402 (KJS::JSCallbackObject::toString):
2403 (KJS::JSCallbackObject::staticValueGetter):
2404 (KJS::JSCallbackObject::callbackGetter):
2405 * API/JSContextRef.cpp:
2407 * API/JSContextRef.h:
2409 (JSNodePrototype_appendChild):
2410 (JSNodePrototype_removeChild):
2411 (JSNodePrototype_replaceChild):
2412 (JSNode_getNodeType):
2413 (JSNode_getChildNodes):
2414 (JSNode_getFirstChild):
2418 (JSNodeListPrototype_item):
2419 (JSNodeList_length):
2420 (JSNodeList_getProperty):
2421 * API/JSObjectRef.h:
2425 (MyObject_initialize):
2426 (MyObject_hasProperty):
2427 (MyObject_getProperty):
2428 (MyObject_setProperty):
2429 (MyObject_deleteProperty):
2430 (MyObject_getPropertyList):
2431 (MyObject_callAsFunction):
2432 (MyObject_callAsConstructor):
2433 (MyObject_convertToType):
2434 (print_callAsFunction):
2435 (myConstructor_callAsConstructor):
2437 * JavaScriptCore.exp:
2439 (KJS::ExecState::exceptionHandle):
2441 2006-07-10 Geoffrey Garen <ggaren@apple.com>
2445 Improved type safety by implementing opaque JSValue/JSObject typing through
2446 abuse of 'const', not void*. Also fixed an alarming number of bugs
2447 exposed by this new type safety.
2449 I made one design change in JavaScriptCore, which is that the JSObject
2450 constructor should take a JSValue* as its prototype argument, not a JSObject*,
2451 since we allow the prototype to be any JSValue*, including jsNull(), for
2457 * API/JSCallbackConstructor.cpp:
2458 (KJS::JSCallbackConstructor::construct):
2459 * API/JSCallbackFunction.cpp:
2460 (KJS::JSCallbackFunction::callAsFunction):
2461 * API/JSCallbackObject.cpp:
2462 (KJS::JSCallbackObject::JSCallbackObject):
2463 (KJS::JSCallbackObject::getOwnPropertySlot):
2464 (KJS::JSCallbackObject::put):
2465 (KJS::JSCallbackObject::construct):
2466 (KJS::JSCallbackObject::callAsFunction):
2467 (KJS::JSCallbackObject::staticFunctionGetter):
2468 * API/JSCallbackObject.h:
2469 * API/JSContextRef.cpp:
2472 (JSNodePrototype_appendChild):
2473 (JSNodePrototype_removeChild):
2474 (JSNodePrototype_replaceChild):
2475 * API/JSObjectRef.cpp:
2477 (JSFunctionMakeWithBody):
2478 (JSObjectGetProperty):
2479 (JSObjectCallAsFunction):
2480 (JSObjectCallAsConstructor):
2481 * API/JSObjectRef.h:
2486 (KJS::JSObject::JSObject):
2488 2006-07-10 Geoffrey Garen <ggaren@apple.com>
2490 Approved by Maciej, Darin.
2492 Renamed JSStringBufferRef to JSInternalStringRef. "Internal string" means the
2493 JavaScript engine's internal string representation, which is the most
2494 low-level and efficient representation to use when interfacing with JavaScript.
2500 * API/JSCallbackObject.cpp:
2501 (KJS::JSCallbackObject::getOwnPropertySlot):
2502 (KJS::JSCallbackObject::put):
2503 (KJS::JSCallbackObject::deleteProperty):
2504 (KJS::JSCallbackObject::staticValueGetter):
2505 (KJS::JSCallbackObject::callbackGetter):
2506 * API/JSContextRef.cpp:
2509 * API/JSContextRef.h:
2510 * API/JSInternalStringRef.cpp: Added.
2512 (JSInternalStringCreate):
2513 (JSInternalStringCreateUTF8):
2514 (JSInternalStringRetain):
2515 (JSInternalStringRelease):
2516 (JSValueCopyStringValue):
2517 (JSInternalStringGetLength):
2518 (JSInternalStringGetCharactersPtr):
2519 (JSInternalStringGetCharacters):
2520 (JSInternalStringGetMaxLengthUTF8):
2521 (JSInternalStringGetCharactersUTF8):
2522 (JSInternalStringIsEqual):
2523 (JSInternalStringIsEqualUTF8):
2524 (JSInternalStringCreateCF):
2525 (CFStringCreateWithJSInternalString):
2526 * API/JSInternalStringRef.h: Added.
2528 (JSNodePrototype_appendChild):
2529 (JSNode_getNodeType):
2530 (JSNode_getChildNodes):
2531 (JSNode_getFirstChild):
2533 (JSNodeList_length):
2534 (JSNodeList_getProperty):
2535 * API/JSObjectRef.cpp:
2536 (JSFunctionMakeWithBody):
2537 (JSObjectGetDescription):
2538 (JSObjectHasProperty):
2539 (JSObjectGetProperty):
2540 (JSObjectSetProperty):
2541 (JSObjectDeleteProperty):
2542 (JSPropertyEnumeratorGetNext):
2543 (JSPropertyListAdd):
2544 * API/JSObjectRef.h:
2545 * API/JSStringBufferRef.cpp: Removed.
2546 * API/JSStringBufferRef.h: Removed.
2548 * API/JavaScriptCore.h:
2553 (assertEqualsAsUTF8String):
2554 (assertEqualsAsCharactersPtr):
2555 (assertEqualsAsCharacters):
2556 (MyObject_hasProperty):
2557 (MyObject_getProperty):
2558 (MyObject_setProperty):
2559 (MyObject_deleteProperty):
2560 (MyObject_getPropertyList):
2561 (print_callAsFunction):
2562 (myConstructor_callAsConstructor):
2564 * JavaScriptCore.exp:
2565 * JavaScriptCore.xcodeproj/project.pbxproj:
2567 2006-07-08 Tim Omernick <timo@apple.com>
2571 Added an OpenGL drawing model to the Netscape Plug-in API.
2575 2006-07-08 Timothy Hatcher <timothy@apple.com>
2579 Moved KJS_GetCreatedJavaVMs to jni_utility.cpp.
2580 Switched KJS_GetCreatedJavaVMs over to use dlopen and dlsym
2581 now that NSAddImage, NSLookupSymbolInImage and NSAddressOfSymbol
2582 are deprecated in Leopard.
2584 * JavaScriptCore.exp:
2585 * JavaScriptCore.xcodeproj/project.pbxproj:
2586 * bindings/jni/jni_utility.cpp:
2587 (KJS::Bindings::KJS_GetCreatedJavaVMs):
2588 * bindings/softlinking.c: Removed.
2589 * bindings/softlinking.h: Removed.
2591 2006-07-08 Geoffrey Garen <ggaren@apple.com>
2595 - Make JSObjectGetProperty return a JSValue or NULL, like JSEvaluate does.
2597 * API/JSObjectRef.cpp:
2598 (JSObjectGetProperty):
2599 * API/JSObjectRef.h:
2603 2006-07-08 Geoffrey Garen <ggaren@apple.com>
2605 Style change -- no review necessary.
2607 Use 0 instead of NULL in API .cpp files, to match our style guidelines.
2609 * API/JSContextRef.cpp:
2611 * API/JSObjectRef.cpp:
2612 (JSFunctionMakeWithBody):
2613 (JSObjectCallAsFunction):
2614 (JSObjectCallAsConstructor):
2615 * API/JSValueRef.cpp:
2618 2006-07-08 Geoffrey Garen <ggaren@apple.com>
2622 - Added ability to pass NULL for thisObject when calling JSObjectCallAsFunction,
2623 to match JSEvaluate.
2625 * API/JSObjectRef.cpp:
2626 (JSObjectCallAsFunction):
2627 * API/JSObjectRef.h:
2631 === Safari-521.15 ===
2633 2006-07-07 Geoffrey Garen <ggaren@apple.com>
2637 - Standardized which functions take a JSContext as an argument. The rule is:
2638 if you might execute JavaScript, you take a JSContext, otherwise you don't.
2640 The FIXME in JSObjectRef.h requires refactoring some parts of Interpreter,
2641 but not API changes, so I'm putting it off until later.
2643 * API/JSCallbackObject.cpp:
2644 (KJS::JSCallbackObject::JSCallbackObject):
2645 (KJS::JSCallbackObject::init):
2646 * API/JSCallbackObject.h:
2647 * API/JSContextRef.cpp:
2649 * API/JSContextRef.h:
2650 * API/JSObjectRef.cpp:
2652 (JSPropertyEnumeratorGetNext):
2653 * API/JSObjectRef.h:
2655 (MyObject_initialize):
2657 * JavaScriptCore.exp:
2658 * kjs/array_object.cpp:
2659 (ArrayInstance::setLength):
2660 (ArrayInstance::pushUndefinedObjectsToEnd):
2662 (ForInNode::execute):
2663 * kjs/reference.cpp:
2664 (KJS::Reference::getPropertyName):
2665 (KJS::Reference::getValue):
2667 * kjs/scope_chain.cpp:
2668 (KJS::ScopeChain::print):
2670 2006-07-06 Geoffrey Garen <ggaren@apple.com>
2676 - Headerdoc finished
2679 - Added a JSContextRef argument to many functions, because you need a
2680 JSContextRef for doing virtually anything. I expect to add this argument
2681 to even more functions in a future patch.
2683 - Removed the globalObjectPrototype argument to JSContextCreate because
2684 you can't create an object until you have a context, so it's impossible
2685 to pass a prototype object to JSContextCreate. That's OK because (1) there's
2686 no reason to give the global object a prototype and (2) if you really want
2687 to, you can just use a separate call to JSObjectSetPrototype.
2689 - Removed the JSClassRef argument to JSClassCreate because it was unnecessary,
2690 and you need to be able to make the global object's class before you've
2691 created a JSContext.
2693 - Added an optional exception parameter to JSFunctionMakeWithBody because anything
2694 less would be uncivilized.
2696 - Made the return value parameter to JSObjectGetProperty optional to match
2697 all other return value parameters in the API.
2699 - Made JSObjectSetPrivate/JSObjectGetPrivate work on JSCallbackFunctions
2700 and JSCallbackConstructors. You could use an abstract base class or strategic
2701 placement of m_privateData in the class structure to implement this, but
2702 the former seemed like overkill, and the latter seemed too dangerous.
2704 - Fixed a bug where JSPropertyEnumeratorGetNext would skip the first property.
2707 - Reversed the logic of the JSChar #ifdef to avoid confusing headerdoc
2709 - Removed function names from @function declarations because headeroc
2710 can parse them automatically, and I wanted to rule out manual mismatch.
2712 - Changed Error::create to take a const UString& instead of a UString*
2713 because it was looking at me funny.
2715 - Renamed JSStringBufferCreateWithCFString to JSStringBufferCreateCF
2716 because the latter is more concise and it matches JSStringBufferCreateUTF8.
2718 * API/JSCallbackObject.cpp:
2719 (KJS::JSCallbackObject::getOwnPropertySlot):
2720 (KJS::JSCallbackObject::put):
2721 (KJS::JSCallbackObject::deleteProperty):
2722 (KJS::JSCallbackObject::getPropertyList):
2723 (KJS::JSCallbackObject::toBoolean):
2724 (KJS::JSCallbackObject::toNumber):
2725 (KJS::JSCallbackObject::toString):
2726 * API/JSClassRef.cpp:
2728 * API/JSContextRef.cpp:
2730 (JSContextSetException):
2731 * API/JSContextRef.h:
2733 (JSNodePrototype_class):
2736 (JSNodeListPrototype_class):
2738 * API/JSObjectRef.cpp:
2739 (JSObjectGetProperty):
2740 (JSObjectGetPrivate):
2741 (JSObjectSetPrivate):
2742 (JSObjectCallAsFunction):
2743 (JSObjectCallAsConstructor):
2744 (JSPropertyEnumeratorGetNext):
2745 * API/JSObjectRef.h:
2746 * API/JSStringBufferRef.cpp:
2747 (JSStringBufferCreateCF):
2748 * API/JSStringBufferRef.h:
2749 * API/JSValueRef.cpp:
2750 (JSValueIsInstanceOf):
2756 (MyObject_hasProperty):
2757 (MyObject_setProperty):
2758 (MyObject_deleteProperty):
2759 (MyObject_getPropertyList):
2760 (MyObject_convertToType):
2763 * JavaScriptCore.exp:
2765 2006-07-07 Geoffrey Garen <ggaren@apple.com>
2769 - Fixed a few crashes resulting from NULL parameters to JSClassCreate.
2771 * API/JSClassRef.cpp:
2774 * API/testapi.c: Added test for NULL parameters.
2777 2006-07-07 Geoffrey Garen <ggaren@apple.com>
2779 Reviewed by John, mocked by Darin.
2781 - Changed JSEvaluate to take a JSObjectRef instead of a JSValueRef as
2782 "this," since "this" must be an object.
2784 * API/JSContextRef.cpp:
2786 * API/JSContextRef.h:
2788 2006-07-07 Geoffrey Garen <ggaren@apple.com>
2795 * JavaScriptCore.xcodeproj/project.pbxproj:
2797 2006-07-05 Geoffrey Garen <ggaren@apple.com>
2801 Renamed JSCharBufferRef, which was universally unpopular, to JSStringBufferRef,
2802 which, hopefully, will be less unpopular.
2808 * API/JSCallbackObject.cpp:
2809 (KJS::JSCallbackObject::getOwnPropertySlot):
2810 (KJS::JSCallbackObject::put):
2811 (KJS::JSCallbackObject::deleteProperty):
2812 (KJS::JSCallbackObject::staticValueGetter):
2813 (KJS::JSCallbackObject::callbackGetter):
2814 * API/JSCharBufferRef.cpp: Removed.
2815 * API/JSCharBufferRef.h: Removed.
2816 * API/JSContextRef.cpp:
2819 * API/JSContextRef.h:
2821 (JSNodePrototype_appendChild):
2822 (JSNode_getNodeType):
2823 (JSNode_getChildNodes):
2824 (JSNode_getFirstChild):
2826 (JSNodeList_length):
2827 (JSNodeList_getProperty):
2828 * API/JSObjectRef.cpp:
2829 (JSFunctionMakeWithBody):
2830 (JSObjectGetDescription):
2831 (JSObjectHasProperty):
2832 (JSObjectGetProperty):
2833 (JSObjectSetProperty):
2834 (JSObjectDeleteProperty):
2835 (JSPropertyEnumeratorGetNext):
2836 (JSPropertyListAdd):
2837 * API/JSObjectRef.h:
2838 * API/JSStringBufferRef.cpp: Added.
2840 (JSStringBufferCreate):
2841 (JSStringBufferCreateUTF8):
2842 (JSStringBufferRetain):
2843 (JSStringBufferRelease):
2844 (JSValueCopyStringValue):
2845 (JSStringBufferGetLength):
2846 (JSStringBufferGetCharactersPtr):
2847 (JSStringBufferGetCharacters):
2848 (JSStringBufferGetMaxLengthUTF8):
2849 (JSStringBufferGetCharactersUTF8):
2850 (JSStringBufferIsEqual):
2851 (JSStringBufferIsEqualUTF8):
2852 (JSStringBufferCreateWithCFString):
2853 (CFStringCreateWithJSStringBuffer):
2854 * API/JSStringBufferRef.h: Added.
2856 * API/JavaScriptCore.h:
2861 (assertEqualsAsUTF8String):
2862 (assertEqualsAsCharactersPtr):
2863 (assertEqualsAsCharacters):
2864 (MyObject_hasProperty):
2865 (MyObject_getProperty):
2866 (MyObject_setProperty):
2867 (MyObject_deleteProperty):
2868 (MyObject_getPropertyList):
2869 (print_callAsFunction):
2870 (myConstructor_callAsConstructor):
2872 * JavaScriptCore.exp:
2873 * JavaScriptCore.xcodeproj/project.pbxproj:
2875 2006-07-05 Geoffrey Garen <ggaren@apple.com>
2879 Moved some code around for more logical file separation.
2882 * API/JSContextRef.h:
2883 * API/JSObjectRef.cpp:
2884 * API/JSValueRef.cpp:
2888 2006-07-03 Geoffrey Garen <ggaren@apple.com>
2892 Implemented JSFunctionMakeWithBody, which parses a script as a function body
2893 in the global scope, and returns the resulting anonymous function.
2895 I also removed private data from JSCallbackFunction. It never worked,
2896 since JSCallbackFunction doesn't inherit from JSCallbackObject.
2898 * API/JSCallbackConstructor.cpp: Removed.
2899 * API/JSCallbackConstructor.h: Removed.
2900 * API/JSCallbackFunction.cpp:
2901 (KJS::JSCallbackFunction::JSCallbackFunction):
2902 (KJS::JSCallbackFunction::implementsConstruct):
2903 (KJS::JSCallbackFunction::construct):
2904 (KJS::JSCallbackFunction::implementsCall):
2905 (KJS::JSCallbackFunction::callAsFunction):
2906 * API/JSCallbackFunction.h:
2907 * API/JSCallbackObject.cpp:
2908 (KJS::JSCallbackObject::staticFunctionGetter):
2909 * API/JSObjectRef.cpp:
2911 (JSFunctionMakeWithCallbacks):
2912 * API/JSObjectRef.h:
2918 * JavaScriptCore.exp: Programmatically added all symbols exported by
2919 API object files, and sorted results
2920 * JavaScriptCore.xcodeproj/project.pbxproj:
2922 2006-07-03 Geoffrey Garen <ggaren@apple.com>
2926 - Return syntax error in JSCheckSyntax through a JSValueRef* exception
2930 * API/JSContextRef.cpp:
2934 * JavaScriptCore.exp:
2935 * kjs/interpreter.cpp:
2936 (KJS::Interpreter::checkSyntax):
2937 * kjs/interpreter.h:
2939 2006-07-04 Darin Adler <darin@apple.com>
2943 * wtf/MathExtras.h: Oops. Added missing #endif.
2945 2006-07-04 Bjoern Graf <bjoern.graf@gmail.com>
2948 Tweaked a bit by Darin.
2950 - http://bugs.webkit.org/show_bug.cgi?id=9678
2951 work around MSVCRT's fmod function returning NaN for fmod(x, infinity) instead of x
2953 * wtf/MathExtras.h: Added include of <float.h>.
2954 (isinf): Fix to return false for NAN.
2955 (wtf_fmod): Added. An inline that works around the bug.
2958 * kjs/number_object.cpp:
2959 * kjs/operations.cpp:
2961 Added includes of MathExtras.h to all files using fmod.
2963 * JavaScriptCore.xcodeproj/project.pbxproj: Let Xcode 2.3 have its way with
2966 2006-07-01 Geoffrey Garen <ggaren@apple.com>
2970 - Refined value conversions in the API:
2971 - failed toNumber returns NaN
2972 - failed toObject returns NULL
2973 - failed toString returns empty string
2975 - Refined excpetion handling in the API:
2976 - failed value conversions do not throw exceptions
2977 - uncaught exceptions in JSEvaluate, JSObjectCallAsFunction, and
2978 JSObjectCallAsConstructor are returned through a JSValueRef* exception
2980 - removed JSContextHasException, because JSContextGetException does
2984 * API/JSCharBufferRef.cpp:
2985 (JSValueCopyStringValue):
2986 * API/JSContextRef.cpp:
2988 * API/JSContextRef.h:
2989 * API/JSNodeList.c: Added test code demonstrating how you would use
2990 toNumber, and why you probably don't need toUInt32, etc.
2991 (JSNodeListPrototype_item):
2992 (JSNodeList_getProperty):
2993 * API/JSObjectRef.cpp:
2995 (JSObjectCallAsFunction):
2996 (JSObjectCallAsConstructor):
2997 * API/JSObjectRef.h:
2998 * API/JSValueRef.cpp:
3004 (main): Added tests for new rules, and call to JSGCProtect to fix Intel
3006 * JavaScriptCore.exp:
3008 2006-07-03 Darin Adler <darin@apple.com>
3010 - Rolled out HashMap implementation of NPRuntime, at least temporarily.
3012 Fixes hang in the bindings section of layout tests seen on the
3015 This code was using HashMap<const char*, PrivateIdentifier*>.
3016 But that hashes based on pointer identity, not string value.
3017 The default hash for any pointer type is to hash based on the pointer.
3018 And WTF doesn't currently have a string hash for char*.
3019 We'll need to fix that before re-landing this patch.
3021 (Formatting was also incorrect -- extra spaces in parentheses.)
3023 * bindings/npruntime.cpp: Rolled out last change.
3025 2006-07-02 Justin Haygood <jhaygood@spsu.edu>
3027 Reviewed, tweaked, landed by ggaren.
3029 - Port NPRuntime from CFDictionary to HashMap.
3031 * bindings/npruntime.cpp:
3032 (getStringIdentifierDictionary):
3033 (getIntIdentifierDictionary):
3034 (_NPN_GetStringIdentifier):
3035 (_NPN_GetIntIdentifier):
3036 * bindings/npruntime.h:
3038 2006-07-01 Geoffrey Garen <ggaren@apple.com>
3042 - Fixed <rdar://problem/4611197> REGRESSION: Liveconnect with Java test
3043 fails at http://www-sor.inria.fr/~dedieu/notes/liveconnect/simple_example.html
3045 * JavaScriptCore.exp: Export symbols used by liveconnect
3047 2006-06-29 Geoffrey Garen <ggaren@apple.com>
3051 - Phase 2 in the JS API.
3053 - Added support for specifying static tables of values -- this should
3054 obviate the need for using complicated callbacks for most lookups.
3056 - API objects are now created with classes (JSClassRef) -- in order to support
3057 static values, and in order to prevent API objects from storing their
3058 data inline, and thus falling into the oversized (read: slow and prone to
3059 giving Maciej the frowny face) heap.
3061 - Added two specialized JSObject subclasses -- JSCallbackFunction and JSCallbackConstructor --
3062 to allow JSFunctionMake and JSConstructorMake to continue to work with
3063 the new class model. Another solution to this problem would be to create
3064 a custom class object for each function and constructor you make. This
3065 solution is more code but also more efficient.
3067 - Substantially beefed up the minidom example to demonstrate and test a
3068 lot of these techniques. Its output is still pretty haphazard, though.
3070 - Gave the <kjs/ preface to some includes -- I'm told this matters to
3071 building on some versions of Linux.
3073 - Implemented JSValueIsInstanceOf and JSValueIsObjectOfClass
3075 - Removed GetDescription callback. Something in the class datastructure
3076 should take care of this.
3079 * API/JSCallbackConstructor.cpp: Added.
3081 (KJS::JSCallbackConstructor::JSCallbackConstructor):
3082 (KJS::JSCallbackConstructor::implementsConstruct):
3083 (KJS::JSCallbackConstructor::construct):
3084 (KJS::JSCallbackConstructor::setPrivate):
3085 (KJS::JSCallbackConstructor::getPrivate):
3086 * API/JSCallbackConstructor.h: Added.
3087 (KJS::JSCallbackConstructor::classInfo):
3088 * API/JSCallbackFunction.cpp: Added.
3090 (KJS::JSCallbackFunction::JSCallbackFunction):
3091 (KJS::JSCallbackFunction::implementsCall):
3092 (KJS::JSCallbackFunction::callAsFunction):
3093 (KJS::JSCallbackFunction::setPrivate):
3094 (KJS::JSCallbackFunction::getPrivate):
3095 * API/JSCallbackFunction.h: Added.
3096 (KJS::JSCallbackFunction::classInfo):
3097 * API/JSCallbackObject.cpp:
3099 (KJS::JSCallbackObject::JSCallbackObject):
3100 (KJS::JSCallbackObject::init):
3101 (KJS::JSCallbackObject::~JSCallbackObject):
3102 (KJS::JSCallbackObject::className):
3103 (KJS::JSCallbackObject::getOwnPropertySlot):
3104 (KJS::JSCallbackObject::put):
3105 (KJS::JSCallbackObject::deleteProperty):
3106 (KJS::JSCallbackObject::implementsConstruct):
3107 (KJS::JSCallbackObject::construct):
3108 (KJS::JSCallbackObject::implementsCall):
3109 (KJS::JSCallbackObject::callAsFunction):
3110 (KJS::JSCallbackObject::getPropertyList):
3111 (KJS::JSCallbackObject::toBoolean):
3112 (KJS::JSCallbackObject::toNumber):
3113 (KJS::JSCallbackObject::toString):
3114 (KJS::JSCallbackObject::inherits):
3115 (KJS::JSCallbackObject::staticValueGetter):
3116 (KJS::JSCallbackObject::staticFunctionGetter):
3117 (KJS::JSCallbackObject::callbackGetter):
3118 * API/JSCallbackObject.h:
3119 * API/JSCharBufferRef.cpp:
3120 * API/JSClassRef.cpp: Added.
3124 * API/JSClassRef.h: Added.
3125 (StaticValueEntry::StaticValueEntry):
3126 (StaticFunctionEntry::StaticFunctionEntry):
3127 (__JSClass::__JSClass):
3128 * API/JSContextRef.cpp:
3131 * API/JSContextRef.h:
3132 * API/JSNode.c: Added.
3133 (JSNodePrototype_appendChild):
3134 (JSNodePrototype_removeChild):
3135 (JSNodePrototype_replaceChild):
3136 (JSNodePrototype_class):
3137 (JSNode_getNodeType):
3138 (JSNode_getChildNodes):
3139 (JSNode_getFirstChild):
3145 * API/JSNode.h: Added.
3146 * API/JSNodeList.c: Added.
3147 (JSNodeListPrototype_item):
3148 (JSNodeListPrototype_class):
3149 (JSNodeList_length):
3150 (JSNodeList_getProperty):
3151 (JSNodeList_finalize):
3153 (JSNodeList_prototype):
3155 * API/JSNodeList.h: Added.
3156 * API/JSObjectRef.cpp:
3159 (JSConstructorMake):
3160 (__JSPropertyEnumerator::__JSPropertyEnumerator):
3161 (JSObjectCreatePropertyEnumerator):
3162 (JSPropertyEnumeratorGetNext):
3163 (JSPropertyEnumeratorRetain):
3164 (JSPropertyEnumeratorRelease):
3165 * API/JSObjectRef.h:
3166 (__JSObjectCallbacks::):
3167 * API/JSValueRef.cpp:
3168 (JSValueIsObjectOfClass):
3169 (JSValueIsInstanceOf):
3171 * API/Node.c: Added.
3175 (Node_replaceChild):
3178 * API/Node.h: Added.
3179 * API/NodeList.c: Added.
3185 * API/NodeList.h: Added.
3189 (createStringWithContentsOfFile):
3192 (assertEqualsAsCharacters):
3193 (MyObject_getProperty):
3195 (myConstructor_callAsConstructor):
3198 * JavaScriptCore.xcodeproj/project.pbxproj:
3200 2006-06-26 Kevin Ollivier <kevino@theolliviers.com>
3202 Reviewed and tweaked by Darin.
3204 - Compile fixes for wx port / gcc 4.0.2
3206 * kjs/array_object.cpp:
3207 Added missing headers.
3210 gcc needs class prototypes before defining those classes as friend classes
3212 2006-06-30 Mike Emmel <mike.emmel@gmail.com>
3216 Compilation fixes for Linux/Gdk.
3218 * JavaScriptCore/kjs/interpreter.cpp: added include of signal.h
3219 * JavaScriptCore/kjs/ExecState.h: added missing class declaration
3220 * JavaScriptCore/kjs/ExecState.cpp: case wrong on include of context.h
3221 * JavaScriptCore/JavaScriptCoreSources.bkl: added Context.cpp and ExecState.cpp
3223 === Safari-521.14 ===
3225 2006-06-29 Maciej Stachowiak <mjs@apple.com>
3229 - add headerdoc comments to some of the new JS API headers
3234 2006-06-28 Timothy Hatcher <timothy@apple.com>
3236 Prefer the Stabs debugging symbols format until DWARF bugs are fixed.
3238 * JavaScriptCore.xcodeproj/project.pbxproj:
3240 2006-06-27 Timothy Hatcher <timothy@apple.com>
3244 <rdar://problem/4448350> Deprecated ObjC language API used in JavaScriptCore, WebCore, WebKit and WebBrowser
3246 Switch to the new ObjC 2 API, ifdefed the old code around OBJC_API_VERSION so it still works on Tiger.
3247 Removed the use of the old stringWithCString, switched to the new Tiger version that accepts an encoding.
3248 Lots of code style cleanup.
3250 * JavaScriptCore.xcodeproj/project.pbxproj:
3251 * bindings/objc/objc_class.h:
3252 * bindings/objc/objc_class.mm:
3253 (KJS::Bindings::ObjcClass::~ObjcClass):
3254 (KJS::Bindings::_createClassesByIsAIfNecessary):
3255 (KJS::Bindings::ObjcClass::classForIsA):
3256 (KJS::Bindings::ObjcClass::name):
3257 (KJS::Bindings::ObjcClass::methodsNamed):
3258 (KJS::Bindings::ObjcClass::fieldNamed):
3259 (KJS::Bindings::ObjcClass::fallbackObject):
3260 * bindings/objc/objc_header.h:
3261 * bindings/objc/objc_instance.h:
3262 * bindings/objc/objc_instance.mm:
3263 (ObjcInstance::ObjcInstance):
3264 (ObjcInstance::~ObjcInstance):
3265 (ObjcInstance::operator=):
3266 (ObjcInstance::begin):
3267 (ObjcInstance::end):
3268 (ObjcInstance::getClass):
3269 (ObjcInstance::invokeMethod):
3270 (ObjcInstance::invokeDefaultMethod):
3271 (ObjcInstance::setValueOfField):
3272 (ObjcInstance::supportsSetValueOfUndefinedField):
3273 (ObjcInstance::setValueOfUndefinedField):
3274 (ObjcInstance::getValueOfField):
3275 (ObjcInstance::getValueOfUndefinedField):
3276 (ObjcInstance::defaultValue):
3277 (ObjcInstance::stringValue):
3278 (ObjcInstance::numberValue):
3279 (ObjcInstance::booleanValue):
3280 (ObjcInstance::valueOf):
3281 * bindings/objc/objc_runtime.h:
3282 * bindings/objc/objc_runtime.mm:
3283 (ObjcMethod::ObjcMethod):
3285 (ObjcMethod::getMethodSignature):
3286 (ObjcMethod::setJavaScriptName):
3289 (ObjcField::valueFromInstance):
3290 (convertValueToObjcObject):
3291 (ObjcField::setValueToInstance):
3292 (ObjcArray::operator=):
3293 (ObjcArray::setValueAt):
3294 (ObjcArray::valueAt):
3295 (ObjcFallbackObjectImp::ObjcFallbackObjectImp):
3296 (ObjcFallbackObjectImp::callAsFunction):
3297 (ObjcFallbackObjectImp::defaultValue):
3299 2006-06-28 Anders Carlsson <acarlsson@apple.com>
3303 http://bugs.webkit.org/show_bug.cgi?id=8636
3304 REGRESSION: JavaScript access to Java applet causes hang (_webViewURL not implemented)
3306 * bindings/jni/jni_objc.mm:
3307 (KJS::Bindings::dispatchJNICall):
3308 Just pass nil as the calling URL. This will cause the Java plugin to use the URL of the page
3309 containing the applet (which is what we used to do).
3311 2006-06-27 Timothy Hatcher <timothy@apple.com>
3315 <rdar://problem/4406785> Add an export file to TOT JavaScriptCore like the Safari-2-0-branch
3317 * JavaScriptCore.exp: Added.
3318 * JavaScriptCore.xcodeproj/project.pbxproj:
3320 2006-06-25 Geoffrey Garen <ggaren@apple.com>
3324 - Added JSConstructorMake to match JSFunctionMake, along with test code.
3326 [ I checked in the ChangeLog before without the actual files. ]
3328 * API/JSObjectRef.cpp:
3329 (JSConstructorMake):
3330 * API/JSObjectRef.h:
3332 (myConstructor_callAsConstructor):
3336 * JavaScriptCore.xcodeproj/project.pbxproj: Moved testapi.c to the testapi
3337 target -- this was an oversight in my earlier check-in.
3339 2006-06-25 Timothy Hatcher <timothy@apple.com>
3343 Bug 9574: Drosera should show inline scripts within the original HTML
3344 http://bugs.webkit.org/show_bug.cgi?id=9574
3346 Pass the starting line number and error message to the debugger.
3349 (Debugger::sourceParsed):
3352 (KJS::GlobalFuncImp::callAsFunction):
3353 * kjs/function_object.cpp:
3354 (FunctionObjectImp::construct):
3355 * kjs/interpreter.cpp:
3356 (KJS::Interpreter::evaluate):
3358 2006-06-24 Alexey Proskuryakov <ap@nypop.com>
3360 Rubber-stamped by Eric.
3362 Add a -h (do not follow symlinks) option to ln in derived sources build script (without it,
3363 a symlink was created inside the source directory on second build).
3365 * JavaScriptCore.xcodeproj/project.pbxproj:
3367 2006-06-24 David Kilzer <ddkilzer@kilzer.net>
3369 Reviewed by Timothy.
3371 * Info.plist: Fixed copyright to include 2003-2006.
3373 2006-06-24 Alexey Proskuryakov <ap@nypop.com>
3377 - http://bugs.webkit.org/show_bug.cgi?id=9418
3378 WebKit will not build when Space exists in path
3380 * JavaScriptCore.xcodeproj/project.pbxproj: Enclose search paths in quotes; create symlinks to
3381 avoid passing paths with spaces to make.
3383 2006-06-23 Timothy Hatcher <timothy@apple.com>
3387 Adding more operator[] overloads for long and short types.
3390 (WTF::Vector::operator[]):
3392 === JavaScriptCore-521.13 ===
3394 2006-06-22 Alexey Proskuryakov <ap@nypop.com>
3398 - http://bugs.webkit.org/show_bug.cgi?id=9539
3399 Another case error preventing build
3401 * API/JSObjectRef.cpp: Changed "identifier.h" to "Identifier.h"
3403 2006-06-22 David Kilzer <ddkilzer@kilzer.net>
3407 http://bugs.webkit.org/show_bug.cgi?id=9539
3408 Another case error preventing build
3410 * API/APICast.h: Changed "UString.h" to "ustring.h".
3412 2006-06-21 Geoffrey Garen <ggaren@apple.com>
3414 Fixed release build, fixed accidental infinite recursion due to
3415 last minute global replace gone awry.
3420 (assertEqualsAsBoolean):
3421 (assertEqualsAsNumber):
3422 (assertEqualsAsUTF8String):
3423 (assertEqualsAsCharactersPtr):
3424 * JavaScriptCore.xcodeproj/project.pbxproj:
3426 2006-06-21 Geoffrey Garen <ggaren@apple.com>
3430 - First cut at C API to JavaScript. Includes a unit test, 'testapi.c',
3431 and the outline of a test app, 'minidom.c'.
3433 Includes one change to JSC internals: Rename propList to getPropertyList and have it
3434 take its target property list by reference so that subclasses can
3435 add properties to the list before calling through to their superclasses.
3437 Also, I just ran prepare-ChangeLog in about 10 seconds, and I would like
3438 to give a shout-out to that.
3440 * API/APICast.h: Added.
3443 * API/JSBase.h: Added.
3444 * API/JSCallbackObject.cpp: Added.
3446 (KJS::JSCallbackObject::JSCallbackObject):
3447 (KJS::JSCallbackObject::~JSCallbackObject):
3448 (KJS::JSCallbackObject::className):
3449 (KJS::JSCallbackObject::getOwnPropertySlot):
3450 (KJS::JSCallbackObject::put):
3451 (KJS::JSCallbackObject::deleteProperty):
3452 (KJS::JSCallbackObject::implementsConstruct):
3453 (KJS::JSCallbackObject::construct):
3454 (KJS::JSCallbackObject::implementsCall):
3455 (KJS::JSCallbackObject::callAsFunction):
3456 (KJS::JSCallbackObject::getPropertyList):
3457 (KJS::JSCallbackObject::toBoolean):
3458 (KJS::JSCallbackObject::toNumber):
3459 (KJS::JSCallbackObject::toString):
3460 (KJS::JSCallbackObject::setPrivate):
3461 (KJS::JSCallbackObject::getPrivate):
3462 (KJS::JSCallbackObject::cachedValueGetter):
3463 (KJS::JSCallbackObject::callbackGetter):
3464 * API/JSCallbackObject.h: Added.
3465 (KJS::JSCallbackObject::classInfo):
3466 * API/JSCharBufferRef.cpp: Added.
3468 (JSCharBufferCreate):
3469 (JSCharBufferCreateUTF8):
3470 (JSCharBufferRetain):
3471 (JSCharBufferRelease):
3472 (JSValueCopyStringValue):
3473 (JSCharBufferGetLength):
3474 (JSCharBufferGetCharactersPtr):
3475 (JSCharBufferGetCharacters):
3476 (JSCharBufferGetMaxLengthUTF8):
3477 (JSCharBufferGetCharactersUTF8):
3478 (JSCharBufferIsEqual):
3479 (JSCharBufferIsEqualUTF8):
3480 (JSCharBufferCreateWithCFString):
3481 (CFStringCreateWithJSCharBuffer):
3482 * API/JSCharBufferRef.h: Added.
3483 * API/JSContextRef.cpp: Added.
3486 (JSContextGetGlobalObject):
3489 (JSContextHasException):
3490 (JSContextGetException):
3491 (JSContextClearException):
3492 (JSContextSetException):
3493 * API/JSContextRef.h: Added.
3494 * API/JSObjectRef.cpp: Added.
3498 (JSObjectGetDescription):
3499 (JSObjectGetPrototype):
3500 (JSObjectSetPrototype):
3501 (JSObjectHasProperty):
3502 (JSObjectGetProperty):
3503 (JSObjectSetProperty):
3504 (JSObjectDeleteProperty):
3505 (JSObjectGetPrivate):
3506 (JSObjectSetPrivate):
3507 (JSObjectIsFunction):
3508 (JSObjectCallAsFunction):
3509 (JSObjectIsConstructor):
3510 (JSObjectCallAsConstructor):
3511 (__JSPropertyListEnumerator::__JSPropertyListEnumerator):
3512 (JSObjectCreatePropertyEnumerator):
3513 (JSPropertyEnumeratorGetNext):
3514 (JSPropertyEnumeratorRetain):
3515 (JSPropertyEnumeratorRelease):
3516 (JSPropertyListAdd):
3517 * API/JSObjectRef.h: Added.
3518 * API/JSValueRef.cpp: Added.
3520 (JSValueIsUndefined):
3527 (JSValueIsStrictEqual):
3537 * API/JSValueRef.h: Added.
3538 * API/JavaScriptCore.h: Added.
3539 * API/minidom.c: Added.
3541 * API/minidom.html: Added.
3542 * API/minidom.js: Added.
3543 * API/testapi.c: Added.
3544 (assertEqualsAsBoolean):
3545 (assertEqualsAsNumber):
3546 (assertEqualsAsUTF8String):
3547 (assertEqualsAsCharactersPtr):
3548 (assertEqualsAsCharacters):
3549 (MyObject_initialize):
3550 (MyObject_copyDescription):
3551 (MyObject_hasProperty):
3552 (MyObject_getProperty):
3553 (MyObject_setProperty):
3554 (MyObject_deleteProperty):
3555 (MyObject_getPropertyList):
3556 (MyObject_callAsFunction):
3557 (MyObject_callAsConstructor):
3558 (MyObject_convertToType):
3559 (MyObject_finalize):
3560 (print_callAsFunction):
3562 (createStringWithContentsOfFile):
3563 * API/testapi.js: Added.
3565 * JavaScriptCore.xcodeproj/project.pbxproj:
3566 * bindings/npruntime_impl.h:
3567 * kjs/array_instance.h:
3568 * kjs/array_object.cpp:
3569 (ArrayInstance::getPropertyList):
3570 * kjs/interpreter.cpp:
3571 (KJS::Interpreter::evaluate):
3573 (ForInNode::execute):
3575 (KJS::JSObject::put):
3576 (KJS::JSObject::canPut):
3577 (KJS::JSObject::deleteProperty):
3578 (KJS::JSObject::propertyIsEnumerable):
3579 (KJS::JSObject::getPropertyAttributes):
3580 (KJS::JSObject::getPropertyList):
3582 * kjs/property_map.cpp:
3583 (KJS::PropertyMap::get):