1 2006-10-14 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
5 Define KXMLCORE_USE_CURL for platforms that wish to use CURL as
6 networking, and set it for GDK build
10 2006-10-13 Marvin Decker <marv.decker@gmail.com>
12 Reviewed by Kevin McCullough.
14 Fixes http://bugs.webkit.org/show_bug.cgi?id=11283
15 Fixes Qt/Linux and Windows build
19 * kjs/date_object.cpp:
20 (KJS::DateProtoFunc::callAsFunction):
22 2006-10-13 Kevin McCullough <KMcCullough@apple.com>
24 Reviewed by Adam, Geoff, Darin.
26 Fixed displaying the UTC offset and time zone string, as well as renamed the GregorianDateTime structure and clean up.
31 (KJS::getDSTOffsetSimple):
32 (KJS::gregorianDateTimeToMS):
33 (KJS::msToGregorianDateTime):
35 (KJS::GregorianDateTime::GregorianDateTime):
36 (KJS::GregorianDateTime::~GregorianDateTime):
37 (KJS::GregorianDateTime::toTM):
38 * kjs/date_object.cpp:
41 (KJS::formatDateUTCVariant):
43 (KJS::fillStructuresUsingTimeArgs):
44 (KJS::fillStructuresUsingDateArgs):
45 (KJS::DateInstance::getTime):
46 (KJS::DateInstance::getUTCTime):
47 (KJS::DateProtoFunc::callAsFunction):
48 (KJS::DateObjectImp::construct):
49 (KJS::DateObjectImp::callAsFunction):
50 (KJS::DateObjectFuncImp::callAsFunction):
54 2006-10-13 Kevin McCullough <KMcCullough@apple.com>
58 Gets JavaScripCore tests running on windows.
60 * Scripts/run-javascriptcore-tests:
61 * Scripts/webkitdirs.pm:
63 2006-10-12 Geoffrey Garen <ggaren@apple.com>
67 Removed JSObjectMakeWithPrototype, clarified some comments. We really
68 don't want people to manage their own prototypes, so we don't want an
69 extra function in the API devoted to just that. People can still manage
70 their own prototypes if they really want by using JSObjectSetPrototype.
73 (OpaqueJSClass::createNoAutomaticPrototype):
74 (OpaqueJSClass::create):
76 * API/JSObjectRef.cpp:
84 2006-10-12 Kevin McCullough <KMcCullough@apple.com>
92 * kjs/date_object.cpp:
95 2006-10-11 Kevin McCullough <KMcCullough@apple.com>
99 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.
104 (KJS::getDSTOffsetSimple):
110 * kjs/date_object.cpp:
113 (KJS::DateProtoFunc::callAsFunction):
114 (KJS::DateObjectImp::construct):
115 (KJS::DateObjectImp::callAsFunction):
116 (KJS::DateObjectFuncImp::callAsFunction):
120 2006-10-09 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
124 Improve gdk build compiler flags (show warning, no rtti and exceptions).
128 2006-10-06 Kevin McCullough <KMcCullough@apple.com>
132 DST and TimeZones were wrong in some cases, specifically on some of the dates where DST changes.
135 (KJS::equivalentYearForDST):
137 (KJS::getDSTOffsetSimple):
139 (KJS::dateToMseconds):
142 * kjs/date_object.cpp:
145 2006-10-05 Darin Adler <darin@apple.com>
147 Reviewed by Kevin McCullough.
149 * wtf/Assertions.cpp: Fix build when _DEBUG is not defined.
151 2006-10-04 Kevin McCullough <KMcCullough@apple.com>
155 - 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.
160 * kjs/date_object.cpp:
164 2006-10-04 Geoffrey Garen <ggaren@apple.com>
166 Patch by Darin and me, reviewed by Maciej.
168 Fixed <rdar://problem/4518397> REGRESSION(?): Oft-seen but unrepro crash
169 in JavaScript garbage collection (KJS::Collector::collect())
170 <rdar://problem/4752492> Crash in KJS::collect
172 The issue here was allocating one garbage-collected object in the midst
173 of allocating a second garbage-collected object. In such a case, the
174 zeroIfFree word lies.
177 (KJS::Collector::allocate):
178 (KJS::Collector::collect):
180 2006-10-04 Kevin McCullough <KMcCullough@apple.com>
187 (KJS::dateToDayInYear): accept and correctly handle negative months
189 2006-10-05 Kevin McCullough <KMcCullough@apple.com>
194 (KJS::dateToDayInYear):
196 2006-10-05 Mark Rowe <bdash@webkit.org>
198 Reviewed by maculloch.
202 * JavaScriptCoreSources.bkl: Add DateMath.cpp to file list.
204 2006-10-05 Kevin McCullough <KMcCullough@apple.com>
210 * JavaScriptCore.xcodeproj/project.pbxproj:
212 2006-10-04 Nikolas Zimmermann <zimmermann@kde.org>
216 Fix Qt/Linux build by adding DateMath.cpp to compilation.
218 * CMakeLists.txt: Also replace tabs with spaces.
220 2006-10-04 Kevin McCullough <KMcCullough@apple.com>
222 Reviewed by DethBakin.
224 - 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.
229 (KJS::dateToDayInYear):
231 2006-10-05 Darin Adler <darin@apple.com>
235 * wtf/Assertions.cpp: Changed assertion formatting to omit the "======"
236 lines so you can see more assertions in less space. Also improved format
237 of file/line information so it works with more development environments.
239 2006-10-04 Kevin McCullough <KMcCullough@apple.com>
243 - The build machine is more sensitive about automatic conversions. These fixes exp
244 licitly cast or change the input and return types of functions to avoid conversions.
246 * JavaScriptCore.xcodeproj/project.pbxproj:
252 (KJS::monthToDayInYear):
253 (KJS::dateToDayInYear):
254 (KJS::getDSTOffsetSimple):
256 (KJS::dateToMseconds):
259 2006-10-04 Kevin McCullough <KMcCullough@apple.com>
263 - 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.
265 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
266 * JavaScriptCore.xcodeproj/project.pbxproj:
267 * kjs/DateMath.cpp: Added.
270 (KJS::daysFrom1970ToYear):
271 (KJS::msFrom1970ToYear):
277 (KJS::msToMilliseconds):
283 (KJS::msToDayInMonth):
284 (KJS::monthToDayInYear):
285 (KJS::timeToMseconds):
286 (KJS::dateToDayInYear):
287 (KJS::equivalentYearForDST):
289 (KJS::getDSTOffsetSimple):
291 (KJS::localTimeToUTC):
292 (KJS::UTCToLocalTime):
293 (KJS::dateToMseconds):
296 * kjs/DateMath.h: Added.
298 * kjs/date_object.cpp:
301 (KJS::DateInstance::getTime):
302 (KJS::DateInstance::getUTCTime):
303 (KJS::DateProtoFunc::callAsFunction):
304 (KJS::DateObjectImp::construct):
305 (KJS::DateObjectFuncImp::callAsFunction):
310 2006-10-02 Nikolas Zimmermann <zimmermann@kde.org>
312 Reviewed/landed by Adam.
314 Build testkjs on Qt/Linux.
318 2006-10-02 Nikolas Zimmermann <zimmermann@kde.org>
320 Reviewed by eseidel. Landed by eseidel.
322 Fix win32 build, which has no inttypes.h
326 2006-10-02 Nikolas Zimmermann <zimmermann@kde.org>
328 Reviewed by eseidel & mjs. Landed by eseidel.
330 Fix Qt/Linux build with older gcc 3.3.4.
331 http://bugs.webkit.org/show_bug.cgi?id=11116
333 * kjs/lookup.h: Move cacheGlobalObject into KJS namespace.
334 (KJS::cacheGlobalObject): Also remove GCC_ROOT_NS_HACK.
335 * wtf/Assertions.h: Include inttypes.h for uintptr_t.
337 2006-09-28 Steve Falkenburg <sfalken@apple.com>
341 Use $(ConfigSuffix) set via vsprops files to add _debug
342 to end of debug filenames.
344 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
345 * JavaScriptCore.vcproj/debug.vsprops: Added.
346 * JavaScriptCore.vcproj/dftables/dftables.vcproj:
347 * JavaScriptCore.vcproj/release.vsprops: Added.
348 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
350 2006-09-28 Darin Adler <darin@apple.com>
354 - support for change that should fix <rdar://problem/4733044>
355 REGRESSION: XML iBench shows 10% perf. regression (copying
356 strings while decoding)
358 * wtf/Vector.h: Changed VectorBuffer so that the general case
359 contains an instance of the 0 case, since deriving from it
360 was violating the Liskov Substitution Principle.
361 (WTF::VectorBuffer::releaseBuffer): Added. Releases the buffer so it can
362 be adopted by another data structure that uses the FastMalloc.h allocator.
363 Returns 0 if the internal buffer was being used.
364 (WTF::Vector::releaseBuffer): Added. Releases the buffer as above or creates
365 a new one in the case where the internal buffer was being used.
367 2006-09-28 Maciej Stachowiak <mjs@apple.com>
371 - change garbage collection to happen at increments proportional to number of live objects, not always
372 every 1000 allocations
375 (KJS::Collector::allocate):
377 2006-09-28 Maciej Stachowiak <mjs@apple.com>
381 - fixed REGRESSION (r16606): javascriptCore Crash on website load
385 - fixed some possible off-by-one bugs
386 - use indexing, not iterators, for Vectors
387 - store Vector by pointer instead of by value to avoid blowing out FunctionImp size
390 (KJS::FunctionImp::addParameter):
391 (KJS::FunctionImp::parameterString):
392 (KJS::FunctionImp::processParameters):
393 (KJS::FunctionImp::lengthGetter):
394 (KJS::FunctionImp::getParameterName):
397 2006-09-27 Steve Falkenburg <sfalken@apple.com>
403 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
404 * JavaScriptCore.vcproj/JavaScriptCore/dstroot-to-sdk.cmd: Removed.
406 2006-09-27 John Sullivan <sullivan@apple.com>
409 (KJS::FunctionImp::getParameterName):
410 removed assertion that displeased gcc 4.0.1 (build 5420):
411 ASSERT(static_cast<size_t>(index) == index);
413 2006-09-27 Kevin McCullough <KMcCullough@apple.com>
417 Cleanup of previous fix which was to address Radar: 4752492
420 (KJS::FunctionImp::addParameter):
421 (KJS::FunctionImp::parameterString):
422 (KJS::FunctionImp::processParameters):
423 (KJS::FunctionImp::lengthGetter):
424 (KJS::FunctionImp::getParameterName):
427 2006-09-27 Kevin McCullough <KMcCullough@apple.com>
431 Fixes a GC stack overflow crash.
432 The change is to move from a linked list implementation of Parameters to a Vector.
433 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.
436 (KJS::Parameter::Parameter):
437 (KJS::FunctionImp::addParameter):
438 (KJS::FunctionImp::parameterString):
439 (KJS::FunctionImp::processParameters):
440 (KJS::FunctionImp::lengthGetter):
441 (KJS::FunctionImp::getParameterName):
444 2006-09-27 Steve Falkenburg <sfalken@apple.com>
448 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
450 2006-09-27 Steve Falkenburg <sfalken@apple.com>
452 Set path before build.
454 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
456 2006-09-27 Sean Gies <seangies@apple.com>
458 Reviewed by Adam Roben.
460 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Debug config should link to debug runtime.
461 * JavaScriptCore.vcproj/dftables/dftables.vcproj: Debug config should link to debug runtime.
463 2006-09-27 Don Melton <gramps@apple.com>
465 Reviewed by Adam Roben.
467 Changed line ending from DOS to UNIX format so it doesn't die running
470 * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
472 2006-09-23 Alexey Proskuryakov <ap@nypop.com>
476 http://bugs.webkit.org/show_bug.cgi?id=10183
477 REGRESSION: obfuscated JS decoding breaks because of soft hyphen removal
478 (Fanfiction.net author pages not listing stories)
480 Rolled out the fix for bug 4139.
485 * tests/mozilla/ecma/Array/15.4.5.1-1.js:
486 * tests/mozilla/expected.html:
488 2006-09-22 Steve Falkenburg <sfalken@apple.com>
492 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
494 2006-09-22 Darin Adler <darin@apple.com>
498 * wtf/Vector.h: Add an append that takes a pointer and length.
499 Generalize the existing Vector append to work on vectors with
500 any value for inlineCapacity. Change the append algorithm so
501 it doesn't check capacity each time through the loop.
503 2006-09-22 Steve Falkenburg <sfalken@apple.com>
507 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
509 2006-09-21 Geoffrey Garen <ggaren@apple.com>
513 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
514 Updated to include the right path.
515 * wtf/FastMalloc.h: #include Platform.h, since we use Platform macros.
517 === Safari-521.27 ===
519 2006-09-20 Anders Carlsson <acarlsson@apple.com>
521 Reviewed by Dave Hyatt.
526 2006-09-20 Sean Gies <seangies@apple.com>
528 Reviewed by Steve Falkenburg.
530 * wtf/Assertions.cpp: Debug messages should go into debugger console.
532 2006-09-20 David Hyatt <hyatt@apple.com>
534 Add an implementation of lrint for Win32.
541 2006-09-15 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
545 http://bugs.webkit.org/show_bug.cgi?id=10864
546 Bug 10864: Linux\GDK build fixes
548 * JavaScriptCoreSources.bkl:
551 2006-09-15 Adam Roben <aroben@apple.com>
555 * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
557 2006-09-15 Anders Carlsson <acarlsson@apple.com>
559 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
560 Fix the release build.
562 2006-09-15 Anders Carlsson <acarlsson@apple.com>
566 Add JavaScriptCore API to the build.
568 * API/JSCallbackConstructor.cpp:
569 * API/JSCallbackFunction.cpp:
570 * API/JSCallbackObject.cpp:
571 * API/JSClassRef.cpp:
572 * API/JSContextRef.cpp:
573 * API/JSObjectRef.cpp:
574 * API/JSStringRef.cpp:
575 * API/JSValueRef.cpp:
576 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
577 * os-win32/stdbool.h: Added.
579 2006-09-12 Steve Falkenburg <sfalken@apple.com>
583 Build tweaks (doing JavaScriptCore now since it doesn't have
586 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
587 * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
588 * JavaScriptCore.vcproj/JavaScriptCore/dstroot-to-sdk.cmd: Added.
589 * JavaScriptCore.vcproj/dftables/dftables.vcproj:
590 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
592 2006-09-11 Brady Eidson <beidson@apple.com>
594 Build fix - I think Tim's last checkin wasn't tested on Tiger, possibly. I simply
595 commented out the undefined constants until he can have a chance to make the right call
597 * bindings/objc/objc_utility.mm:
598 (KJS::Bindings::objcValueTypeForType): Commented out undefined symbols
600 2006-09-11 Timothy Hatcher <timothy@apple.com>
602 Reviewed by Tim O. and Darin.
604 Add support for more method signatures affecting ObjC methods called from JavaScript:
605 - Added unsigned types and long long.
606 - Allow methods that use const, oneway, bycopy and byref type modifiers.
608 * bindings/objc/objc_instance.mm:
609 (ObjcInstance::invokeMethod):
610 * bindings/objc/objc_utility.h:
612 * bindings/objc/objc_utility.mm:
613 (KJS::Bindings::convertValueToObjcValue):
614 (KJS::Bindings::convertObjcValueToValue):
615 (KJS::Bindings::objcValueTypeForType):
617 2006-09-05 Timothy Hatcher <timothy@apple.com>
621 <rdar://problem/4715840> SEL is not char*
623 * bindings/objc/objc_class.mm:
624 (KJS::Bindings::ObjcClass::methodsNamed): use sel_getName instead of a char* cast.
625 * bindings/objc/objc_runtime.mm:
626 (ObjcFallbackObjectImp::callAsFunction): ditto
628 2006-09-03 Alexey Proskuryakov <ap@nypop.com>
632 http://bugs.webkit.org/show_bug.cgi?id=10693
633 Convert JavaScript arrays to AppleScript lists
635 * JavaScriptCore.exp: Export ArrayInstance::info and ArrayInstance::getItem().
636 * kjs/array_instance.h:
637 * kjs/array_object.cpp:
638 (ArrayInstance::getItem): Added a method to access array items from C++.
640 2006-09-02 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
644 Bug 10454: Unix bakefile fixes
645 http://bugs.webkit.org/show_bug.cgi?id=10454
647 * JavaScriptCoreSources.bkl:
649 2006-09-01 Nikolas Zimmermann <zimmermann@kde.org>
651 Reviewed by hyatt. Landed by eseidel.
655 * pcre/CMakeLists.txt: Add wtf/ include.
657 2006-09-01 Nikolas Zimmermann <zimmermann@kde.org>
659 Reviewed and landed by ap.
661 Fix build on Linux (C89 without gcc extensions enabled).
663 * pcre/pcre_internal.h: Use C style comments.
664 * wtf/Assertions.h: Use C style comments.
665 * wtf/Platform.h: Use C style comments.
667 2006-09-01 Steve Falkenburg <sfalken@apple.com>
671 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
672 * JavaScriptCore.vcproj/dftables/dftables.vcproj:
674 2006-08-31 Anders Carlsson <acarlsson@apple.com>
678 Add new portability functions to MathExtras.h and add StringExtras.h which is for
679 string portability functions.
681 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
682 * bindings/c/c_instance.cpp:
683 * kjs/date_object.cpp:
687 * wtf/StringExtras.h: Added.
691 2006-08-31 Anders Carlsson <acarlsson@apple.com>
697 * JavaScriptCore.vcproj/dftables/dftables.vcproj:
698 * pcre/pcre_internal.h:
700 2006-08-31 Timothy Hatcher <timothy@apple.com>
704 Band-aid fix for PCRE to compile for ppc64 and x86_64 now that
705 we use -Wshorten-64-to-32. Adds an INT_CAST macro that ASSERTs
706 the value <= INT_MAX.
708 I filed <rdar://problem/4712064> to track the need to verify
709 PCRE's 64-bit compliance.
711 * pcre/pcre_compile.c:
720 (pcre_get_substring_list):
721 * pcre/pcre_internal.h:
722 * pcre/pcre_tables.c:
723 * pcre/pcre_try_flipped.c:
726 2006-08-30 Darin Adler <darin@apple.com>
728 Reviewed by Tim Hatcher.
730 - add WTF::getPtr, a function template that makes it possible to write
731 generic code that gets a raw pointer out of any of our pointer types
733 * JavaScriptCore.xcodeproj/project.pbxproj:
734 * wtf/GetPtr.h: Added.
735 * wtf/ListRefPtr.h: (WTF::getPtr): Added.
736 * wtf/OwnArrayPtr.h: (WTF::getPtr): Added.
737 * wtf/OwnPtr.h: (WTF::getPtr): Added.
738 * wtf/PassRefPtr.h: (WTF::getPtr): Added.
739 * wtf/RefPtr.h: (WTF::getPtr): Added.
741 2006-08-29 waylonis <waylonis@google.com>
743 Reviewed, tweaked by ggaren.
745 - Added storage and accessor functions for ExecState as a fix for
746 http://bugs.webkit.org/show_bug.cgi?id=10114
749 (KJS::ExecState::ExecState):
752 (KJS::Context::setExecState):
753 (KJS::Context::execState):
755 2006-08-30 Nikolas Zimmermann <zimmermann@kde.org>
759 Commit KDE related tweaks, to be able to
760 differentiate between a Qt-only or a KDE build.
762 * CMakeLists.txt: Install wtf-unity library.
763 * wtf/Platform.h: Add define for the KDE platform.
765 2006-08-28 Darin Adler <darin@apple.com>
769 * kjs/list.h: Use explicit in constructor (as appropriate).
771 2006-08-24 Nikolas Zimmermann <zimmermann@kde.org>
773 Reviewed, tweaked and landed by ap
775 http://bugs.webkit.org/show_bug.cgi?id=10467
776 WebKit should have Qt platform support (Part II)
778 * CMakeLists.txt: Adjust to Anders' build fixes.
779 * wtf/Platform.h: Fix define for the Qt platform (we don't use/need Cairo.)
781 2006-08-23 David Hyatt <hyatt@apple.com>
783 Fix Platform.h to include #defines for graphics features.
787 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
790 2006-08-23 Anders Carlsson <acarlsson@apple.com>
794 Make the bindings compile without CoreFoundation.
796 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
797 * bindings/c/c_instance.cpp:
798 * bindings/c/c_utility.cpp:
799 (KJS::Bindings::convertUTF8ToUTF16):
801 * bindings/runtime.cpp:
802 (KJS::Bindings::Instance::createBindingForLanguageInstance):
803 (KJS::Bindings::Instance::createLanguageInstanceForValue):
804 * bindings/runtime_root.cpp:
805 * bindings/runtime_root.h:
806 * kjs/interpreter.cpp:
807 (KJS::Interpreter::createLanguageInstanceForValue):
810 2006-08-22 Anders Carlsson <acarlsson@apple.com>
814 Move the npruntime code over to using HashMap and the runtime_root code over to using
815 HashMap and HashCountedSet.
817 * bindings/NP_jsobject.cpp:
818 * bindings/c/c_utility.cpp:
819 (KJS::Bindings::identifierFromNPIdentifier):
820 * bindings/c/c_utility.h:
821 * bindings/jni/jni_jsobject.cpp:
822 (JavaJSObject::invoke):
823 * bindings/npruntime.cpp:
824 (getStringIdentifierMap):
825 (getIntIdentifierMap):
826 (_NPN_GetStringIdentifier):
827 (_NPN_GetIntIdentifier):
828 * bindings/runtime_root.cpp:
829 (getReferencesByRootMap):
831 (KJS::Bindings::findReferenceSet):
832 (KJS::Bindings::rootForImp):
833 (KJS::Bindings::rootForInterpreter):
834 (KJS::Bindings::addNativeReference):
835 (KJS::Bindings::removeNativeReference):
836 (RootObject::removeAllNativeReferences):
837 * bindings/runtime_root.h:
839 2006-08-22 Anders Carlsson <acarlsson@apple.com>
843 Switch over the NPAPI and Java bindings to using HashMaps instead of dictionaries.
845 * JavaScriptCore.xcodeproj/project.pbxproj:
846 * bindings/c/c_class.cpp:
847 (KJS::Bindings::CClass::CClass):
848 (KJS::Bindings::CClass::~CClass):
849 (KJS::Bindings::CClass::classForIsA):
850 (KJS::Bindings::CClass::methodsNamed):
851 (KJS::Bindings::CClass::fieldNamed):
852 * bindings/c/c_class.h:
853 * bindings/jni/jni_class.cpp:
854 (JavaClass::JavaClass):
855 (JavaClass::~JavaClass):
856 (JavaClass::methodsNamed):
857 (JavaClass::fieldNamed):
858 * bindings/jni/jni_class.h:
859 * bindings/objc/objc_class.h:
860 * bindings/objc/objc_class.mm:
861 (KJS::Bindings::deleteMethod):
862 (KJS::Bindings::deleteField):
864 (KJS::Bindings::ObjcClass::methodsNamed):
865 (KJS::Bindings::ObjcClass::fieldNamed):
866 * bindings/runtime.cpp:
867 * bindings/runtime.h:
868 * bindings/runtime_object.cpp:
869 (RuntimeObjectImp::fieldGetter):
870 (RuntimeObjectImp::getOwnPropertySlot):
871 (RuntimeObjectImp::put):
872 (RuntimeObjectImp::canPut):
874 2006-08-21 Vladimir Olexa <vladimir.olexa@gmail.com>
878 http://bugs.webkit.org/show_bug.cgi?id=6252
879 JavaScript 1.6 Array.lastIndexOf
881 Test: fast/js/array-lastIndexOf.html
883 * kjs/array_object.cpp:
884 (ArrayProtoFunc::callAsFunction): Added a LastIndexOf case.
885 * kjs/array_object.h:
886 (KJS::ArrayProtoFunc::): Added LastIndexOf to enum.
887 * tests/mozilla/expected.html: Two more tests now pass.
889 2006-08-20 Nikolas Zimmermann <zimmermann@kde.org>
891 Reviewed by Maciej. Landed by rwlbuis.
893 Fixes parts of: http://bugs.webkit.org/show_bug.cgi?id=10463
894 WebKit should have Qt platform support
896 Removing obsolete QConstString/QString constructors in kjs code.
901 2006-08-17 Nikolas Zimmermann <zimmermann@kde.org>
903 Reviewed by Maciej. Landed by rwlbuis.
905 Fixes: http://bugs.webkit.org/show_bug.cgi?id=10463
906 WTF Changes needed for Qt platform code.
909 * wtf/unicode/UnicodeDecomposition.h: Added.
911 * wtf/unicode/UnicodeDirection.h: Added.
913 * wtf/unicode/qt4/UnicodeQt4.cpp: Added.
914 (WTF::Unicode::direction):
915 (WTF::Unicode::category):
916 (WTF::Unicode::decomposition):
917 * wtf/unicode/qt4/UnicodeQt4.h:
918 (WTF::Unicode::toLower):
919 (WTF::Unicode::toUpper):
920 (WTF::Unicode::isPrintableChar):
921 (WTF::Unicode::isSpace):
922 (WTF::Unicode::isPunct):
923 (WTF::Unicode::isDigit):
924 (WTF::Unicode::mirroredChar):
925 (WTF::Unicode::compare):
927 2006-08-17 Nikolas Zimmermann <zimmermann@kde.org>
929 Reviewed by Eric. Landed by rwlbuis.
931 Fixes: http://bugs.webkit.org/show_bug.cgi?id=10464
932 Offer a cmake build system for Qt platform.
934 * CMakeLists.txt: Added.
935 * pcre/CMakeLists.txt: Added.
937 2006-08-17 Anders Carlsson <acarlsson@apple.com>
944 2006-08-15 Steve Falkenburg <sfalken@apple.com>
950 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
953 2006-08-15 Mark Rowe <opendarwin.org@bdash.net.nz>
957 Build fix: DWARF and -gfull are incompatible with symbol separation.
959 * JavaScriptCore.xcodeproj/project.pbxproj:
961 2006-08-15 Mark Rowe <opendarwin.org@bdash.net.nz>
965 http://bugs.webkit.org/show_bug.cgi?id=10394
966 Bug 10394: WebKit Release and Production configurations should enable dead code stripping
968 * JavaScriptCore.xcodeproj/project.pbxproj:
970 2006-08-15 Mark Rowe <opendarwin.org@bdash.net.nz>
974 http://bugs.webkit.org/show_bug.cgi?id=10384
975 Bug 10384: Switch to DWARF for Release configuration
977 * JavaScriptCore.xcodeproj/project.pbxproj:
979 2006-08-13 Maks Orlovich <maksim@kde.org>
981 Reviewed (and tweaked a little) by Maciej.
983 - shrank the size of JSObject by 8 bytes and made the corresponding reduction to the cell size, resulting
984 in a 1.2% speed improvement on JS iBench (and probably overall memory savings).
986 This was done by removing _scope and _internalValue data members
987 from JSObject and moving them only to the subclasses that actually
991 (KJS::JSObject::mark): No need to mark scope or internal value here.
993 (KJS::JSObject::JSObject): Don't initialize them.
994 * kjs/JSWrapperObject.cpp: Added. New base class for object types that
995 wrap primitive values (Number, String, Boolean, Date).
996 (KJS::JSWrapperObject::mark):
997 * kjs/JSWrapperObject.h: Added.
998 (KJS::JSWrapperObject::JSWrapperObject):
999 (KJS::JSWrapperObject::internalValue):
1000 (KJS::JSWrapperObject::setInternalValue):
1001 * kjs/array_object.cpp:
1002 (ArrayPrototype::ArrayPrototype): Don't set useless internal value.
1003 * kjs/bool_object.cpp:
1004 (BooleanInstance::BooleanInstance): Inherit from JSWrapperObject.
1005 (BooleanProtoFunc::callAsFunction): Fixed to account for fact that not all
1006 JSObjects have an internal value.
1007 (BooleanObjectImp::construct): ditto.
1008 * kjs/bool_object.h:
1009 * kjs/collector.cpp: Lowered cell size to 48.
1010 (KJS::Collector::allocate): meaningless whitespace change
1011 * kjs/date_object.cpp:
1012 (KJS::DateInstance::DateInstance): Inherit from JSWrapperObject.
1013 (KJS::DateProtoFunc::callAsFunction): adjusted for move of internalValue
1014 (KJS::DateObjectImp::construct): ditto
1015 * kjs/date_object.h:
1016 * kjs/error_object.cpp:
1017 (ErrorPrototype::ErrorPrototype): don't set internal value
1018 * kjs/function.cpp: move _scope and related handling here
1019 (KJS::FunctionImp::mark): mark scope
1021 (KJS::FunctionImp::scope): moved here from JSObject
1022 (KJS::FunctionImp::setScope): ditto
1023 * kjs/number_object.cpp:
1024 (NumberInstance::NumberInstance): inherit from JSWrapperObject
1025 (NumberProtoFunc::callAsFunction): adjusted
1026 (NumberObjectImp::construct): adjusted
1027 * kjs/number_object.h: shring RegExp-related objects a little
1028 * kjs/regexp_object.cpp:
1029 (RegExpPrototype::RegExpPrototype): Adjust for size tweaks
1030 (RegExpObjectImp::RegExpObjectImp): ditto
1031 * kjs/regexp_object.h:
1032 * kjs/string_object.cpp:
1033 (StringInstance::StringInstance): inherit from JSWrapperObject
1034 (StringProtoFunc::callAsFunction): adjusted
1035 * kjs/string_object.h:
1036 * JavaScriptCore.exp: Exported new methods as needed.
1037 * JavaScriptCore.xcodeproj/project.pbxproj: Added new files to build.
1039 2006-08-04 Brady Eidson <beidson@apple.com>
1041 Reviewed by Geoff's rubber stamp
1043 Fix a build break on Intel hardware causes by adapting stricter
1044 compiler warnings (-Wshorten-64-to-32)
1047 (assertEqualsAsNumber): manually cast some doubles to floats
1050 2006-08-04 Sam Weinig <sam.weinig@gmail.com>
1054 - patch for http://bugs.webkit.org/show_bug.cgi?id=10192
1055 Make WebCore (and friends) compile with -Wshorten-64-to-32
1057 * Adds -Wshorten-64-to-32 flag to Xcode project.
1058 * Adds explicit casts where OK.
1062 (JSNodeList_getProperty):
1063 * JavaScriptCore.xcodeproj/project.pbxproj:
1065 2006-08-04 Adam Roben <aroben@apple.com>
1069 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Convert
1072 2006-08-03 Sam Weinig <sam.weinig@gmail.com>
1076 - patch for http://bugs.webkit.org/show_bug.cgi?id=10176
1077 Make WebCore compile with -Wundef
1079 * Adds -Wundef flag to Xcode project
1080 * Converts #ifs to #ifdef and #ifndefs where needed.
1081 * Added #define YYMAXDEPTH 10000 in kjs/grammar.y
1082 to fix a warning from within Bison.
1084 * JavaScriptCore.xcodeproj/project.pbxproj:
1085 * bindings/jni/jni_jsobject.cpp:
1086 (JavaJSObject::getSlot):
1087 (JavaJSObject::setSlot):
1089 * bindings/objc/objc_class.mm:
1090 (KJS::Bindings::ObjcClass::methodsNamed):
1091 (KJS::Bindings::ObjcClass::fieldNamed):
1092 * bindings/objc/objc_instance.mm:
1093 (ObjcInstance::invokeMethod):
1094 * bindings/objc/objc_runtime.mm:
1095 (ObjcMethod::getMethodSignature):
1101 2006-08-03 Anders Carlsson <acarlsson@apple.com>
1103 Reviewed by John Sullivan.
1107 Return *this in operator=
1109 2006-08-03 Adam Roben <aroben@apple.com>
1113 - Fixed Windows build
1115 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1116 * wtf/MathExtras.h: Implement inline versions of these functions
1120 2006-08-02 Adam Roben <aroben@apple.com>
1126 * kjs/date_object.cpp:
1129 2006-07-29 Darin Adler <darin@apple.com>
1131 - Removed tabs from these source files that still had them.
1132 We don't use them; that way source files look fine in editors
1133 that have tabs set to 8 spaces or to 4 spaces.
1134 - Removed allow-tabs Subversion property from the files too.
1136 * bindings/NP_jsobject.cpp:
1137 * bindings/c/c_utility.cpp:
1138 * bindings/jni/jni_runtime.cpp:
1139 * bindings/jni/jni_utility.cpp:
1140 * bindings/objc/objc_utility.mm:
1141 * bindings/runtime.cpp:
1142 * bindings/runtime_method.cpp:
1143 * bindings/testbindings.cpp:
1144 * bindings/testbindings.mm:
1145 * kjs/date_object.cpp:
1150 * kjs/string_object.cpp:
1153 2006-07-29 Darin Adler <darin@apple.com>
1155 * tests/mozilla/expected.html: Update test results now that regress-185165.js
1156 is succeeding. I suspect Anders fix for bug 4620655 is the reason.
1158 2006-07-29 Sam Weinig <sam.weinig@gmail.com>
1162 - patch for http://bugs.webkit.org/show_bug.cgi?id=10080
1163 Adopt pedantic changes from the Unity project to improve
1164 cross-compiler compatibility
1167 * Removing trailing semicolon from namespace braces.
1168 * Removing trailing comma from last enum declaration.
1169 * Updating to match style guidelines.
1170 * Adding missing newline to the end of the file.
1171 * Turning on gcc warning for missing newline at the end of a source file
1172 (GCC_WARN_ABOUT_MISSING_NEWLINE in Xcode, -Wnewline in gcc).
1173 * Alphabetical sorting of Xcode source list files.
1174 * Replace use of non-portable variable-size array with Vector.
1175 * Use C-style comments instead of C++ comments in files that might
1176 be included by either C or C++ files.
1178 * API/JSCallbackConstructor.cpp:
1179 (KJS::JSCallbackConstructor::construct):
1180 * API/JSCallbackFunction.cpp:
1181 (KJS::JSCallbackFunction::callAsFunction):
1182 * API/JSCallbackObject.cpp:
1183 (KJS::JSCallbackObject::construct):
1184 (KJS::JSCallbackObject::callAsFunction):
1185 * JavaScriptCore.xcodeproj/project.pbxproj:
1186 * JavaScriptCorePrefix.h:
1187 * bindings/jni/jni_class.cpp:
1188 (JavaClass::fieldNamed):
1189 * bindings/jni/jni_class.h:
1190 * bindings/jni/jni_instance.cpp:
1191 (JavaInstance::JavaInstance):
1192 (JavaInstance::valueOf):
1193 * bindings/jni/jni_objc.mm:
1194 (KJS::Bindings::dispatchJNICall):
1195 * bindings/jni/jni_runtime.cpp:
1196 (JavaParameter::JavaParameter):
1197 (JavaArray::JavaArray):
1198 * bindings/jni/jni_runtime.h:
1199 * bindings/jni/jni_utility.h:
1200 * bindings/objc/objc_instance.h:
1201 * bindings/runtime_array.h:
1207 2006-07-29 Mike Emmel <mike.emmel@gmail.com>
1211 - fixes for Linux build
1213 * JavaScriptCoreSources.bkl: Added new files to build, kjs/PropertyNameArray.cpp
1214 and kjs/testkjs.cpp, and removed old files.
1216 2006-07-24 Dan Waylonis <waylonis@google.com>
1218 Reviewed and tweaked a bit by Darin.
1220 - fix http://bugs.webkit.org/show_bug.cgi?id=9902
1221 jsNull and NSNull not properly converted between JS and ObjC
1223 * bindings/objc/objc_utility.mm: (KJS::Bindings::convertObjcValueToValue):
1224 Added case for converting NSNull to jsNull.
1226 2006-07-24 Rob Buis <buis@kde.org>
1230 http://bugs.webkit.org/show_bug.cgi?id=4258
1231 Date().toString() only includes GMT offset, not timezone string
1233 Use the info in tm_zone to append timezone abbreviation
1234 to Date().toString().
1236 * kjs/date_object.cpp:
1239 2006-07-24 Rob Buis <buis@kde.org>
1243 http://bugs.webkit.org/show_bug.cgi?id=5257
1244 setYear() does not match FireFox/IE behavior
1246 Make sure the right values end up in tm_year.
1248 * kjs/date_object.cpp:
1251 2006-07-23 Mark Rowe <opendarwin.org@bdash.net.nz>
1255 Bug 9686: [Drosera] Need the ability to break into Drosera on Javascript exceptions
1256 http://bugs.webkit.org/show_bug.cgi?id=9686
1258 JavaScriptCore portion of the fix.
1260 * JavaScriptCore.exp: Update symbol for change in argument type.
1262 (Debugger::detach): Clear map of recent exceptions.
1263 (Debugger::hasHandledException): Track the most recent exception
1264 thrown by an interpreter.
1265 (Debugger::exception): Change exception argument to a JSValue.
1268 (Node::debugExceptionIfNeeded): Notify the debugger of an exception
1269 if it hasn't seen it before.
1270 (ThrowNode::execute): Notify the debugger that an exception is being thrown.
1273 2006-07-23 Geoffrey Garen <ggaren@apple.com>
1275 Patch by Eric Albert, reviewed by Darin and me.
1277 - Fixed <rdar://problem/4645931> JavaScriptCore stack-scanning code
1278 crashes (Collector::markStackObjectsConservatively)
1280 * bindings/jni/jni_jsobject.cpp: On 64bit systems, jint is a long, not an
1282 (JavaJSObject::getSlot):
1283 (JavaJSObject::setSlot):
1284 * kjs/collector.cpp:
1285 (KJS::Collector::markCurrentThreadConservatively): Use a pointer instead of
1286 an int as 'dummy,' because on LP64 systems, an int is not pointer-aligned,
1287 and we want to scan the stack for pointers.
1288 * JavaScriptCore.xcodeproj/project.pbxproj: After a tense cease-fire, the
1289 XCode war has started up again!
1291 === Safari-521.20 ===
1293 2006-07-21 Geoffrey Garen <ggaren@apple.com>
1297 <rdar://problem/4507265> REGRESSION: overlays don't work on HousingMaps.com (Google Maps-based site)
1299 - Added support for strings that masquerade as undefined. Currently used
1300 by WebCore to implement undetectable style.filter.
1302 The name is a little long, but it's only used in one line of code, so I
1303 thought clarity should win over brevity.
1305 * JavaScriptCore.exp:
1306 * JavaScriptCore.xcodeproj/project.pbxproj:
1308 * kjs/string_object.h:
1309 (KJS::StringInstanceThatMasqueradesAsUndefined::StringInstanceThatMasqueradesAsUndefined):
1310 (KJS::StringInstanceThatMasqueradesAsUndefined::masqueradeAsUndefined):
1311 (KJS::StringInstanceThatMasqueradesAsUndefined::toBoolean):
1313 === Safari-521.19 ===
1315 2006-07-20 Steve Falkenburg <sfalken@apple.com>
1320 (KJS::escapeStringForPrettyPrinting):
1322 2006-07-19 Anders Carlsson <acarlsson@apple.com>
1326 <rdar://problem/4620655> REGRESSION(10.4.7-10.5): preview button for a blogger.com post doesn't work
1328 * kjs/nodes2string.cpp:
1329 (StringNode::streamTo):
1330 Return the escaped string.
1332 (RegExpNode::streamTo):
1333 Use the correct syntax.
1336 (KJS::escapeStringForPrettyPrinting):
1338 Add escape function which escapes a string for pretty-printing so it can be parsed again.
1340 * wtf/unicode/icu/UnicodeIcu.h:
1341 (WTF::Unicode::isPrintableChar):
1344 2006-07-18 Maciej Stachowiak <mjs@apple.com>
1346 Reviewed by Adele Peterson.
1348 <rdar://problem/4589530> REGRESSION: null character in JS string causes parse error (works in Tiger and in other browsers)
1354 (Lexer::scanRegExp):
1357 2006-07-18 Tim Omernick <timo@apple.com>
1359 Reviewed by Tim Hatcher.
1361 Removed a misleading comment; we recently added support for the NPNVPluginElementNPObject
1366 === Safari-521.18 ===
1368 2006-07-18 Timothy Hatcher <timothy@apple.com>
1370 Made the following headers public:
1379 * JavaScriptCore.xcodeproj/project.pbxproj:
1381 2006-07-17 Geoffrey Garen <ggaren@apple.com>
1385 - Added automatic prototype creation for classes.
1387 A class stores a weak reference to a prototype, which is cleared when
1388 the prototype is garbage collected, to avoid a reference cycle.
1390 We now have an attributes field in JSClassDefinition, that currently is
1391 used only to override automatic prototype creation when you want to manage your
1392 own prototypes, but can be extended in the future for other nefarious purposes.
1394 Similarly, we have JSObjectMake and JSObjectMakeWithPrototype, the latter
1395 allowing you to manage your own prototypes.
1397 JSObjectMakeConstructor is more interesting now, able to make a constructor
1398 on your behalf if you just give it a class.
1400 - Removed bogus old code from minidom.js.
1402 - Tweaked the headerdocs.
1404 - Added more GC testing, which caught some leaks, and tested more funny
1405 edge cases in lookup, which caught a lookup bug. Removed some testing
1406 we used to do with MyObject because it was redundant with the new, cool
1409 While fixing the lookup bug I retracted this change:
1411 "If a static setProperty callback returns 'false', to indicate that the
1412 property was not set, we no longer forward the set request up the class
1413 chain, because that's almost certainly not what the programmer expected."
1415 Returning false when setting a static property is a little silly, but you can see
1416 it being useful when shadowing a base class's static properties, and, regardless
1417 of usefullness, this is the defined behavior of the setProperty callback.
1419 - Plus a little ASCII art, for the kids.
1421 2006-07-17 Timothy Hatcher <timothy@apple.com>
1425 <rdar://problem/4634874> WebScriptObject and WebUndefined are no longer defined by WebKit
1427 Moves WebScriptObject and WebUndefined up to WebCore.
1428 This change does create an upwards-dependancy on WebScriptObject existing
1429 in the loaded process, but this code path in JavaScriptCore does not get used
1430 unless it is through WebKit/WebCore. Moving all of the binding code out of
1431 JavaScriptCore might make sense in the future.
1433 * JavaScriptCore.exp:
1434 * JavaScriptCore.xcodeproj/project.pbxproj:
1435 * bindings/objc/WebScriptObject.h: Replaced.
1436 * bindings/objc/WebScriptObject.mm: Removed.
1437 * bindings/objc/WebScriptObjectPrivate.h: Removed.
1438 * bindings/objc/objc_class.h:
1439 * bindings/objc/objc_instance.h:
1440 * bindings/objc/objc_instance.mm:
1441 (ObjcInstance::~ObjcInstance):
1442 * bindings/objc/objc_runtime.h:
1443 * bindings/objc/objc_runtime.mm:
1444 (convertValueToObjcObject):
1445 * bindings/objc/objc_utility.mm:
1446 (KJS::Bindings::convertValueToObjcValue):
1447 (KJS::Bindings::convertObjcValueToValue):
1448 (KJS::Bindings::createObjcInstanceForValue):
1450 2006-07-17 Darin Adler <darin@apple.com>
1452 * API/JSBase.h: Fix comment formatting where things used to be lined up but
1453 are now ragged. Got rid of spaces that attempted to line things up.
1454 * API/JSObjectRef.h: Ditto. Also add missing periods for a couple of comments.
1456 2006-07-17 Geoffrey Garen <ggaren@apple.com>
1460 - Removed the exception parameter from the initialize callback and, by extension,
1461 JSObjectMake. We have never had a need for exceptions when iniitializing,
1462 so the parameter seemed likely to "get in the way."
1464 Also, an exception in JavaScript is thrown in response to input --
1465 "invalid URL", "index not a number", etc., so it's the job of the
1466 constructor function, not the initialize method, to throw.
1468 If initialize *really* wants to throw, it can communicate the throw to
1469 the constructor through the constructed object's private data (e.g., set
1470 it to NULL, signaling to the consntructor that initialization failed.)
1472 - Added JSObjectMakeWithData, which enables a constructor to set private
1473 data on an object *before* it has been initialized. That way, the initialize
1474 methods can properly operate on the data.
1476 * API/JSNode.c: Moved ref into the initialize method, for better encapsulation,
1477 now that it's possible.
1478 * API/JSNodeList.c: ditto
1480 (main): Do more aggressive garbage collection to test ref/deref and
1481 initialize/finalize.
1482 * API/minidom.js: store childNodes in a temporary so it doesn't get re-created
1483 like a thousand times. This makes debugging ref/deref easier
1485 2006-07-17 Geoffrey Garen <ggaren@apple.com>
1489 - Changed the initialize callback to run from least derived class (parent
1490 class) to most derived class. This enables C++ style initialization,
1491 and derived class overriding of member data.
1493 - Added excpetion propopgation to JSObjectMake, to support initialize
1494 exceptions, and generally round out our policy of making function
1495 signatures as long as possible.
1497 * API/JSCallbackObject.h: Use ExecState instead of ContextRef, cuz we're
1500 2006-07-17 Geoffrey Garen <ggaren@apple.com>
1504 - Changed JSObjectMakeConstructor to JSObjectMakeConstructorWithCallback,
1505 to match JSObjectMakeFunctionWithCallback.
1507 - Added prototype parameter, so the generated constructor
1508 automatically works with hasInstance / instanceof
1510 - Moved hasInstance implementation from InternalFunctionImp to JSObject
1511 so that subclasses can inherit it without inheriting function-related baggage.
1512 More refactoring here would be good, but this seems like a good short-term
1515 (KJS::JSCallbackFunction::implementsHasInstance): override and return false,
1516 because callback functions aren't constructors.
1518 2006-07-17 Maciej Stachowiak <mjs@apple.com>
1522 - add a JSContextRef parameter to all JSValueRef, JSObjectRef, and JSContextRef operations;
1523 except JSObject{Get,Set}PrivateData which can be assumed to be simple pure accessors.
1525 Also renamed the parameter "context" to "ctx" because it makes the code read better with this pervasive
1526 but usually uninteresting parameter.
1530 (JSCheckScriptSyntax):
1533 * API/JSCallbackObject.cpp:
1534 (KJS::JSCallbackObject::JSCallbackObject):
1535 (KJS::JSCallbackObject::init):
1536 (KJS::JSCallbackObject::getOwnPropertySlot):
1537 (KJS::JSCallbackObject::put):
1538 (KJS::JSCallbackObject::deleteProperty):
1539 (KJS::JSCallbackObject::toNumber):
1540 (KJS::JSCallbackObject::toString):
1541 * API/JSContextRef.cpp:
1542 (JSGlobalContextCreate):
1543 (JSGlobalContextRetain):
1544 (JSGlobalContextRelease):
1545 (JSContextGetGlobalObject):
1546 * API/JSContextRef.h:
1548 (JSNodePrototype_appendChild):
1549 (JSNodePrototype_removeChild):
1550 (JSNodePrototype_replaceChild):
1551 (JSNode_getNodeType):
1552 (JSNode_getFirstChild):
1555 (JSNodeListPrototype_item):
1556 (JSNodeList_length):
1557 (JSNodeList_getProperty):
1558 (JSNodeList_prototype):
1559 * API/JSObjectRef.cpp:
1561 (JSObjectMakeFunctionWithCallback):
1562 (JSObjectMakeConstructor):
1563 (JSObjectMakeFunction):
1564 (JSObjectGetPrototype):
1565 (JSObjectSetPrototype):
1566 (JSObjectHasProperty):
1567 (JSObjectGetProperty):
1568 (JSObjectSetProperty):
1569 (JSObjectGetPropertyAtIndex):
1570 (JSObjectSetPropertyAtIndex):
1571 (JSObjectDeleteProperty):
1572 (JSObjectIsFunction):
1573 (JSObjectCallAsFunction):
1574 (JSObjectIsConstructor):
1575 (JSObjectCallAsConstructor):
1576 (JSObjectCopyPropertyNames):
1577 * API/JSObjectRef.h:
1578 * API/JSStringRef.cpp:
1579 * API/JSValueRef.cpp:
1581 (JSValueIsUndefined):
1587 (JSValueIsObjectOfClass):
1589 (JSValueIsStrictEqual):
1590 (JSValueIsInstanceOfConstructor):
1591 (JSValueMakeUndefined):
1593 (JSValueMakeBoolean):
1594 (JSValueMakeNumber):
1595 (JSValueMakeString):
1598 (JSValueToStringCopy):
1606 (MyObject_getProperty):
1607 (MyObject_deleteProperty):
1608 (MyObject_callAsFunction):
1609 (MyObject_callAsConstructor):
1610 (MyObject_convertToType):
1611 (print_callAsFunction):
1614 2006-07-16 Geoffrey Garen <ggaren@apple.com>
1616 Approved by Maciej, RS by Beth.
1618 JSObjectMakeFunction -> JSObjectMakeFunctionWithCallback
1619 JSObjectMakeFunctionWithBody -> JSObjectMakeFunction
1621 because the latter is more common, and more fundamental, than the former.
1626 * API/JSCallbackObject.cpp:
1627 (KJS::JSCallbackObject::getOwnPropertySlot):
1628 (KJS::JSCallbackObject::put):
1629 (KJS::JSCallbackObject::deleteProperty):
1630 (KJS::JSCallbackObject::getPropertyNames):
1631 (KJS::JSCallbackObject::staticValueGetter):
1632 (KJS::JSCallbackObject::staticFunctionGetter):
1633 * API/JSClassRef.cpp:
1634 (OpaqueJSClass::OpaqueJSClass):
1635 (OpaqueJSClass::~OpaqueJSClass):
1637 * API/JSObjectRef.cpp:
1639 (JSObjectMakeFunctionWithCallback):
1640 (JSObjectMakeFunction):
1641 (OpaqueJSPropertyNameArray::OpaqueJSPropertyNameArray):
1642 (JSObjectCopyPropertyNames):
1643 * API/JSObjectRef.h:
1649 * JavaScriptCore.exp:
1651 2006-07-16 Geoffrey Garen <ggaren@apple.com>
1655 Replace __JS with OpaqueJS because the former, while used by CF, is
1656 a prefix that's triply-reserved by the compiler. (_* is reserved in global
1657 names, _[A-Z] is reserved in all names, and __ is reserved in all names
1660 Opaque is an alternative used by other Mac OS X framewokrs.
1665 * API/JSCallbackObject.cpp:
1666 (KJS::JSCallbackObject::getOwnPropertySlot):
1667 (KJS::JSCallbackObject::put):
1668 (KJS::JSCallbackObject::deleteProperty):
1669 (KJS::JSCallbackObject::getPropertyNames):
1670 (KJS::JSCallbackObject::staticValueGetter):
1671 (KJS::JSCallbackObject::staticFunctionGetter):
1672 * API/JSClassRef.cpp:
1673 (OpaqueJSClass::OpaqueJSClass):
1674 (OpaqueJSClass::~OpaqueJSClass):
1676 * API/JSObjectRef.cpp:
1678 (OpaqueJSPropertyNameArray::OpaqueJSPropertyNameArray):
1679 (JSObjectCopyPropertyNames):
1681 2006-07-16 Darin Adler <darin@apple.com>
1683 - try to fix Windows build
1685 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1686 Added some recently added files, removed some recently removed.
1688 2006-07-16 Geoffrey Garen <ggaren@apple.com>
1692 - Change getProperty* to return undefined, rather than NULL, for missing
1693 properties, since that's what the spec says. Also added exception out
1694 parameters to the *Index functions, because they can call through to the
1695 regular functions, which can throw for custom objects.
1697 * API/JSObjectRef.cpp:
1698 (JSObjectGetProperty):
1699 (JSObjectGetPropertyAtIndex):
1700 (JSObjectSetPropertyAtIndex):
1701 * API/JSObjectRef.h:
1705 2006-07-16 Geoffrey Garen <ggaren@apple.com>
1709 - Properly document and handle NULL callbacks for static properties. We
1710 throw an exception in any case other than a ReadOnly property with a NULL
1711 setProperty callback, because a NULL callback almost certainly indicates
1712 a programming error. Also throw an exception if hasProperty returns true
1713 for a property that getProperty can't get.
1715 - If a static setProperty callback returns 'false', to indicate that the
1716 property was not set, we no longer forward the set request up the class
1717 chain, because that's almost certainly not what the programmer expected.
1719 * API/JSCallbackObject.cpp:
1720 (KJS::JSCallbackObject::getOwnPropertySlot):
1721 (KJS::JSCallbackObject::put):
1722 (KJS::JSCallbackObject::staticValueGetter):
1723 (KJS::JSCallbackObject::staticFunctionGetter):
1724 (KJS::JSCallbackObject::callbackGetter):
1725 * API/JSObjectRef.h:
1728 (MyObject_hasProperty):
1731 2006-07-16 Geoffrey Garen <ggaren@apple.com>
1735 - Added names to functions.
1737 - Removed GetPrivate/SetPrivate from callbackFunctions and callbackConstructors.
1738 The private data idiom is that a JS object stores its native implementation
1739 as private data. For functions and constructors, the native implementation is nothing
1740 more than the callback they already store, so supporting private data, too,
1741 confuses the idiom. If you *really* want, you can still create a custom
1742 function with private data.
1744 * API/JSCallbackConstructor.cpp:
1745 * API/JSCallbackConstructor.h:
1746 * API/JSCallbackFunction.cpp:
1747 (KJS::JSCallbackFunction::JSCallbackFunction):
1748 * API/JSCallbackFunction.h:
1749 * API/JSCallbackObject.cpp:
1750 (KJS::JSCallbackObject::staticFunctionGetter):
1751 * API/JSObjectRef.cpp:
1752 (JSObjectMakeFunction):
1753 (JSObjectMakeFunctionWithBody):
1754 (JSObjectGetPrivate):
1755 (JSObjectSetPrivate):
1756 * API/JSObjectRef.h:
1762 2006-07-15 Maciej Stachowiak <mjs@apple.com>
1766 - switch property lists to be vector+set of Identifiers instead of list of References
1768 This has the following benefits:
1770 - no duplicates in property lists
1771 - simplifies API calls
1772 - probably more efficient, since linked list is gone
1773 - entirely removed Reference, ReferenceList and ProtectedReference types from the API
1775 * kjs/PropertyNameArray.cpp: Added.
1776 (KJS::PropertyNameArray::add): Check set, if not already there, add to
1778 * kjs/PropertyNameArray.h: Added.
1779 (KJS::PropertyNameArray::PropertyNameArray): Newly added type, combines
1780 a set and a vector to make a unique but ordered list of identifiers.
1781 (KJS::PropertyNameArray::begin): ditto
1782 (KJS::PropertyNameArray::end): ditto
1783 (KJS::PropertyNameArray::size): ditto
1784 (KJS::PropertyNameArray::operator[]): ditto
1785 * kjs/array_instance.h:
1786 * kjs/array_object.cpp:
1787 (ArrayInstance::getPropertyNames): renamed from getPropertyList, updated
1788 for PropertyNameArray
1789 (ArrayInstance::setLength): updated for PropertyNameArray
1790 (ArrayInstance::pushUndefinedObjectsToEnd): ditto
1792 (ForInNode::execute): updated for PropertyNameArray
1795 (KJS::JSObject::getPropertyNames): renamed from getPropertyList, updated
1796 for PropertyNameArray
1798 * kjs/property_map.cpp:
1799 (KJS::PropertyMap::getEnumerablePropertyNames): updated for PropertyNameArray
1800 (KJS::PropertyMap::getSparseArrayPropertyNames): ditto
1801 * kjs/property_map.h:
1802 * kjs/protected_reference.h: Removed.
1803 * kjs/reference.cpp: Removed.
1804 * kjs/reference.h: Removed.
1805 * kjs/reference_list.cpp: Removed.
1806 * kjs/reference_list.h: Removed.
1807 * kjs/scope_chain.cpp:
1808 (KJS::ScopeChain::print): Use PropertyNamesArray instead of ReferenceList.
1809 * kjs/string_object.cpp:
1810 (StringInstance::getPropertyNames): Updated for new approach.
1811 * kjs/string_object.h:
1814 (toJS): Added overload for PropertyNameAccumulatorRef / PropertyNameArray*
1817 * API/JSCallbackObject.cpp:
1818 (KJS::JSCallbackObject::getPropertyNames): Fixed for new API.
1819 * API/JSCallbackObject.h:
1820 * API/JSObjectRef.cpp:
1821 (__JSPropertyNameArray::__JSPropertyNameArray): Type used for a publicly vended
1822 JSPropertyNameArrayRef.
1823 (JSObjectCopyPropertyNames): New API call - renamed / refactored from
1824 JSObjectCreatePropertyList
1825 (JSPropertyNameArrayRetain): new retain call for JSPropertyNameArray.
1826 (JSPropertyNameArrayRelease): new release call for - " -.
1827 (JSPropertyNameArrayGetCount): Instead of having to use a stateful enumerator you
1828 can now get the count and items in any order.
1829 (JSPropertyNameArrayGetNameAtIndex): See above.
1830 (JSPropertyNameAccumulatorAddName): What you add properties to is now an opaque
1832 * API/JSObjectRef.h: Prototyped new functions, removed old ones
1833 * JavaScriptCore.exp: Updated exported symbols.
1834 * JavaScriptCore.xcodeproj/project.pbxproj: Added new files, removed old.
1836 (MyObject_getPropertyNames): Renamed / fixed callback to fit new paradigm.
1837 (main): Updated for new API.
1839 2006-07-15 Darin Adler <darin@apple.com>
1841 - oops, missed a few more arrays that had to be const
1844 (JSNodePrototype_appendChild): Added const.
1845 (JSNodePrototype_removeChild): Ditto.
1846 (JSNodePrototype_replaceChild): Ditto.
1847 (JSNode_construct): Ditto.
1849 (JSNodeListPrototype_item): Ditto.
1850 * API/JSObjectRef.cpp:
1851 (JSObjectMakeFunctionWithBody): Ditto.
1852 (JSObjectCallAsFunction): Ditto.
1853 (JSObjectCallAsConstructor): Ditto.
1857 (MyObject_callAsFunction): Ditto.
1858 (MyObject_callAsConstructor): Ditto.
1859 (print_callAsFunction): Ditto.
1860 (myConstructor_callAsConstructor): Ditto.
1862 2006-07-15 Darin Adler <darin@apple.com>
1866 * API/JSNode.h: Made an array parameter const.
1867 * API/JSObjectRef.h: Made array parameters const. Fixed a comment.
1869 2006-07-15 Geoffrey Garen <ggaren@apple.com>
1873 - JSObjectMakeFunctionWithBody includes a function name and named parameters now.
1875 * API/JSObjectRef.cpp:
1876 (JSObjectMakeFunctionWithBody):
1877 * API/JSObjectRef.h:
1879 (assertEqualsAsUTF8String): More informative failure reporting.
1880 (main): Test more function cases.
1882 2006-07-15 Geoffrey Garen <ggaren@apple.com>
1886 - Moved the arguments passed to JSClassCreate into a single structure,
1887 called JSClassDefinition. This will enable easier structure
1888 migration/versioning in the future, if necessary.
1890 - Added support for class names.
1892 - kJSClassDefinitionNull replaces kJSObjectCallbacksNone.
1894 - JSClass is becoming a fairly complex struct, so I migrated all of its
1895 implementation other than reference counting to the sruct.
1897 - Also moved JSClass* functions in the API to JSObjectRef.cpp, since they're
1898 declared in JSObjectRef.h
1900 - Also added some more informative explanation to the class structure doc.
1902 2006-07-15 Darin Adler <darin@apple.com>
1906 - fix http://bugs.webkit.org/show_bug.cgi?id=8395
1907 <rdar://problem/4613467>
1908 REGRESSION: RegEx seems broken for hex escaped non breaking space
1910 Test: fast/js/regexp-extended-characters-more.html
1913 (match): Got rid of utf16Length local variable to guarantee there's no
1914 extra stack usage in recursive calls. Fixed two places in the PCRE_UTF16
1915 code that were using the length variable, which is the UTF-8 length of
1916 a character in the pattern, to move in the UTF-16 subject string. Instead
1917 they hardcode lengths of 1 and 2 since the code already handles BMP
1918 characters and surrogate pairs separately. Also fixed some DPRINTF so
1919 I could compile with DEBUG on.
1920 (pcre_exec): Changed a place that was checking for multibyte characters
1921 in the subject string to use ISMIDCHAR. Instead it was using hardcoded
1922 logic that was right for UTF-8 but wrong for UTF-16.
1924 * pcre/pcre_compile.c: (pcre_compile2): Fixed a DPRINTF so I could compile
1927 2006-07-14 Geoffrey Garen <ggaren@apple.com>
1931 Global replace in the API of argc/argv with argumentCount/arguments.
1933 2006-07-14 Geoffrey Garen <ggaren@apple.com>
1937 - Finalized exception handling in the API.
1939 setProperty can throw because it throws for built-in arrays. getProperty
1940 and deleteProperty can throw because setProperty can throw and we want
1941 to be consistent, and also because they seem like "actions." callAsFunction,
1942 callAsConstructor, and hasInstance can throw, because they caan throw for
1945 toBoolean can't throw because it's defined that way in the spec.
1947 - Documented that toBoolean and toObject can't be overridden by custom
1948 objects because they're defined that way in the spec.
1950 === Safari-521.17 ===
1952 2006-07-14 Geoffrey Garen <ggaren@apple.com>
1956 - Implemented ref-counting of JSContexts by splitting into two datatypes:
1957 JSGlobalContext, which you can create/retain/release, and JSContext, which
1960 Internally, you retain a JSGlobalContext/ExecState by retaining its
1961 interpreter, which, in the case of a global ExecState, owns it.
1963 - Also made ~Interpreter() protected to catch places where Interpreter
1964 is manually deleted. (Can't make it private because some crazy fool
1965 decided it would be a good idea to subclass Interpreter in other frameworks.
1969 (toJS): Added cast for new JSGlobalContext
1970 * API/JSStringRef.h: Changed vague "you must" language to more specific
1971 (but, ultimately, equally vague) "behavior is undefined if you don't"
1973 (KJS::Interpreter::Interpreter): Factored more common initialization into
1975 * kjs/interpreter.h:
1976 (KJS::Interpreter::ref): new
1977 (KJS::Interpreter::deref): new
1978 (KJS::Interpreter::refCount): new
1980 (doIt): Ref-count the interpreter.
1982 2006-07-14 Maciej Stachowiak <mjs@apple.com>
1986 - removed bool return value from JSObjectSetProperty, since it is inefficient and
1987 also doesn't work quite right
1988 - added JSObjectGetPropertyAtIndex and JSObjectSetPropertyAtIndex
1990 * API/JSObjectRef.cpp:
1991 (JSObjectSetProperty): Removed return value and canPut stuff.
1992 (JSObjectGetPropertyAtIndex): Added.
1993 (JSObjectSetPropertyAtIndex): Added.
1994 * API/JSObjectRef.h: Prototyped and documented new functions.
1996 2006-07-14 Geoffrey Garen <ggaren@apple.com>
2000 Moved JSCheckScriptSyntax, JSEvaluateScript, and JSGarbageCollect into
2001 JSBase.h/.cpp. They don't belong in the value-specific or context-specific
2002 files because they're not part of the value or context implementations.
2005 * API/JSContextRef.cpp:
2006 (JSContextGetGlobalObject):
2007 * API/JSContextRef.h:
2008 * API/JSValueRef.cpp:
2011 * JavaScriptCore.xcodeproj/project.pbxproj:
2013 2006-07-13 Timothy Hatcher <timothy@apple.com>
2017 Moved JavaScriptCore to be a public framework.
2019 * JavaScriptCore.xcodeproj/project.pbxproj:
2021 2006-07-13 Mark Rowe <opendarwin.org@bdash.net.nz>
2023 Reviewed by Geoffrey.
2025 http://bugs.webkit.org/show_bug.cgi?id=9742
2026 Bug 9742: REGRESSION: WebKit hangs when loading <http://www.vtbook.com>
2029 (KJS::JSValue::getUInt32): Only types tagged as numeric can be converted to UInt32.
2031 2006-07-13 Geoffrey Garen <ggaren@apple.com>
2035 - Renamed JSEvaluate -> JSEvaluateScript, JSCheckSyntax -> JSCheckScriptSyntax
2036 - Added exception out parameters to JSValueTo* and JSValueIsEqual because
2038 - Removed JSObjectGetDescription because it's useless and vague, and
2039 JSValueToString/JSValueIsObjectOfClass do a better job, anyway
2040 - Clarified comments about "IsFunction/Constructor" to indicate that they
2041 are true of all functions/constructors, not just those created by JSObjectMake*
2043 2006-07-12 Geoffrey Garen <ggaren@apple.com>
2047 Finished previously approved JSInternalString -> JSString conversion
2048 by renaming the files.
2050 * API/JSCallbackObject.cpp:
2051 * API/JSInternalStringRef.cpp: Removed.
2052 * API/JSInternalStringRef.h: Removed.
2053 * API/JSStringRef.cpp: Added.
2054 * API/JSStringRef.h: Added.
2055 * API/JavaScriptCore.h:
2056 * JavaScriptCore.xcodeproj/project.pbxproj:
2058 2006-07-12 Geoffrey Garen <ggaren@apple.com>
2062 - Removed context and exception parameters from JSObjectGetPropertyEnumerator,
2063 removing the spurious use of ExecState inside JavaScriptCore that made
2064 us think this was necessary in the first place.
2066 (StringInstance::getPropertyList): Use getString instead of toString because
2067 we know we're dealing with a string -- we put it there in the first place.
2068 While we're at it, store the string's size instead of retrieving it each time
2069 through the loop, to avoid the unnecessary killing of puppies.
2070 * kjs/string_object.h:
2072 2006-07-12 Maciej Stachowiak <mjs@apple.com>
2076 - add handling of hasInstance callback for API objects
2078 * API/JSCallbackObject.cpp:
2079 (KJS::JSCallbackObject::implementsHasInstance): Check if callback is present.
2080 (KJS::JSCallbackObject::hasInstance): Invoke appropriate callback.
2081 * API/JSCallbackObject.h:
2082 * API/JSClassRef.cpp:
2083 * API/JSObjectRef.h:
2085 (MyObject_hasInstance): Test case; should match what construct would do.
2088 2006-07-11 Geoffrey Garen <ggaren@apple.com>
2092 - Implemented a vast number of renames and comment clarifications
2093 suggested during API review.
2095 JSInternalString -> JSString
2096 JS*Make -> JSValueMake*, JSObjectMake*
2097 JSTypeCode -> JSType
2098 JSValueIsInstanceOf -> JSValueIsInstanceOfConstructor (reads strangely well in client code)
2099 JSGC*Protect -> JSValue*Protect
2100 JS*Callback -> JSObject*Callback
2101 JSGetPropertyListCallback -> JSObjectAddPropertiesToListCallback
2102 JSPropertyEnumeratorGetNext -> JSPropertyEnumeratorGetNextName
2104 JSStringCreateWithUTF8CString, JSStringGetUTF8CString,
2105 JSStringGetMaximumUTF8CStringSize JSStringIsEqualToUTF8CString,
2106 JSStringCreateWithCFString, JSStringCopyCFString, JSStringCreateWithCharacters.
2108 - Changed functions taking a JSValue out arg and returning a bool indicating
2109 whether it was set to simply return a JSValue or NULL.
2111 - Removed JSStringGetCharacters because it's more documentation than code,
2112 and it's just a glorified memcpy built on existing API functionality.
2114 - Moved standard library includes into the headers that actually require them.
2116 - Standardized use of the phrase "Create Rule."
2118 - Removed JSLock from make functions that don't allocate.
2120 - Added exception handling to JSValueToBoolean, since we now allow
2121 callback objects to throw exceptions upon converting to boolean.
2123 - Renamed JSGCCollect to JSGarbageCollect.
2125 2006-07-10 Geoffrey Garen <ggaren@apple.com>
2129 - Changed public header includes to the <JavaScriptCore/ style.
2130 - Changed instances of 'buffer' to 'string' since we decided on
2131 JSInternalString instead of JSStringBuffer.
2133 * API/JSContextRef.h:
2134 * API/JSInternalStringRef.cpp:
2136 (JSInternalStringRetain):
2137 (JSInternalStringRelease):
2138 (JSValueCopyStringValue):
2139 (JSInternalStringGetLength):
2140 (JSInternalStringGetCharactersPtr):
2141 (JSInternalStringGetCharacters):
2142 (JSInternalStringGetMaxLengthUTF8):
2143 (JSInternalStringGetCharactersUTF8):
2144 (CFStringCreateWithJSInternalString):
2145 * API/JSInternalStringRef.h:
2147 (JSNodePrototype_appendChild):
2148 (JSNode_getNodeType):
2149 * API/JSObjectRef.cpp:
2150 (JSObjectCallAsConstructor):
2152 * API/JavaScriptCore.h:
2157 (MyObject_getPropertyList):
2158 (myConstructor_callAsConstructor):
2159 (main): I noticed that we were prematurely releasing some string buffers,
2160 so I moved their release calls to the end of main(). I got rid of 'Buf' in *Buf
2161 (sometimes changing to 'IString', when necessary to differentiate a variable)
2162 to match the buffer->string change.
2164 === Safari-521.16 ===
2166 2006-07-10 Darin Adler <darin@apple.com>
2168 * kjs/value.cpp: (KJS::JSValue::toInt32Inline): Added inline keyword one more place.
2171 2006-07-10 Darin Adler <darin@apple.com>
2173 - fix the release build
2177 (KJS::JSValue::toInt32Inline): Move the code here to an inline.
2178 (KJS::JSValue::toInt32): Call the inline from both overloaded toInt32 functions.
2180 2006-07-10 David Kilzer <ddkilzer@kilzer.net>
2184 - fix http://bugs.webkit.org/show_bug.cgi?id=9179
2185 Implement select.options.add() method
2187 * JavaScriptCore.exp: Added overloaded KJS::JSValue::toInt32() method.
2188 * JavaScriptCore.xcodeproj/project.pbxproj: Altered attributes metadata for
2189 kjs/value.h to make it available as a forwarded header.
2191 (KJS::lookupPut): Extracted a lookupPut() method from the existing lookupPut() method.
2192 The new method returns a boolean value if no entry is found in the lookup table.
2194 (KJS::JSValue::toInt32): Overloaded toInt32() method with boolean "Ok" argument.
2195 * kjs/value.h: Ditto.
2197 2006-07-10 Geoffrey Garen <ggaren@apple.com>
2199 No review necessary. Removed bogus file I accidentally checked in before.
2201 * API/JSInternalSringRef.h: Removed.
2203 2006-07-10 Geoffrey Garen <ggaren@apple.com>
2207 Added exception out parameter to API object callbacks, removed semi-bogus
2208 JSContext(.*)Exception functions.
2210 To make these calls syntactically simple, I added an exceptionSlot()
2211 method to the ExecState class, which provides a JSValue** slot in which to
2212 store a JSValue* exception.
2216 * API/JSCallbackConstructor.cpp:
2217 (KJS::JSCallbackConstructor::construct):
2218 * API/JSCallbackFunction.cpp:
2219 (KJS::JSCallbackFunction::callAsFunction):
2220 * API/JSCallbackObject.cpp:
2221 (KJS::JSCallbackObject::init):
2222 (KJS::JSCallbackObject::getOwnPropertySlot):
2223 (KJS::JSCallbackObject::put):
2224 (KJS::JSCallbackObject::deleteProperty):
2225 (KJS::JSCallbackObject::construct):
2226 (KJS::JSCallbackObject::callAsFunction):
2227 (KJS::JSCallbackObject::getPropertyList):
2228 (KJS::JSCallbackObject::toBoolean):
2229 (KJS::JSCallbackObject::toNumber):
2230 (KJS::JSCallbackObject::toString):
2231 (KJS::JSCallbackObject::staticValueGetter):
2232 (KJS::JSCallbackObject::callbackGetter):
2233 * API/JSContextRef.cpp:
2235 * API/JSContextRef.h:
2237 (JSNodePrototype_appendChild):
2238 (JSNodePrototype_removeChild):
2239 (JSNodePrototype_replaceChild):
2240 (JSNode_getNodeType):
2241 (JSNode_getChildNodes):
2242 (JSNode_getFirstChild):
2246 (JSNodeListPrototype_item):
2247 (JSNodeList_length):
2248 (JSNodeList_getProperty):
2249 * API/JSObjectRef.h:
2253 (MyObject_initialize):
2254 (MyObject_hasProperty):
2255 (MyObject_getProperty):
2256 (MyObject_setProperty):
2257 (MyObject_deleteProperty):
2258 (MyObject_getPropertyList):
2259 (MyObject_callAsFunction):
2260 (MyObject_callAsConstructor):
2261 (MyObject_convertToType):
2262 (print_callAsFunction):
2263 (myConstructor_callAsConstructor):
2265 * JavaScriptCore.exp:
2267 (KJS::ExecState::exceptionHandle):
2269 2006-07-10 Geoffrey Garen <ggaren@apple.com>
2273 Improved type safety by implementing opaque JSValue/JSObject typing through
2274 abuse of 'const', not void*. Also fixed an alarming number of bugs
2275 exposed by this new type safety.
2277 I made one design change in JavaScriptCore, which is that the JSObject
2278 constructor should take a JSValue* as its prototype argument, not a JSObject*,
2279 since we allow the prototype to be any JSValue*, including jsNull(), for
2285 * API/JSCallbackConstructor.cpp:
2286 (KJS::JSCallbackConstructor::construct):
2287 * API/JSCallbackFunction.cpp:
2288 (KJS::JSCallbackFunction::callAsFunction):
2289 * API/JSCallbackObject.cpp:
2290 (KJS::JSCallbackObject::JSCallbackObject):
2291 (KJS::JSCallbackObject::getOwnPropertySlot):
2292 (KJS::JSCallbackObject::put):
2293 (KJS::JSCallbackObject::construct):
2294 (KJS::JSCallbackObject::callAsFunction):
2295 (KJS::JSCallbackObject::staticFunctionGetter):
2296 * API/JSCallbackObject.h:
2297 * API/JSContextRef.cpp:
2300 (JSNodePrototype_appendChild):
2301 (JSNodePrototype_removeChild):
2302 (JSNodePrototype_replaceChild):
2303 * API/JSObjectRef.cpp:
2305 (JSFunctionMakeWithBody):
2306 (JSObjectGetProperty):
2307 (JSObjectCallAsFunction):
2308 (JSObjectCallAsConstructor):
2309 * API/JSObjectRef.h:
2314 (KJS::JSObject::JSObject):
2316 2006-07-10 Geoffrey Garen <ggaren@apple.com>
2318 Approved by Maciej, Darin.
2320 Renamed JSStringBufferRef to JSInternalStringRef. "Internal string" means the
2321 JavaScript engine's internal string representation, which is the most
2322 low-level and efficient representation to use when interfacing with JavaScript.
2328 * API/JSCallbackObject.cpp:
2329 (KJS::JSCallbackObject::getOwnPropertySlot):
2330 (KJS::JSCallbackObject::put):
2331 (KJS::JSCallbackObject::deleteProperty):
2332 (KJS::JSCallbackObject::staticValueGetter):
2333 (KJS::JSCallbackObject::callbackGetter):
2334 * API/JSContextRef.cpp:
2337 * API/JSContextRef.h:
2338 * API/JSInternalStringRef.cpp: Added.
2340 (JSInternalStringCreate):
2341 (JSInternalStringCreateUTF8):
2342 (JSInternalStringRetain):
2343 (JSInternalStringRelease):
2344 (JSValueCopyStringValue):
2345 (JSInternalStringGetLength):
2346 (JSInternalStringGetCharactersPtr):
2347 (JSInternalStringGetCharacters):
2348 (JSInternalStringGetMaxLengthUTF8):
2349 (JSInternalStringGetCharactersUTF8):
2350 (JSInternalStringIsEqual):
2351 (JSInternalStringIsEqualUTF8):
2352 (JSInternalStringCreateCF):
2353 (CFStringCreateWithJSInternalString):
2354 * API/JSInternalStringRef.h: Added.
2356 (JSNodePrototype_appendChild):
2357 (JSNode_getNodeType):
2358 (JSNode_getChildNodes):
2359 (JSNode_getFirstChild):
2361 (JSNodeList_length):
2362 (JSNodeList_getProperty):
2363 * API/JSObjectRef.cpp:
2364 (JSFunctionMakeWithBody):
2365 (JSObjectGetDescription):
2366 (JSObjectHasProperty):
2367 (JSObjectGetProperty):
2368 (JSObjectSetProperty):
2369 (JSObjectDeleteProperty):
2370 (JSPropertyEnumeratorGetNext):
2371 (JSPropertyListAdd):
2372 * API/JSObjectRef.h:
2373 * API/JSStringBufferRef.cpp: Removed.
2374 * API/JSStringBufferRef.h: Removed.
2376 * API/JavaScriptCore.h:
2381 (assertEqualsAsUTF8String):
2382 (assertEqualsAsCharactersPtr):
2383 (assertEqualsAsCharacters):
2384 (MyObject_hasProperty):
2385 (MyObject_getProperty):
2386 (MyObject_setProperty):
2387 (MyObject_deleteProperty):
2388 (MyObject_getPropertyList):
2389 (print_callAsFunction):
2390 (myConstructor_callAsConstructor):
2392 * JavaScriptCore.exp:
2393 * JavaScriptCore.xcodeproj/project.pbxproj:
2395 2006-07-08 Tim Omernick <timo@apple.com>
2399 Added an OpenGL drawing model to the Netscape Plug-in API.
2403 2006-07-08 Timothy Hatcher <timothy@apple.com>
2407 Moved KJS_GetCreatedJavaVMs to jni_utility.cpp.
2408 Switched KJS_GetCreatedJavaVMs over to use dlopen and dlsym
2409 now that NSAddImage, NSLookupSymbolInImage and NSAddressOfSymbol
2410 are deprecated in Leopard.
2412 * JavaScriptCore.exp:
2413 * JavaScriptCore.xcodeproj/project.pbxproj:
2414 * bindings/jni/jni_utility.cpp:
2415 (KJS::Bindings::KJS_GetCreatedJavaVMs):
2416 * bindings/softlinking.c: Removed.
2417 * bindings/softlinking.h: Removed.
2419 2006-07-08 Geoffrey Garen <ggaren@apple.com>
2423 - Make JSObjectGetProperty return a JSValue or NULL, like JSEvaluate does.
2425 * API/JSObjectRef.cpp:
2426 (JSObjectGetProperty):
2427 * API/JSObjectRef.h:
2431 2006-07-08 Geoffrey Garen <ggaren@apple.com>
2433 Style change -- no review necessary.
2435 Use 0 instead of NULL in API .cpp files, to match our style guidelines.
2437 * API/JSContextRef.cpp:
2439 * API/JSObjectRef.cpp:
2440 (JSFunctionMakeWithBody):
2441 (JSObjectCallAsFunction):
2442 (JSObjectCallAsConstructor):
2443 * API/JSValueRef.cpp:
2446 2006-07-08 Geoffrey Garen <ggaren@apple.com>
2450 - Added ability to pass NULL for thisObject when calling JSObjectCallAsFunction,
2451 to match JSEvaluate.
2453 * API/JSObjectRef.cpp:
2454 (JSObjectCallAsFunction):
2455 * API/JSObjectRef.h:
2459 === Safari-521.15 ===
2461 2006-07-07 Geoffrey Garen <ggaren@apple.com>
2465 - Standardized which functions take a JSContext as an argument. The rule is:
2466 if you might execute JavaScript, you take a JSContext, otherwise you don't.
2468 The FIXME in JSObjectRef.h requires refactoring some parts of Interpreter,
2469 but not API changes, so I'm putting it off until later.
2471 * API/JSCallbackObject.cpp:
2472 (KJS::JSCallbackObject::JSCallbackObject):
2473 (KJS::JSCallbackObject::init):
2474 * API/JSCallbackObject.h:
2475 * API/JSContextRef.cpp:
2477 * API/JSContextRef.h:
2478 * API/JSObjectRef.cpp:
2480 (JSPropertyEnumeratorGetNext):
2481 * API/JSObjectRef.h:
2483 (MyObject_initialize):
2485 * JavaScriptCore.exp:
2486 * kjs/array_object.cpp:
2487 (ArrayInstance::setLength):
2488 (ArrayInstance::pushUndefinedObjectsToEnd):
2490 (ForInNode::execute):
2491 * kjs/reference.cpp:
2492 (KJS::Reference::getPropertyName):
2493 (KJS::Reference::getValue):
2495 * kjs/scope_chain.cpp:
2496 (KJS::ScopeChain::print):
2498 2006-07-06 Geoffrey Garen <ggaren@apple.com>
2504 - Headerdoc finished
2507 - Added a JSContextRef argument to many functions, because you need a
2508 JSContextRef for doing virtually anything. I expect to add this argument
2509 to even more functions in a future patch.
2511 - Removed the globalObjectPrototype argument to JSContextCreate because
2512 you can't create an object until you have a context, so it's impossible
2513 to pass a prototype object to JSContextCreate. That's OK because (1) there's
2514 no reason to give the global object a prototype and (2) if you really want
2515 to, you can just use a separate call to JSObjectSetPrototype.
2517 - Removed the JSClassRef argument to JSClassCreate because it was unnecessary,
2518 and you need to be able to make the global object's class before you've
2519 created a JSContext.
2521 - Added an optional exception parameter to JSFunctionMakeWithBody because anything
2522 less would be uncivilized.
2524 - Made the return value parameter to JSObjectGetProperty optional to match
2525 all other return value parameters in the API.
2527 - Made JSObjectSetPrivate/JSObjectGetPrivate work on JSCallbackFunctions
2528 and JSCallbackConstructors. You could use an abstract base class or strategic
2529 placement of m_privateData in the class structure to implement this, but
2530 the former seemed like overkill, and the latter seemed too dangerous.
2532 - Fixed a bug where JSPropertyEnumeratorGetNext would skip the first property.
2535 - Reversed the logic of the JSChar #ifdef to avoid confusing headerdoc
2537 - Removed function names from @function declarations because headeroc
2538 can parse them automatically, and I wanted to rule out manual mismatch.
2540 - Changed Error::create to take a const UString& instead of a UString*
2541 because it was looking at me funny.
2543 - Renamed JSStringBufferCreateWithCFString to JSStringBufferCreateCF
2544 because the latter is more concise and it matches JSStringBufferCreateUTF8.
2546 * API/JSCallbackObject.cpp:
2547 (KJS::JSCallbackObject::getOwnPropertySlot):
2548 (KJS::JSCallbackObject::put):
2549 (KJS::JSCallbackObject::deleteProperty):
2550 (KJS::JSCallbackObject::getPropertyList):
2551 (KJS::JSCallbackObject::toBoolean):
2552 (KJS::JSCallbackObject::toNumber):
2553 (KJS::JSCallbackObject::toString):
2554 * API/JSClassRef.cpp:
2556 * API/JSContextRef.cpp:
2558 (JSContextSetException):
2559 * API/JSContextRef.h:
2561 (JSNodePrototype_class):
2564 (JSNodeListPrototype_class):
2566 * API/JSObjectRef.cpp:
2567 (JSObjectGetProperty):
2568 (JSObjectGetPrivate):
2569 (JSObjectSetPrivate):
2570 (JSObjectCallAsFunction):
2571 (JSObjectCallAsConstructor):
2572 (JSPropertyEnumeratorGetNext):
2573 * API/JSObjectRef.h:
2574 * API/JSStringBufferRef.cpp:
2575 (JSStringBufferCreateCF):
2576 * API/JSStringBufferRef.h:
2577 * API/JSValueRef.cpp:
2578 (JSValueIsInstanceOf):
2584 (MyObject_hasProperty):
2585 (MyObject_setProperty):
2586 (MyObject_deleteProperty):
2587 (MyObject_getPropertyList):
2588 (MyObject_convertToType):
2591 * JavaScriptCore.exp:
2593 2006-07-07 Geoffrey Garen <ggaren@apple.com>
2597 - Fixed a few crashes resulting from NULL parameters to JSClassCreate.
2599 * API/JSClassRef.cpp:
2602 * API/testapi.c: Added test for NULL parameters.
2605 2006-07-07 Geoffrey Garen <ggaren@apple.com>
2607 Reviewed by John, mocked by Darin.
2609 - Changed JSEvaluate to take a JSObjectRef instead of a JSValueRef as
2610 "this," since "this" must be an object.
2612 * API/JSContextRef.cpp:
2614 * API/JSContextRef.h:
2616 2006-07-07 Geoffrey Garen <ggaren@apple.com>
2623 * JavaScriptCore.xcodeproj/project.pbxproj:
2625 2006-07-05 Geoffrey Garen <ggaren@apple.com>
2629 Renamed JSCharBufferRef, which was universally unpopular, to JSStringBufferRef,
2630 which, hopefully, will be less unpopular.
2636 * API/JSCallbackObject.cpp:
2637 (KJS::JSCallbackObject::getOwnPropertySlot):
2638 (KJS::JSCallbackObject::put):
2639 (KJS::JSCallbackObject::deleteProperty):
2640 (KJS::JSCallbackObject::staticValueGetter):
2641 (KJS::JSCallbackObject::callbackGetter):
2642 * API/JSCharBufferRef.cpp: Removed.
2643 * API/JSCharBufferRef.h: Removed.
2644 * API/JSContextRef.cpp:
2647 * API/JSContextRef.h:
2649 (JSNodePrototype_appendChild):
2650 (JSNode_getNodeType):
2651 (JSNode_getChildNodes):
2652 (JSNode_getFirstChild):
2654 (JSNodeList_length):
2655 (JSNodeList_getProperty):
2656 * API/JSObjectRef.cpp:
2657 (JSFunctionMakeWithBody):
2658 (JSObjectGetDescription):
2659 (JSObjectHasProperty):
2660 (JSObjectGetProperty):
2661 (JSObjectSetProperty):
2662 (JSObjectDeleteProperty):
2663 (JSPropertyEnumeratorGetNext):
2664 (JSPropertyListAdd):
2665 * API/JSObjectRef.h:
2666 * API/JSStringBufferRef.cpp: Added.
2668 (JSStringBufferCreate):
2669 (JSStringBufferCreateUTF8):
2670 (JSStringBufferRetain):
2671 (JSStringBufferRelease):
2672 (JSValueCopyStringValue):
2673 (JSStringBufferGetLength):
2674 (JSStringBufferGetCharactersPtr):
2675 (JSStringBufferGetCharacters):
2676 (JSStringBufferGetMaxLengthUTF8):
2677 (JSStringBufferGetCharactersUTF8):
2678 (JSStringBufferIsEqual):
2679 (JSStringBufferIsEqualUTF8):
2680 (JSStringBufferCreateWithCFString):
2681 (CFStringCreateWithJSStringBuffer):
2682 * API/JSStringBufferRef.h: Added.
2684 * API/JavaScriptCore.h:
2689 (assertEqualsAsUTF8String):
2690 (assertEqualsAsCharactersPtr):
2691 (assertEqualsAsCharacters):
2692 (MyObject_hasProperty):
2693 (MyObject_getProperty):
2694 (MyObject_setProperty):
2695 (MyObject_deleteProperty):
2696 (MyObject_getPropertyList):
2697 (print_callAsFunction):
2698 (myConstructor_callAsConstructor):
2700 * JavaScriptCore.exp:
2701 * JavaScriptCore.xcodeproj/project.pbxproj:
2703 2006-07-05 Geoffrey Garen <ggaren@apple.com>
2707 Moved some code around for more logical file separation.
2710 * API/JSContextRef.h:
2711 * API/JSObjectRef.cpp:
2712 * API/JSValueRef.cpp:
2716 2006-07-03 Geoffrey Garen <ggaren@apple.com>
2720 Implemented JSFunctionMakeWithBody, which parses a script as a function body
2721 in the global scope, and returns the resulting anonymous function.
2723 I also removed private data from JSCallbackFunction. It never worked,
2724 since JSCallbackFunction doesn't inherit from JSCallbackObject.
2726 * API/JSCallbackConstructor.cpp: Removed.
2727 * API/JSCallbackConstructor.h: Removed.
2728 * API/JSCallbackFunction.cpp:
2729 (KJS::JSCallbackFunction::JSCallbackFunction):
2730 (KJS::JSCallbackFunction::implementsConstruct):
2731 (KJS::JSCallbackFunction::construct):
2732 (KJS::JSCallbackFunction::implementsCall):
2733 (KJS::JSCallbackFunction::callAsFunction):
2734 * API/JSCallbackFunction.h:
2735 * API/JSCallbackObject.cpp:
2736 (KJS::JSCallbackObject::staticFunctionGetter):
2737 * API/JSObjectRef.cpp:
2739 (JSFunctionMakeWithCallbacks):
2740 * API/JSObjectRef.h:
2746 * JavaScriptCore.exp: Programmatically added all symbols exported by
2747 API object files, and sorted results
2748 * JavaScriptCore.xcodeproj/project.pbxproj:
2750 2006-07-03 Geoffrey Garen <ggaren@apple.com>
2754 - Return syntax error in JSCheckSyntax through a JSValueRef* exception
2758 * API/JSContextRef.cpp:
2762 * JavaScriptCore.exp:
2763 * kjs/interpreter.cpp:
2764 (KJS::Interpreter::checkSyntax):
2765 * kjs/interpreter.h:
2767 2006-07-04 Darin Adler <darin@apple.com>
2771 * wtf/MathExtras.h: Oops. Added missing #endif.
2773 2006-07-04 Bjoern Graf <bjoern.graf@gmail.com>
2776 Tweaked a bit by Darin.
2778 - http://bugs.webkit.org/show_bug.cgi?id=9678
2779 work around MSVCRT's fmod function returning NaN for fmod(x, infinity) instead of x
2781 * wtf/MathExtras.h: Added include of <float.h>.
2782 (isinf): Fix to return false for NAN.
2783 (wtf_fmod): Added. An inline that works around the bug.
2786 * kjs/number_object.cpp:
2787 * kjs/operations.cpp:
2789 Added includes of MathExtras.h to all files using fmod.
2791 * JavaScriptCore.xcodeproj/project.pbxproj: Let Xcode 2.3 have its way with
2794 2006-07-01 Geoffrey Garen <ggaren@apple.com>
2798 - Refined value conversions in the API:
2799 - failed toNumber returns NaN
2800 - failed toObject returns NULL
2801 - failed toString returns empty string
2803 - Refined excpetion handling in the API:
2804 - failed value conversions do not throw exceptions
2805 - uncaught exceptions in JSEvaluate, JSObjectCallAsFunction, and
2806 JSObjectCallAsConstructor are returned through a JSValueRef* exception
2808 - removed JSContextHasException, because JSContextGetException does
2812 * API/JSCharBufferRef.cpp:
2813 (JSValueCopyStringValue):
2814 * API/JSContextRef.cpp:
2816 * API/JSContextRef.h:
2817 * API/JSNodeList.c: Added test code demonstrating how you would use
2818 toNumber, and why you probably don't need toUInt32, etc.
2819 (JSNodeListPrototype_item):
2820 (JSNodeList_getProperty):
2821 * API/JSObjectRef.cpp:
2823 (JSObjectCallAsFunction):
2824 (JSObjectCallAsConstructor):
2825 * API/JSObjectRef.h:
2826 * API/JSValueRef.cpp:
2832 (main): Added tests for new rules, and call to JSGCProtect to fix Intel
2834 * JavaScriptCore.exp:
2836 2006-07-03 Darin Adler <darin@apple.com>
2838 - Rolled out HashMap implementation of NPRuntime, at least temporarily.
2840 Fixes hang in the bindings section of layout tests seen on the
2843 This code was using HashMap<const char*, PrivateIdentifier*>.
2844 But that hashes based on pointer identity, not string value.
2845 The default hash for any pointer type is to hash based on the pointer.
2846 And WTF doesn't currently have a string hash for char*.
2847 We'll need to fix that before re-landing this patch.
2849 (Formatting was also incorrect -- extra spaces in parentheses.)
2851 * bindings/npruntime.cpp: Rolled out last change.
2853 2006-07-02 Justin Haygood <jhaygood@spsu.edu>
2855 Reviewed, tweaked, landed by ggaren.
2857 - Port NPRuntime from CFDictionary to HashMap.
2859 * bindings/npruntime.cpp:
2860 (getStringIdentifierDictionary):
2861 (getIntIdentifierDictionary):
2862 (_NPN_GetStringIdentifier):
2863 (_NPN_GetIntIdentifier):
2864 * bindings/npruntime.h:
2866 2006-07-01 Geoffrey Garen <ggaren@apple.com>
2870 - Fixed <rdar://problem/4611197> REGRESSION: Liveconnect with Java test
2871 fails at http://www-sor.inria.fr/~dedieu/notes/liveconnect/simple_example.html
2873 * JavaScriptCore.exp: Export symbols used by liveconnect
2875 2006-06-29 Geoffrey Garen <ggaren@apple.com>
2879 - Phase 2 in the JS API.
2881 - Added support for specifying static tables of values -- this should
2882 obviate the need for using complicated callbacks for most lookups.
2884 - API objects are now created with classes (JSClassRef) -- in order to support
2885 static values, and in order to prevent API objects from storing their
2886 data inline, and thus falling into the oversized (read: slow and prone to
2887 giving Maciej the frowny face) heap.
2889 - Added two specialized JSObject subclasses -- JSCallbackFunction and JSCallbackConstructor --
2890 to allow JSFunctionMake and JSConstructorMake to continue to work with
2891 the new class model. Another solution to this problem would be to create
2892 a custom class object for each function and constructor you make. This
2893 solution is more code but also more efficient.
2895 - Substantially beefed up the minidom example to demonstrate and test a
2896 lot of these techniques. Its output is still pretty haphazard, though.
2898 - Gave the <kjs/ preface to some includes -- I'm told this matters to
2899 building on some versions of Linux.
2901 - Implemented JSValueIsInstanceOf and JSValueIsObjectOfClass
2903 - Removed GetDescription callback. Something in the class datastructure
2904 should take care of this.
2907 * API/JSCallbackConstructor.cpp: Added.
2909 (KJS::JSCallbackConstructor::JSCallbackConstructor):
2910 (KJS::JSCallbackConstructor::implementsConstruct):
2911 (KJS::JSCallbackConstructor::construct):
2912 (KJS::JSCallbackConstructor::setPrivate):
2913 (KJS::JSCallbackConstructor::getPrivate):
2914 * API/JSCallbackConstructor.h: Added.
2915 (KJS::JSCallbackConstructor::classInfo):
2916 * API/JSCallbackFunction.cpp: Added.
2918 (KJS::JSCallbackFunction::JSCallbackFunction):
2919 (KJS::JSCallbackFunction::implementsCall):
2920 (KJS::JSCallbackFunction::callAsFunction):
2921 (KJS::JSCallbackFunction::setPrivate):
2922 (KJS::JSCallbackFunction::getPrivate):
2923 * API/JSCallbackFunction.h: Added.
2924 (KJS::JSCallbackFunction::classInfo):
2925 * API/JSCallbackObject.cpp:
2927 (KJS::JSCallbackObject::JSCallbackObject):
2928 (KJS::JSCallbackObject::init):
2929 (KJS::JSCallbackObject::~JSCallbackObject):
2930 (KJS::JSCallbackObject::className):
2931 (KJS::JSCallbackObject::getOwnPropertySlot):
2932 (KJS::JSCallbackObject::put):
2933 (KJS::JSCallbackObject::deleteProperty):
2934 (KJS::JSCallbackObject::implementsConstruct):
2935 (KJS::JSCallbackObject::construct):
2936 (KJS::JSCallbackObject::implementsCall):
2937 (KJS::JSCallbackObject::callAsFunction):
2938 (KJS::JSCallbackObject::getPropertyList):
2939 (KJS::JSCallbackObject::toBoolean):
2940 (KJS::JSCallbackObject::toNumber):
2941 (KJS::JSCallbackObject::toString):
2942 (KJS::JSCallbackObject::inherits):
2943 (KJS::JSCallbackObject::staticValueGetter):
2944 (KJS::JSCallbackObject::staticFunctionGetter):
2945 (KJS::JSCallbackObject::callbackGetter):
2946 * API/JSCallbackObject.h:
2947 * API/JSCharBufferRef.cpp:
2948 * API/JSClassRef.cpp: Added.
2952 * API/JSClassRef.h: Added.
2953 (StaticValueEntry::StaticValueEntry):
2954 (StaticFunctionEntry::StaticFunctionEntry):
2955 (__JSClass::__JSClass):
2956 * API/JSContextRef.cpp:
2959 * API/JSContextRef.h:
2960 * API/JSNode.c: Added.
2961 (JSNodePrototype_appendChild):
2962 (JSNodePrototype_removeChild):
2963 (JSNodePrototype_replaceChild):
2964 (JSNodePrototype_class):
2965 (JSNode_getNodeType):
2966 (JSNode_getChildNodes):
2967 (JSNode_getFirstChild):
2973 * API/JSNode.h: Added.
2974 * API/JSNodeList.c: Added.
2975 (JSNodeListPrototype_item):
2976 (JSNodeListPrototype_class):
2977 (JSNodeList_length):
2978 (JSNodeList_getProperty):
2979 (JSNodeList_finalize):
2981 (JSNodeList_prototype):
2983 * API/JSNodeList.h: Added.
2984 * API/JSObjectRef.cpp:
2987 (JSConstructorMake):
2988 (__JSPropertyEnumerator::__JSPropertyEnumerator):
2989 (JSObjectCreatePropertyEnumerator):
2990 (JSPropertyEnumeratorGetNext):
2991 (JSPropertyEnumeratorRetain):
2992 (JSPropertyEnumeratorRelease):
2993 * API/JSObjectRef.h:
2994 (__JSObjectCallbacks::):
2995 * API/JSValueRef.cpp:
2996 (JSValueIsObjectOfClass):
2997 (JSValueIsInstanceOf):
2999 * API/Node.c: Added.
3003 (Node_replaceChild):
3006 * API/Node.h: Added.
3007 * API/NodeList.c: Added.
3013 * API/NodeList.h: Added.
3017 (createStringWithContentsOfFile):
3020 (assertEqualsAsCharacters):
3021 (MyObject_getProperty):
3023 (myConstructor_callAsConstructor):
3026 * JavaScriptCore.xcodeproj/project.pbxproj:
3028 2006-06-26 Kevin Ollivier <kevino@theolliviers.com>
3030 Reviewed and tweaked by Darin.
3032 - Compile fixes for wx port / gcc 4.0.2
3034 * kjs/array_object.cpp:
3035 Added missing headers.
3038 gcc needs class prototypes before defining those classes as friend classes
3040 2006-06-30 Mike Emmel <mike.emmel@gmail.com>
3044 Compilation fixes for Linux/Gdk.
3046 * JavaScriptCore/kjs/interpreter.cpp: added include of signal.h
3047 * JavaScriptCore/kjs/ExecState.h: added missing class declaration
3048 * JavaScriptCore/kjs/ExecState.cpp: case wrong on include of context.h
3049 * JavaScriptCore/JavaScriptCoreSources.bkl: added Context.cpp and ExecState.cpp
3051 === Safari-521.14 ===
3053 2006-06-29 Maciej Stachowiak <mjs@apple.com>
3057 - add headerdoc comments to some of the new JS API headers
3062 2006-06-28 Timothy Hatcher <timothy@apple.com>
3064 Prefer the Stabs debugging symbols format until DWARF bugs are fixed.
3066 * JavaScriptCore.xcodeproj/project.pbxproj:
3068 2006-06-27 Timothy Hatcher <timothy@apple.com>
3072 <rdar://problem/4448350> Deprecated ObjC language API used in JavaScriptCore, WebCore, WebKit and WebBrowser
3074 Switch to the new ObjC 2 API, ifdefed the old code around OBJC_API_VERSION so it still works on Tiger.
3075 Removed the use of the old stringWithCString, switched to the new Tiger version that accepts an encoding.
3076 Lots of code style cleanup.
3078 * JavaScriptCore.xcodeproj/project.pbxproj:
3079 * bindings/objc/objc_class.h:
3080 * bindings/objc/objc_class.mm:
3081 (KJS::Bindings::ObjcClass::~ObjcClass):
3082 (KJS::Bindings::_createClassesByIsAIfNecessary):
3083 (KJS::Bindings::ObjcClass::classForIsA):
3084 (KJS::Bindings::ObjcClass::name):
3085 (KJS::Bindings::ObjcClass::methodsNamed):
3086 (KJS::Bindings::ObjcClass::fieldNamed):
3087 (KJS::Bindings::ObjcClass::fallbackObject):
3088 * bindings/objc/objc_header.h:
3089 * bindings/objc/objc_instance.h:
3090 * bindings/objc/objc_instance.mm:
3091 (ObjcInstance::ObjcInstance):
3092 (ObjcInstance::~ObjcInstance):
3093 (ObjcInstance::operator=):
3094 (ObjcInstance::begin):
3095 (ObjcInstance::end):
3096 (ObjcInstance::getClass):
3097 (ObjcInstance::invokeMethod):
3098 (ObjcInstance::invokeDefaultMethod):
3099 (ObjcInstance::setValueOfField):
3100 (ObjcInstance::supportsSetValueOfUndefinedField):
3101 (ObjcInstance::setValueOfUndefinedField):
3102 (ObjcInstance::getValueOfField):
3103 (ObjcInstance::getValueOfUndefinedField):
3104 (ObjcInstance::defaultValue):
3105 (ObjcInstance::stringValue):
3106 (ObjcInstance::numberValue):
3107 (ObjcInstance::booleanValue):
3108 (ObjcInstance::valueOf):
3109 * bindings/objc/objc_runtime.h:
3110 * bindings/objc/objc_runtime.mm:
3111 (ObjcMethod::ObjcMethod):
3113 (ObjcMethod::getMethodSignature):
3114 (ObjcMethod::setJavaScriptName):
3117 (ObjcField::valueFromInstance):
3118 (convertValueToObjcObject):
3119 (ObjcField::setValueToInstance):
3120 (ObjcArray::operator=):
3121 (ObjcArray::setValueAt):
3122 (ObjcArray::valueAt):
3123 (ObjcFallbackObjectImp::ObjcFallbackObjectImp):
3124 (ObjcFallbackObjectImp::callAsFunction):
3125 (ObjcFallbackObjectImp::defaultValue):
3127 2006-06-28 Anders Carlsson <acarlsson@apple.com>
3131 http://bugs.webkit.org/show_bug.cgi?id=8636
3132 REGRESSION: JavaScript access to Java applet causes hang (_webViewURL not implemented)
3134 * bindings/jni/jni_objc.mm:
3135 (KJS::Bindings::dispatchJNICall):
3136 Just pass nil as the calling URL. This will cause the Java plugin to use the URL of the page
3137 containing the applet (which is what we used to do).
3139 2006-06-27 Timothy Hatcher <timothy@apple.com>
3143 <rdar://problem/4406785> Add an export file to TOT JavaScriptCore like the Safari-2-0-branch
3145 * JavaScriptCore.exp: Added.
3146 * JavaScriptCore.xcodeproj/project.pbxproj:
3148 2006-06-25 Geoffrey Garen <ggaren@apple.com>
3152 - Added JSConstructorMake to match JSFunctionMake, along with test code.
3154 [ I checked in the ChangeLog before without the actual files. ]
3156 * API/JSObjectRef.cpp:
3157 (JSConstructorMake):
3158 * API/JSObjectRef.h:
3160 (myConstructor_callAsConstructor):
3164 * JavaScriptCore.xcodeproj/project.pbxproj: Moved testapi.c to the testapi
3165 target -- this was an oversight in my earlier check-in.
3167 2006-06-25 Timothy Hatcher <timothy@apple.com>
3171 Bug 9574: Drosera should show inline scripts within the original HTML
3172 http://bugs.webkit.org/show_bug.cgi?id=9574
3174 Pass the starting line number and error message to the debugger.
3177 (Debugger::sourceParsed):
3180 (KJS::GlobalFuncImp::callAsFunction):
3181 * kjs/function_object.cpp:
3182 (FunctionObjectImp::construct):
3183 * kjs/interpreter.cpp:
3184 (KJS::Interpreter::evaluate):
3186 2006-06-24 Alexey Proskuryakov <ap@nypop.com>
3188 Rubber-stamped by Eric.
3190 Add a -h (do not follow symlinks) option to ln in derived sources build script (without it,
3191 a symlink was created inside the source directory on second build).
3193 * JavaScriptCore.xcodeproj/project.pbxproj:
3195 2006-06-24 David Kilzer <ddkilzer@kilzer.net>
3197 Reviewed by Timothy.
3199 * Info.plist: Fixed copyright to include 2003-2006.
3201 2006-06-24 Alexey Proskuryakov <ap@nypop.com>
3205 - http://bugs.webkit.org/show_bug.cgi?id=9418
3206 WebKit will not build when Space exists in path
3208 * JavaScriptCore.xcodeproj/project.pbxproj: Enclose search paths in quotes; create symlinks to
3209 avoid passing paths with spaces to make.
3211 2006-06-23 Timothy Hatcher <timothy@apple.com>
3215 Adding more operator[] overloads for long and short types.
3218 (WTF::Vector::operator[]):
3220 === JavaScriptCore-521.13 ===
3222 2006-06-22 Alexey Proskuryakov <ap@nypop.com>
3226 - http://bugs.webkit.org/show_bug.cgi?id=9539
3227 Another case error preventing build
3229 * API/JSObjectRef.cpp: Changed "identifier.h" to "Identifier.h"
3231 2006-06-22 David Kilzer <ddkilzer@kilzer.net>
3235 http://bugs.webkit.org/show_bug.cgi?id=9539
3236 Another case error preventing build
3238 * API/APICast.h: Changed "UString.h" to "ustring.h".
3240 2006-06-21 Geoffrey Garen <ggaren@apple.com>
3242 Fixed release build, fixed accidental infinite recursion due to
3243 last minute global replace gone awry.
3248 (assertEqualsAsBoolean):
3249 (assertEqualsAsNumber):
3250 (assertEqualsAsUTF8String):
3251 (assertEqualsAsCharactersPtr):
3252 * JavaScriptCore.xcodeproj/project.pbxproj:
3254 2006-06-21 Geoffrey Garen <ggaren@apple.com>
3258 - First cut at C API to JavaScript. Includes a unit test, 'testapi.c',
3259 and the outline of a test app, 'minidom.c'.
3261 Includes one change to JSC internals: Rename propList to getPropertyList and have it
3262 take its target property list by reference so that subclasses can
3263 add properties to the list before calling through to their superclasses.
3265 Also, I just ran prepare-ChangeLog in about 10 seconds, and I would like
3266 to give a shout-out to that.
3268 * API/APICast.h: Added.
3271 * API/JSBase.h: Added.
3272 * API/JSCallbackObject.cpp: Added.
3274 (KJS::JSCallbackObject::JSCallbackObject):
3275 (KJS::JSCallbackObject::~JSCallbackObject):
3276 (KJS::JSCallbackObject::className):
3277 (KJS::JSCallbackObject::getOwnPropertySlot):
3278 (KJS::JSCallbackObject::put):
3279 (KJS::JSCallbackObject::deleteProperty):
3280 (KJS::JSCallbackObject::implementsConstruct):
3281 (KJS::JSCallbackObject::construct):
3282 (KJS::JSCallbackObject::implementsCall):
3283 (KJS::JSCallbackObject::callAsFunction):
3284 (KJS::JSCallbackObject::getPropertyList):
3285 (KJS::JSCallbackObject::toBoolean):
3286 (KJS::JSCallbackObject::toNumber):
3287 (KJS::JSCallbackObject::toString):
3288 (KJS::JSCallbackObject::setPrivate):
3289 (KJS::JSCallbackObject::getPrivate):
3290 (KJS::JSCallbackObject::cachedValueGetter):
3291 (KJS::JSCallbackObject::callbackGetter):
3292 * API/JSCallbackObject.h: Added.
3293 (KJS::JSCallbackObject::classInfo):
3294 * API/JSCharBufferRef.cpp: Added.
3296 (JSCharBufferCreate):
3297 (JSCharBufferCreateUTF8):
3298 (JSCharBufferRetain):
3299 (JSCharBufferRelease):
3300 (JSValueCopyStringValue):
3301 (JSCharBufferGetLength):
3302 (JSCharBufferGetCharactersPtr):
3303 (JSCharBufferGetCharacters):
3304 (JSCharBufferGetMaxLengthUTF8):
3305 (JSCharBufferGetCharactersUTF8):
3306 (JSCharBufferIsEqual):
3307 (JSCharBufferIsEqualUTF8):
3308 (JSCharBufferCreateWithCFString):
3309 (CFStringCreateWithJSCharBuffer):
3310 * API/JSCharBufferRef.h: Added.
3311 * API/JSContextRef.cpp: Added.
3314 (JSContextGetGlobalObject):
3317 (JSContextHasException):
3318 (JSContextGetException):
3319 (JSContextClearException):
3320 (JSContextSetException):
3321 * API/JSContextRef.h: Added.
3322 * API/JSObjectRef.cpp: Added.
3326 (JSObjectGetDescription):
3327 (JSObjectGetPrototype):
3328 (JSObjectSetPrototype):
3329 (JSObjectHasProperty):
3330 (JSObjectGetProperty):
3331 (JSObjectSetProperty):
3332 (JSObjectDeleteProperty):
3333 (JSObjectGetPrivate):
3334 (JSObjectSetPrivate):
3335 (JSObjectIsFunction):
3336 (JSObjectCallAsFunction):
3337 (JSObjectIsConstructor):
3338 (JSObjectCallAsConstructor):
3339 (__JSPropertyListEnumerator::__JSPropertyListEnumerator):
3340 (JSObjectCreatePropertyEnumerator):
3341 (JSPropertyEnumeratorGetNext):
3342 (JSPropertyEnumeratorRetain):
3343 (JSPropertyEnumeratorRelease):
3344 (JSPropertyListAdd):
3345 * API/JSObjectRef.h: Added.
3346 * API/JSValueRef.cpp: Added.
3348 (JSValueIsUndefined):
3355 (JSValueIsStrictEqual):
3365 * API/JSValueRef.h: Added.
3366 * API/JavaScriptCore.h: Added.
3367 * API/minidom.c: Added.
3369 * API/minidom.html: Added.
3370 * API/minidom.js: Added.
3371 * API/testapi.c: Added.
3372 (assertEqualsAsBoolean):
3373 (assertEqualsAsNumber):
3374 (assertEqualsAsUTF8String):
3375 (assertEqualsAsCharactersPtr):
3376 (assertEqualsAsCharacters):
3377 (MyObject_initialize):
3378 (MyObject_copyDescription):
3379 (MyObject_hasProperty):
3380 (MyObject_getProperty):
3381 (MyObject_setProperty):
3382 (MyObject_deleteProperty):
3383 (MyObject_getPropertyList):
3384 (MyObject_callAsFunction):
3385 (MyObject_callAsConstructor):
3386 (MyObject_convertToType):
3387 (MyObject_finalize):
3388 (print_callAsFunction):
3390 (createStringWithContentsOfFile):
3391 * API/testapi.js: Added.
3393 * JavaScriptCore.xcodeproj/project.pbxproj:
3394 * bindings/npruntime_impl.h:
3395 * kjs/array_instance.h:
3396 * kjs/array_object.cpp:
3397 (ArrayInstance::getPropertyList):
3398 * kjs/interpreter.cpp:
3399 (KJS::Interpreter::evaluate):
3401 (ForInNode::execute):
3403 (KJS::JSObject::put):
3404 (KJS::JSObject::canPut):
3405 (KJS::JSObject::deleteProperty):
3406 (KJS::JSObject::propertyIsEnumerable):
3407 (KJS::JSObject::getPropertyAttributes):
3408 (KJS::JSObject::getPropertyList):
3410 * kjs/property_map.cpp:
3411 (KJS::PropertyMap::get):
3412 * kjs/property_map.h:
3413 * kjs/scope_chain.cpp:
3414 (KJS::ScopeChain::print):
3415 * kjs/string_object.cpp:
3416 (StringInstance::getPropertyList):
3417 * kjs/string_object.h:
3419 (KJS::UString::Rep::ref):
3421 2006-06-20 Timothy Hatcher <timothy@apple.com>
3425 Make sure we clear the exception before returning so
3426 that future calls will not fail because of an earlier
3427 exception state. Assert on entry that the WebScriptObject
3428 is working with an ExecState that dose not have an exception.
3429 Document that evaluateWebScript and callWebScriptMethod return
3430 WebUndefined when an exception is thrown.
3432 * bindings/objc/WebScriptObject.h:
3433 * bindings/objc/WebScriptObject.mm:
3434 (-[WebScriptObject callWebScriptMethod:withArguments:]):
3435 (-[WebScriptObject evaluateWebScript:]):
3436 (-[WebScriptObject setValue:forKey:]):
3437 (-[WebScriptObject valueForKey:]):
3438 (-[WebScriptObject removeWebScriptKey:]):
3439 (-[WebScriptObject webScriptValueAtIndex:]):
3440 (-[WebScriptObject setWebScriptValueAtIndex:value:]):
3442 2006-06-19 Anders Carlsson <acarlsson@apple.com>
3446 * kjs/interpreter.cpp:
3447 (KJS::TimeoutChecker::pauseTimeoutCheck):
3448 (KJS::TimeoutChecker::resumeTimeoutCheck):
3449 Fix argument order in setitimer calls.
3451 2006-06-18 Anders Carlsson <acarlsson@apple.com>
3455 * kjs/interpreter.cpp:
3456 (KJS::TimeoutChecker::pauseTimeoutCheck):
3457 Do nothing if the timeout check hasn't been started.
3459 (KJS::TimeoutChecker::resumeTimeoutCheck):
3460 Do nothing if the timeout check hasn't been started.
3461 Use the right signal handler when unblocking.
3463 (KJS::Interpreter::handleTimeout):
3464 pause/resume the timeout check around the call to
3465 shouldInterruptScript().
3467 2006-06-16 Ben Goodger <beng@google.com>
3471 http://bugs.webkit.org/show_bug.cgi?id=9491
3472 Windows build breaks in interpreter.cpp
3474 * kjs/interpreter.cpp
3475 (KJS::TimeoutChecker::pauseTimeoutCheck):
3476 (KJS::TimeoutChecker::resumeTimeoutCheck):
3477 Make sure to only assert equality with s_executingInterpreter when it
3478 is being used (i.e. when HAVE(SYS_TIME_H) == true)
3480 2006-06-17 David Kilzer <ddkilzer@kilzer.net>
3484 http://bugs.webkit.org/show_bug.cgi?id=9477
3485 REGRESSION: fast/dom/replaceChild.html crashes on WebKit ToT in debug build
3488 (KJS::FunctionImp::callAsFunction): Refetch the debugger after executing the function
3489 in case the WebFrame it was running in has since been destroyed.
3491 2006-06-17 David Kilzer <ddkilzer@kilzer.net>
3495 http://bugs.webkit.org/show_bug.cgi?id=9476
3496 REGRESSION: Reproducible crash after closing window after viewing
3497 css2.1/t0803-c5501-imrgn-t-00-b-ag.html
3500 (Debugger::detach): Call setDebugger(0) for all interpreters removed from
3501 the 'attached to a debugger' list.
3503 2006-06-17 Anders Carlsson <acarlsson@apple.com>
3505 Reviewed by Maciej and Geoff.
3507 http://bugs.webkit.org/show_bug.cgi?id=7080
3508 Provide some way to stop a JavaScript infinite loop
3512 Add Interrupted completion type.
3515 (KJS::FunctionImp::callAsFunction):
3516 (KJS::GlobalFuncImp::callAsFunction):
3517 Only set the exception on the new ExecState if the current one has had one.
3519 * kjs/interpreter.cpp:
3520 (KJS::TimeoutChecker::startTimeoutCheck):
3521 (KJS::TimeoutChecker::stopTimeoutCheck):
3522 (KJS::TimeoutChecker::alarmHandler):
3523 (KJS::TimeoutChecker::pauseTimeoutCheck):
3524 (KJS::TimeoutChecker::resumeTimeoutCheck):
3525 New TimeoutChecker class which handles setting Interpreter::m_timedOut flag after a given
3526 period of time. This currently only works on Unix platforms where setitimer and signals are used.
3528 (KJS::Interpreter::Interpreter):
3529 Initialize new member variables.
3531 (KJS::Interpreter::~Interpreter):
3532 Destroy the timeout checker.
3534 (KJS::Interpreter::startTimeoutCheck):
3535 (KJS::Interpreter::stopTimeoutCheck):
3536 (KJS::Interpreter::pauseTimeoutCheck):
3537 (KJS::Interpreter::resumeTimeoutCheck):
3538 Call the timeout checker.
3540 (KJS::Interpreter::handleTimeout):
3541 Called on timeout. Resets the m_timedOut flag and calls shouldInterruptScript.
3543 * kjs/interpreter.h:
3544 (KJS::Interpreter::setTimeoutTime):
3545 New function for setting the timeout time.
3547 (KJS::Interpreter::shouldInterruptScript):
3548 New function. The idea is that this should be overridden by subclasses in order to for example
3549 pop up a dialog asking the user if the script should be interrupted.
3551 (KJS::Interpreter::checkTimeout):
3552 New function which checks the m_timedOut flag and calls handleTimeout if it's set.
3555 (DoWhileNode::execute):
3556 (WhileNode::execute):
3558 Call Interpreter::checkTimeout after each iteration of the loop.
3560 2006-06-15 Timothy Hatcher <timothy@apple.com>
3562 Reviewed by Geoff and Darin.
3564 Prefer the DWARF debugging symbols format for use in Xcode 2.3.
3566 * JavaScriptCore.xcodeproj/project.pbxproj:
3568 2006-06-14 Geoffrey Garen <ggaren@apple.com>
3572 - fixed http://bugs.webkit.org/show_bug.cgi?id=9438
3573 Someone broke ToT: cannot build