1 2006-10-05 Kevin McCullough <KMcCullough@apple.com>
6 (KJS::dateToDayInYear):
8 2006-10-05 Mark Rowe <bdash@webkit.org>
10 Reviewed by maculloch.
14 * JavaScriptCoreSources.bkl: Add DateMath.cpp to file list.
16 2006-10-05 Kevin McCullough <KMcCullough@apple.com>
22 * JavaScriptCore.xcodeproj/project.pbxproj:
24 2006-10-04 Nikolas Zimmermann <zimmermann@kde.org>
28 Fix Qt/Linux build by adding DateMath.cpp to compilation.
30 * CMakeLists.txt: Also replace tabs with spaces.
32 2006-10-04 Kevin McCullough <KMcCullough@apple.com>
34 Reviewed by DethBakin.
36 - 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.
41 (KJS::dateToDayInYear):
43 2006-10-05 Darin Adler <darin@apple.com>
47 * wtf/Assertions.cpp: Changed assertion formatting to omit the "======"
48 lines so you can see more assertions in less space. Also improved format
49 of file/line information so it works with more development environments.
51 2006-10-04 Kevin McCullough <KMcCullough@apple.com>
55 - The build machine is more sensitive about automatic conversions. These fixes exp
56 licitly cast or change the input and return types of functions to avoid conversions.
58 * JavaScriptCore.xcodeproj/project.pbxproj:
64 (KJS::monthToDayInYear):
65 (KJS::dateToDayInYear):
66 (KJS::getDSTOffsetSimple):
68 (KJS::dateToMseconds):
71 2006-10-04 Kevin McCullough <KMcCullough@apple.com>
75 - 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.
77 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
78 * JavaScriptCore.xcodeproj/project.pbxproj:
79 * kjs/DateMath.cpp: Added.
82 (KJS::daysFrom1970ToYear):
83 (KJS::msFrom1970ToYear):
89 (KJS::msToMilliseconds):
95 (KJS::msToDayInMonth):
96 (KJS::monthToDayInYear):
97 (KJS::timeToMseconds):
98 (KJS::dateToDayInYear):
99 (KJS::equivalentYearForDST):
101 (KJS::getDSTOffsetSimple):
103 (KJS::localTimeToUTC):
104 (KJS::UTCToLocalTime):
105 (KJS::dateToMseconds):
108 * kjs/DateMath.h: Added.
110 * kjs/date_object.cpp:
113 (KJS::DateInstance::getTime):
114 (KJS::DateInstance::getUTCTime):
115 (KJS::DateProtoFunc::callAsFunction):
116 (KJS::DateObjectImp::construct):
117 (KJS::DateObjectFuncImp::callAsFunction):
122 2006-10-02 Nikolas Zimmermann <zimmermann@kde.org>
124 Reviewed/landed by Adam.
126 Build testkjs on Qt/Linux.
130 2006-10-02 Nikolas Zimmermann <zimmermann@kde.org>
132 Reviewed by eseidel. Landed by eseidel.
134 Fix win32 build, which has no inttypes.h
138 2006-10-02 Nikolas Zimmermann <zimmermann@kde.org>
140 Reviewed by eseidel & mjs. Landed by eseidel.
142 Fix Qt/Linux build with older gcc 3.3.4.
143 http://bugs.webkit.org/show_bug.cgi?id=11116
145 * kjs/lookup.h: Move cacheGlobalObject into KJS namespace.
146 (KJS::cacheGlobalObject): Also remove GCC_ROOT_NS_HACK.
147 * wtf/Assertions.h: Include inttypes.h for uintptr_t.
149 2006-09-28 Steve Falkenburg <sfalken@apple.com>
153 Use $(ConfigSuffix) set via vsprops files to add _debug
154 to end of debug filenames.
156 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
157 * JavaScriptCore.vcproj/debug.vsprops: Added.
158 * JavaScriptCore.vcproj/dftables/dftables.vcproj:
159 * JavaScriptCore.vcproj/release.vsprops: Added.
160 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
162 2006-09-28 Darin Adler <darin@apple.com>
166 - support for change that should fix <rdar://problem/4733044>
167 REGRESSION: XML iBench shows 10% perf. regression (copying
168 strings while decoding)
170 * wtf/Vector.h: Changed VectorBuffer so that the general case
171 contains an instance of the 0 case, since deriving from it
172 was violating the Liskov Substitution Principle.
173 (WTF::VectorBuffer::releaseBuffer): Added. Releases the buffer so it can
174 be adopted by another data structure that uses the FastMalloc.h allocator.
175 Returns 0 if the internal buffer was being used.
176 (WTF::Vector::releaseBuffer): Added. Releases the buffer as above or creates
177 a new one in the case where the internal buffer was being used.
179 2006-09-28 Maciej Stachowiak <mjs@apple.com>
183 - change garbage collection to happen at increments proportional to number of live objects, not always
184 every 1000 allocations
187 (KJS::Collector::allocate):
189 2006-09-28 Maciej Stachowiak <mjs@apple.com>
193 - fixed REGRESSION (r16606): javascriptCore Crash on website load
197 - fixed some possible off-by-one bugs
198 - use indexing, not iterators, for Vectors
199 - store Vector by pointer instead of by value to avoid blowing out FunctionImp size
202 (KJS::FunctionImp::addParameter):
203 (KJS::FunctionImp::parameterString):
204 (KJS::FunctionImp::processParameters):
205 (KJS::FunctionImp::lengthGetter):
206 (KJS::FunctionImp::getParameterName):
209 2006-09-27 Steve Falkenburg <sfalken@apple.com>
215 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
216 * JavaScriptCore.vcproj/JavaScriptCore/dstroot-to-sdk.cmd: Removed.
218 2006-09-27 John Sullivan <sullivan@apple.com>
221 (KJS::FunctionImp::getParameterName):
222 removed assertion that displeased gcc 4.0.1 (build 5420):
223 ASSERT(static_cast<size_t>(index) == index);
225 2006-09-27 Kevin McCullough <KMcCullough@apple.com>
229 Cleanup of previous fix which was to address Radar: 4752492
232 (KJS::FunctionImp::addParameter):
233 (KJS::FunctionImp::parameterString):
234 (KJS::FunctionImp::processParameters):
235 (KJS::FunctionImp::lengthGetter):
236 (KJS::FunctionImp::getParameterName):
239 2006-09-27 Kevin McCullough <KMcCullough@apple.com>
243 Fixes a GC stack overflow crash.
244 The change is to move from a linked list implementation of Parameters to a Vector.
245 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.
248 (KJS::Parameter::Parameter):
249 (KJS::FunctionImp::addParameter):
250 (KJS::FunctionImp::parameterString):
251 (KJS::FunctionImp::processParameters):
252 (KJS::FunctionImp::lengthGetter):
253 (KJS::FunctionImp::getParameterName):
256 2006-09-27 Steve Falkenburg <sfalken@apple.com>
260 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
262 2006-09-27 Steve Falkenburg <sfalken@apple.com>
264 Set path before build.
266 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
268 2006-09-27 Sean Gies <seangies@apple.com>
270 Reviewed by Adam Roben.
272 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Debug config should link to debug runtime.
273 * JavaScriptCore.vcproj/dftables/dftables.vcproj: Debug config should link to debug runtime.
275 2006-09-27 Don Melton <gramps@apple.com>
277 Reviewed by Adam Roben.
279 Changed line ending from DOS to UNIX format so it doesn't die running
282 * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
284 2006-09-23 Alexey Proskuryakov <ap@nypop.com>
288 http://bugs.webkit.org/show_bug.cgi?id=10183
289 REGRESSION: obfuscated JS decoding breaks because of soft hyphen removal
290 (Fanfiction.net author pages not listing stories)
292 Rolled out the fix for bug 4139.
297 * tests/mozilla/ecma/Array/15.4.5.1-1.js:
298 * tests/mozilla/expected.html:
300 2006-09-22 Steve Falkenburg <sfalken@apple.com>
304 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
306 2006-09-22 Darin Adler <darin@apple.com>
310 * wtf/Vector.h: Add an append that takes a pointer and length.
311 Generalize the existing Vector append to work on vectors with
312 any value for inlineCapacity. Change the append algorithm so
313 it doesn't check capacity each time through the loop.
315 2006-09-22 Steve Falkenburg <sfalken@apple.com>
319 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
321 2006-09-21 Geoffrey Garen <ggaren@apple.com>
325 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
326 Updated to include the right path.
327 * wtf/FastMalloc.h: #include Platform.h, since we use Platform macros.
329 === Safari-521.27 ===
331 2006-09-20 Anders Carlsson <acarlsson@apple.com>
333 Reviewed by Dave Hyatt.
338 2006-09-20 Sean Gies <seangies@apple.com>
340 Reviewed by Steve Falkenburg.
342 * wtf/Assertions.cpp: Debug messages should go into debugger console.
344 2006-09-20 David Hyatt <hyatt@apple.com>
346 Add an implementation of lrint for Win32.
353 2006-09-15 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
357 http://bugs.webkit.org/show_bug.cgi?id=10864
358 Bug 10864: Linux\GDK build fixes
360 * JavaScriptCoreSources.bkl:
363 2006-09-15 Adam Roben <aroben@apple.com>
367 * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
369 2006-09-15 Anders Carlsson <acarlsson@apple.com>
371 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
372 Fix the release build.
374 2006-09-15 Anders Carlsson <acarlsson@apple.com>
378 Add JavaScriptCore API to the build.
380 * API/JSCallbackConstructor.cpp:
381 * API/JSCallbackFunction.cpp:
382 * API/JSCallbackObject.cpp:
383 * API/JSClassRef.cpp:
384 * API/JSContextRef.cpp:
385 * API/JSObjectRef.cpp:
386 * API/JSStringRef.cpp:
387 * API/JSValueRef.cpp:
388 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
389 * os-win32/stdbool.h: Added.
391 2006-09-12 Steve Falkenburg <sfalken@apple.com>
395 Build tweaks (doing JavaScriptCore now since it doesn't have
398 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
399 * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
400 * JavaScriptCore.vcproj/JavaScriptCore/dstroot-to-sdk.cmd: Added.
401 * JavaScriptCore.vcproj/dftables/dftables.vcproj:
402 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
404 2006-09-11 Brady Eidson <beidson@apple.com>
406 Build fix - I think Tim's last checkin wasn't tested on Tiger, possibly. I simply
407 commented out the undefined constants until he can have a chance to make the right call
409 * bindings/objc/objc_utility.mm:
410 (KJS::Bindings::objcValueTypeForType): Commented out undefined symbols
412 2006-09-11 Timothy Hatcher <timothy@apple.com>
414 Reviewed by Tim O. and Darin.
416 Add support for more method signatures affecting ObjC methods called from JavaScript:
417 - Added unsigned types and long long.
418 - Allow methods that use const, oneway, bycopy and byref type modifiers.
420 * bindings/objc/objc_instance.mm:
421 (ObjcInstance::invokeMethod):
422 * bindings/objc/objc_utility.h:
424 * bindings/objc/objc_utility.mm:
425 (KJS::Bindings::convertValueToObjcValue):
426 (KJS::Bindings::convertObjcValueToValue):
427 (KJS::Bindings::objcValueTypeForType):
429 2006-09-05 Timothy Hatcher <timothy@apple.com>
433 <rdar://problem/4715840> SEL is not char*
435 * bindings/objc/objc_class.mm:
436 (KJS::Bindings::ObjcClass::methodsNamed): use sel_getName instead of a char* cast.
437 * bindings/objc/objc_runtime.mm:
438 (ObjcFallbackObjectImp::callAsFunction): ditto
440 2006-09-03 Alexey Proskuryakov <ap@nypop.com>
444 http://bugs.webkit.org/show_bug.cgi?id=10693
445 Convert JavaScript arrays to AppleScript lists
447 * JavaScriptCore.exp: Export ArrayInstance::info and ArrayInstance::getItem().
448 * kjs/array_instance.h:
449 * kjs/array_object.cpp:
450 (ArrayInstance::getItem): Added a method to access array items from C++.
452 2006-09-02 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
456 Bug 10454: Unix bakefile fixes
457 http://bugs.webkit.org/show_bug.cgi?id=10454
459 * JavaScriptCoreSources.bkl:
461 2006-09-01 Nikolas Zimmermann <zimmermann@kde.org>
463 Reviewed by hyatt. Landed by eseidel.
467 * pcre/CMakeLists.txt: Add wtf/ include.
469 2006-09-01 Nikolas Zimmermann <zimmermann@kde.org>
471 Reviewed and landed by ap.
473 Fix build on Linux (C89 without gcc extensions enabled).
475 * pcre/pcre_internal.h: Use C style comments.
476 * wtf/Assertions.h: Use C style comments.
477 * wtf/Platform.h: Use C style comments.
479 2006-09-01 Steve Falkenburg <sfalken@apple.com>
483 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
484 * JavaScriptCore.vcproj/dftables/dftables.vcproj:
486 2006-08-31 Anders Carlsson <acarlsson@apple.com>
490 Add new portability functions to MathExtras.h and add StringExtras.h which is for
491 string portability functions.
493 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
494 * bindings/c/c_instance.cpp:
495 * kjs/date_object.cpp:
499 * wtf/StringExtras.h: Added.
503 2006-08-31 Anders Carlsson <acarlsson@apple.com>
509 * JavaScriptCore.vcproj/dftables/dftables.vcproj:
510 * pcre/pcre_internal.h:
512 2006-08-31 Timothy Hatcher <timothy@apple.com>
516 Band-aid fix for PCRE to compile for ppc64 and x86_64 now that
517 we use -Wshorten-64-to-32. Adds an INT_CAST macro that ASSERTs
518 the value <= INT_MAX.
520 I filed <rdar://problem/4712064> to track the need to verify
521 PCRE's 64-bit compliance.
523 * pcre/pcre_compile.c:
532 (pcre_get_substring_list):
533 * pcre/pcre_internal.h:
534 * pcre/pcre_tables.c:
535 * pcre/pcre_try_flipped.c:
538 2006-08-30 Darin Adler <darin@apple.com>
540 Reviewed by Tim Hatcher.
542 - add WTF::getPtr, a function template that makes it possible to write
543 generic code that gets a raw pointer out of any of our pointer types
545 * JavaScriptCore.xcodeproj/project.pbxproj:
546 * wtf/GetPtr.h: Added.
547 * wtf/ListRefPtr.h: (WTF::getPtr): Added.
548 * wtf/OwnArrayPtr.h: (WTF::getPtr): Added.
549 * wtf/OwnPtr.h: (WTF::getPtr): Added.
550 * wtf/PassRefPtr.h: (WTF::getPtr): Added.
551 * wtf/RefPtr.h: (WTF::getPtr): Added.
553 2006-08-29 waylonis <waylonis@google.com>
555 Reviewed, tweaked by ggaren.
557 - Added storage and accessor functions for ExecState as a fix for
558 http://bugs.webkit.org/show_bug.cgi?id=10114
561 (KJS::ExecState::ExecState):
564 (KJS::Context::setExecState):
565 (KJS::Context::execState):
567 2006-08-30 Nikolas Zimmermann <zimmermann@kde.org>
571 Commit KDE related tweaks, to be able to
572 differentiate between a Qt-only or a KDE build.
574 * CMakeLists.txt: Install wtf-unity library.
575 * wtf/Platform.h: Add define for the KDE platform.
577 2006-08-28 Darin Adler <darin@apple.com>
581 * kjs/list.h: Use explicit in constructor (as appropriate).
583 2006-08-24 Nikolas Zimmermann <zimmermann@kde.org>
585 Reviewed, tweaked and landed by ap
587 http://bugs.webkit.org/show_bug.cgi?id=10467
588 WebKit should have Qt platform support (Part II)
590 * CMakeLists.txt: Adjust to Anders' build fixes.
591 * wtf/Platform.h: Fix define for the Qt platform (we don't use/need Cairo.)
593 2006-08-23 David Hyatt <hyatt@apple.com>
595 Fix Platform.h to include #defines for graphics features.
599 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
602 2006-08-23 Anders Carlsson <acarlsson@apple.com>
606 Make the bindings compile without CoreFoundation.
608 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
609 * bindings/c/c_instance.cpp:
610 * bindings/c/c_utility.cpp:
611 (KJS::Bindings::convertUTF8ToUTF16):
613 * bindings/runtime.cpp:
614 (KJS::Bindings::Instance::createBindingForLanguageInstance):
615 (KJS::Bindings::Instance::createLanguageInstanceForValue):
616 * bindings/runtime_root.cpp:
617 * bindings/runtime_root.h:
618 * kjs/interpreter.cpp:
619 (KJS::Interpreter::createLanguageInstanceForValue):
622 2006-08-22 Anders Carlsson <acarlsson@apple.com>
626 Move the npruntime code over to using HashMap and the runtime_root code over to using
627 HashMap and HashCountedSet.
629 * bindings/NP_jsobject.cpp:
630 * bindings/c/c_utility.cpp:
631 (KJS::Bindings::identifierFromNPIdentifier):
632 * bindings/c/c_utility.h:
633 * bindings/jni/jni_jsobject.cpp:
634 (JavaJSObject::invoke):
635 * bindings/npruntime.cpp:
636 (getStringIdentifierMap):
637 (getIntIdentifierMap):
638 (_NPN_GetStringIdentifier):
639 (_NPN_GetIntIdentifier):
640 * bindings/runtime_root.cpp:
641 (getReferencesByRootMap):
643 (KJS::Bindings::findReferenceSet):
644 (KJS::Bindings::rootForImp):
645 (KJS::Bindings::rootForInterpreter):
646 (KJS::Bindings::addNativeReference):
647 (KJS::Bindings::removeNativeReference):
648 (RootObject::removeAllNativeReferences):
649 * bindings/runtime_root.h:
651 2006-08-22 Anders Carlsson <acarlsson@apple.com>
655 Switch over the NPAPI and Java bindings to using HashMaps instead of dictionaries.
657 * JavaScriptCore.xcodeproj/project.pbxproj:
658 * bindings/c/c_class.cpp:
659 (KJS::Bindings::CClass::CClass):
660 (KJS::Bindings::CClass::~CClass):
661 (KJS::Bindings::CClass::classForIsA):
662 (KJS::Bindings::CClass::methodsNamed):
663 (KJS::Bindings::CClass::fieldNamed):
664 * bindings/c/c_class.h:
665 * bindings/jni/jni_class.cpp:
666 (JavaClass::JavaClass):
667 (JavaClass::~JavaClass):
668 (JavaClass::methodsNamed):
669 (JavaClass::fieldNamed):
670 * bindings/jni/jni_class.h:
671 * bindings/objc/objc_class.h:
672 * bindings/objc/objc_class.mm:
673 (KJS::Bindings::deleteMethod):
674 (KJS::Bindings::deleteField):
676 (KJS::Bindings::ObjcClass::methodsNamed):
677 (KJS::Bindings::ObjcClass::fieldNamed):
678 * bindings/runtime.cpp:
679 * bindings/runtime.h:
680 * bindings/runtime_object.cpp:
681 (RuntimeObjectImp::fieldGetter):
682 (RuntimeObjectImp::getOwnPropertySlot):
683 (RuntimeObjectImp::put):
684 (RuntimeObjectImp::canPut):
686 2006-08-21 Vladimir Olexa <vladimir.olexa@gmail.com>
690 http://bugs.webkit.org/show_bug.cgi?id=6252
691 JavaScript 1.6 Array.lastIndexOf
693 Test: fast/js/array-lastIndexOf.html
695 * kjs/array_object.cpp:
696 (ArrayProtoFunc::callAsFunction): Added a LastIndexOf case.
697 * kjs/array_object.h:
698 (KJS::ArrayProtoFunc::): Added LastIndexOf to enum.
699 * tests/mozilla/expected.html: Two more tests now pass.
701 2006-08-20 Nikolas Zimmermann <zimmermann@kde.org>
703 Reviewed by Maciej. Landed by rwlbuis.
705 Fixes parts of: http://bugs.webkit.org/show_bug.cgi?id=10463
706 WebKit should have Qt platform support
708 Removing obsolete QConstString/QString constructors in kjs code.
713 2006-08-17 Nikolas Zimmermann <zimmermann@kde.org>
715 Reviewed by Maciej. Landed by rwlbuis.
717 Fixes: http://bugs.webkit.org/show_bug.cgi?id=10463
718 WTF Changes needed for Qt platform code.
721 * wtf/unicode/UnicodeDecomposition.h: Added.
723 * wtf/unicode/UnicodeDirection.h: Added.
725 * wtf/unicode/qt4/UnicodeQt4.cpp: Added.
726 (WTF::Unicode::direction):
727 (WTF::Unicode::category):
728 (WTF::Unicode::decomposition):
729 * wtf/unicode/qt4/UnicodeQt4.h:
730 (WTF::Unicode::toLower):
731 (WTF::Unicode::toUpper):
732 (WTF::Unicode::isPrintableChar):
733 (WTF::Unicode::isSpace):
734 (WTF::Unicode::isPunct):
735 (WTF::Unicode::isDigit):
736 (WTF::Unicode::mirroredChar):
737 (WTF::Unicode::compare):
739 2006-08-17 Nikolas Zimmermann <zimmermann@kde.org>
741 Reviewed by Eric. Landed by rwlbuis.
743 Fixes: http://bugs.webkit.org/show_bug.cgi?id=10464
744 Offer a cmake build system for Qt platform.
746 * CMakeLists.txt: Added.
747 * pcre/CMakeLists.txt: Added.
749 2006-08-17 Anders Carlsson <acarlsson@apple.com>
756 2006-08-15 Steve Falkenburg <sfalken@apple.com>
762 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
765 2006-08-15 Mark Rowe <opendarwin.org@bdash.net.nz>
769 Build fix: DWARF and -gfull are incompatible with symbol separation.
771 * JavaScriptCore.xcodeproj/project.pbxproj:
773 2006-08-15 Mark Rowe <opendarwin.org@bdash.net.nz>
777 http://bugs.webkit.org/show_bug.cgi?id=10394
778 Bug 10394: WebKit Release and Production configurations should enable dead code stripping
780 * JavaScriptCore.xcodeproj/project.pbxproj:
782 2006-08-15 Mark Rowe <opendarwin.org@bdash.net.nz>
786 http://bugs.webkit.org/show_bug.cgi?id=10384
787 Bug 10384: Switch to DWARF for Release configuration
789 * JavaScriptCore.xcodeproj/project.pbxproj:
791 2006-08-13 Maks Orlovich <maksim@kde.org>
793 Reviewed (and tweaked a little) by Maciej.
795 - shrank the size of JSObject by 8 bytes and made the corresponding reduction to the cell size, resulting
796 in a 1.2% speed improvement on JS iBench (and probably overall memory savings).
798 This was done by removing _scope and _internalValue data members
799 from JSObject and moving them only to the subclasses that actually
803 (KJS::JSObject::mark): No need to mark scope or internal value here.
805 (KJS::JSObject::JSObject): Don't initialize them.
806 * kjs/JSWrapperObject.cpp: Added. New base class for object types that
807 wrap primitive values (Number, String, Boolean, Date).
808 (KJS::JSWrapperObject::mark):
809 * kjs/JSWrapperObject.h: Added.
810 (KJS::JSWrapperObject::JSWrapperObject):
811 (KJS::JSWrapperObject::internalValue):
812 (KJS::JSWrapperObject::setInternalValue):
813 * kjs/array_object.cpp:
814 (ArrayPrototype::ArrayPrototype): Don't set useless internal value.
815 * kjs/bool_object.cpp:
816 (BooleanInstance::BooleanInstance): Inherit from JSWrapperObject.
817 (BooleanProtoFunc::callAsFunction): Fixed to account for fact that not all
818 JSObjects have an internal value.
819 (BooleanObjectImp::construct): ditto.
821 * kjs/collector.cpp: Lowered cell size to 48.
822 (KJS::Collector::allocate): meaningless whitespace change
823 * kjs/date_object.cpp:
824 (KJS::DateInstance::DateInstance): Inherit from JSWrapperObject.
825 (KJS::DateProtoFunc::callAsFunction): adjusted for move of internalValue
826 (KJS::DateObjectImp::construct): ditto
828 * kjs/error_object.cpp:
829 (ErrorPrototype::ErrorPrototype): don't set internal value
830 * kjs/function.cpp: move _scope and related handling here
831 (KJS::FunctionImp::mark): mark scope
833 (KJS::FunctionImp::scope): moved here from JSObject
834 (KJS::FunctionImp::setScope): ditto
835 * kjs/number_object.cpp:
836 (NumberInstance::NumberInstance): inherit from JSWrapperObject
837 (NumberProtoFunc::callAsFunction): adjusted
838 (NumberObjectImp::construct): adjusted
839 * kjs/number_object.h: shring RegExp-related objects a little
840 * kjs/regexp_object.cpp:
841 (RegExpPrototype::RegExpPrototype): Adjust for size tweaks
842 (RegExpObjectImp::RegExpObjectImp): ditto
843 * kjs/regexp_object.h:
844 * kjs/string_object.cpp:
845 (StringInstance::StringInstance): inherit from JSWrapperObject
846 (StringProtoFunc::callAsFunction): adjusted
847 * kjs/string_object.h:
848 * JavaScriptCore.exp: Exported new methods as needed.
849 * JavaScriptCore.xcodeproj/project.pbxproj: Added new files to build.
851 2006-08-04 Brady Eidson <beidson@apple.com>
853 Reviewed by Geoff's rubber stamp
855 Fix a build break on Intel hardware causes by adapting stricter
856 compiler warnings (-Wshorten-64-to-32)
859 (assertEqualsAsNumber): manually cast some doubles to floats
862 2006-08-04 Sam Weinig <sam.weinig@gmail.com>
866 - patch for http://bugs.webkit.org/show_bug.cgi?id=10192
867 Make WebCore (and friends) compile with -Wshorten-64-to-32
869 * Adds -Wshorten-64-to-32 flag to Xcode project.
870 * Adds explicit casts where OK.
874 (JSNodeList_getProperty):
875 * JavaScriptCore.xcodeproj/project.pbxproj:
877 2006-08-04 Adam Roben <aroben@apple.com>
881 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Convert
884 2006-08-03 Sam Weinig <sam.weinig@gmail.com>
888 - patch for http://bugs.webkit.org/show_bug.cgi?id=10176
889 Make WebCore compile with -Wundef
891 * Adds -Wundef flag to Xcode project
892 * Converts #ifs to #ifdef and #ifndefs where needed.
893 * Added #define YYMAXDEPTH 10000 in kjs/grammar.y
894 to fix a warning from within Bison.
896 * JavaScriptCore.xcodeproj/project.pbxproj:
897 * bindings/jni/jni_jsobject.cpp:
898 (JavaJSObject::getSlot):
899 (JavaJSObject::setSlot):
901 * bindings/objc/objc_class.mm:
902 (KJS::Bindings::ObjcClass::methodsNamed):
903 (KJS::Bindings::ObjcClass::fieldNamed):
904 * bindings/objc/objc_instance.mm:
905 (ObjcInstance::invokeMethod):
906 * bindings/objc/objc_runtime.mm:
907 (ObjcMethod::getMethodSignature):
913 2006-08-03 Anders Carlsson <acarlsson@apple.com>
915 Reviewed by John Sullivan.
919 Return *this in operator=
921 2006-08-03 Adam Roben <aroben@apple.com>
925 - Fixed Windows build
927 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
928 * wtf/MathExtras.h: Implement inline versions of these functions
932 2006-08-02 Adam Roben <aroben@apple.com>
938 * kjs/date_object.cpp:
941 2006-07-29 Darin Adler <darin@apple.com>
943 - Removed tabs from these source files that still had them.
944 We don't use them; that way source files look fine in editors
945 that have tabs set to 8 spaces or to 4 spaces.
946 - Removed allow-tabs Subversion property from the files too.
948 * bindings/NP_jsobject.cpp:
949 * bindings/c/c_utility.cpp:
950 * bindings/jni/jni_runtime.cpp:
951 * bindings/jni/jni_utility.cpp:
952 * bindings/objc/objc_utility.mm:
953 * bindings/runtime.cpp:
954 * bindings/runtime_method.cpp:
955 * bindings/testbindings.cpp:
956 * bindings/testbindings.mm:
957 * kjs/date_object.cpp:
962 * kjs/string_object.cpp:
965 2006-07-29 Darin Adler <darin@apple.com>
967 * tests/mozilla/expected.html: Update test results now that regress-185165.js
968 is succeeding. I suspect Anders fix for bug 4620655 is the reason.
970 2006-07-29 Sam Weinig <sam.weinig@gmail.com>
974 - patch for http://bugs.webkit.org/show_bug.cgi?id=10080
975 Adopt pedantic changes from the Unity project to improve
976 cross-compiler compatibility
979 * Removing trailing semicolon from namespace braces.
980 * Removing trailing comma from last enum declaration.
981 * Updating to match style guidelines.
982 * Adding missing newline to the end of the file.
983 * Turning on gcc warning for missing newline at the end of a source file
984 (GCC_WARN_ABOUT_MISSING_NEWLINE in Xcode, -Wnewline in gcc).
985 * Alphabetical sorting of Xcode source list files.
986 * Replace use of non-portable variable-size array with Vector.
987 * Use C-style comments instead of C++ comments in files that might
988 be included by either C or C++ files.
990 * API/JSCallbackConstructor.cpp:
991 (KJS::JSCallbackConstructor::construct):
992 * API/JSCallbackFunction.cpp:
993 (KJS::JSCallbackFunction::callAsFunction):
994 * API/JSCallbackObject.cpp:
995 (KJS::JSCallbackObject::construct):
996 (KJS::JSCallbackObject::callAsFunction):
997 * JavaScriptCore.xcodeproj/project.pbxproj:
998 * JavaScriptCorePrefix.h:
999 * bindings/jni/jni_class.cpp:
1000 (JavaClass::fieldNamed):
1001 * bindings/jni/jni_class.h:
1002 * bindings/jni/jni_instance.cpp:
1003 (JavaInstance::JavaInstance):
1004 (JavaInstance::valueOf):
1005 * bindings/jni/jni_objc.mm:
1006 (KJS::Bindings::dispatchJNICall):
1007 * bindings/jni/jni_runtime.cpp:
1008 (JavaParameter::JavaParameter):
1009 (JavaArray::JavaArray):
1010 * bindings/jni/jni_runtime.h:
1011 * bindings/jni/jni_utility.h:
1012 * bindings/objc/objc_instance.h:
1013 * bindings/runtime_array.h:
1019 2006-07-29 Mike Emmel <mike.emmel@gmail.com>
1023 - fixes for Linux build
1025 * JavaScriptCoreSources.bkl: Added new files to build, kjs/PropertyNameArray.cpp
1026 and kjs/testkjs.cpp, and removed old files.
1028 2006-07-24 Dan Waylonis <waylonis@google.com>
1030 Reviewed and tweaked a bit by Darin.
1032 - fix http://bugs.webkit.org/show_bug.cgi?id=9902
1033 jsNull and NSNull not properly converted between JS and ObjC
1035 * bindings/objc/objc_utility.mm: (KJS::Bindings::convertObjcValueToValue):
1036 Added case for converting NSNull to jsNull.
1038 2006-07-24 Rob Buis <buis@kde.org>
1042 http://bugs.webkit.org/show_bug.cgi?id=4258
1043 Date().toString() only includes GMT offset, not timezone string
1045 Use the info in tm_zone to append timezone abbreviation
1046 to Date().toString().
1048 * kjs/date_object.cpp:
1051 2006-07-24 Rob Buis <buis@kde.org>
1055 http://bugs.webkit.org/show_bug.cgi?id=5257
1056 setYear() does not match FireFox/IE behavior
1058 Make sure the right values end up in tm_year.
1060 * kjs/date_object.cpp:
1063 2006-07-23 Mark Rowe <opendarwin.org@bdash.net.nz>
1067 Bug 9686: [Drosera] Need the ability to break into Drosera on Javascript exceptions
1068 http://bugs.webkit.org/show_bug.cgi?id=9686
1070 JavaScriptCore portion of the fix.
1072 * JavaScriptCore.exp: Update symbol for change in argument type.
1074 (Debugger::detach): Clear map of recent exceptions.
1075 (Debugger::hasHandledException): Track the most recent exception
1076 thrown by an interpreter.
1077 (Debugger::exception): Change exception argument to a JSValue.
1080 (Node::debugExceptionIfNeeded): Notify the debugger of an exception
1081 if it hasn't seen it before.
1082 (ThrowNode::execute): Notify the debugger that an exception is being thrown.
1085 2006-07-23 Geoffrey Garen <ggaren@apple.com>
1087 Patch by Eric Albert, reviewed by Darin and me.
1089 - Fixed <rdar://problem/4645931> JavaScriptCore stack-scanning code
1090 crashes (Collector::markStackObjectsConservatively)
1092 * bindings/jni/jni_jsobject.cpp: On 64bit systems, jint is a long, not an
1094 (JavaJSObject::getSlot):
1095 (JavaJSObject::setSlot):
1096 * kjs/collector.cpp:
1097 (KJS::Collector::markCurrentThreadConservatively): Use a pointer instead of
1098 an int as 'dummy,' because on LP64 systems, an int is not pointer-aligned,
1099 and we want to scan the stack for pointers.
1100 * JavaScriptCore.xcodeproj/project.pbxproj: After a tense cease-fire, the
1101 XCode war has started up again!
1103 === Safari-521.20 ===
1105 2006-07-21 Geoffrey Garen <ggaren@apple.com>
1109 <rdar://problem/4507265> REGRESSION: overlays don't work on HousingMaps.com (Google Maps-based site)
1111 - Added support for strings that masquerade as undefined. Currently used
1112 by WebCore to implement undetectable style.filter.
1114 The name is a little long, but it's only used in one line of code, so I
1115 thought clarity should win over brevity.
1117 * JavaScriptCore.exp:
1118 * JavaScriptCore.xcodeproj/project.pbxproj:
1120 * kjs/string_object.h:
1121 (KJS::StringInstanceThatMasqueradesAsUndefined::StringInstanceThatMasqueradesAsUndefined):
1122 (KJS::StringInstanceThatMasqueradesAsUndefined::masqueradeAsUndefined):
1123 (KJS::StringInstanceThatMasqueradesAsUndefined::toBoolean):
1125 === Safari-521.19 ===
1127 2006-07-20 Steve Falkenburg <sfalken@apple.com>
1132 (KJS::escapeStringForPrettyPrinting):
1134 2006-07-19 Anders Carlsson <acarlsson@apple.com>
1138 <rdar://problem/4620655> REGRESSION(10.4.7-10.5): preview button for a blogger.com post doesn't work
1140 * kjs/nodes2string.cpp:
1141 (StringNode::streamTo):
1142 Return the escaped string.
1144 (RegExpNode::streamTo):
1145 Use the correct syntax.
1148 (KJS::escapeStringForPrettyPrinting):
1150 Add escape function which escapes a string for pretty-printing so it can be parsed again.
1152 * wtf/unicode/icu/UnicodeIcu.h:
1153 (WTF::Unicode::isPrintableChar):
1156 2006-07-18 Maciej Stachowiak <mjs@apple.com>
1158 Reviewed by Adele Peterson.
1160 <rdar://problem/4589530> REGRESSION: null character in JS string causes parse error (works in Tiger and in other browsers)
1166 (Lexer::scanRegExp):
1169 2006-07-18 Tim Omernick <timo@apple.com>
1171 Reviewed by Tim Hatcher.
1173 Removed a misleading comment; we recently added support for the NPNVPluginElementNPObject
1178 === Safari-521.18 ===
1180 2006-07-18 Timothy Hatcher <timothy@apple.com>
1182 Made the following headers public:
1191 * JavaScriptCore.xcodeproj/project.pbxproj:
1193 2006-07-17 Geoffrey Garen <ggaren@apple.com>
1197 - Added automatic prototype creation for classes.
1199 A class stores a weak reference to a prototype, which is cleared when
1200 the prototype is garbage collected, to avoid a reference cycle.
1202 We now have an attributes field in JSClassDefinition, that currently is
1203 used only to override automatic prototype creation when you want to manage your
1204 own prototypes, but can be extended in the future for other nefarious purposes.
1206 Similarly, we have JSObjectMake and JSObjectMakeWithPrototype, the latter
1207 allowing you to manage your own prototypes.
1209 JSObjectMakeConstructor is more interesting now, able to make a constructor
1210 on your behalf if you just give it a class.
1212 - Removed bogus old code from minidom.js.
1214 - Tweaked the headerdocs.
1216 - Added more GC testing, which caught some leaks, and tested more funny
1217 edge cases in lookup, which caught a lookup bug. Removed some testing
1218 we used to do with MyObject because it was redundant with the new, cool
1221 While fixing the lookup bug I retracted this change:
1223 "If a static setProperty callback returns 'false', to indicate that the
1224 property was not set, we no longer forward the set request up the class
1225 chain, because that's almost certainly not what the programmer expected."
1227 Returning false when setting a static property is a little silly, but you can see
1228 it being useful when shadowing a base class's static properties, and, regardless
1229 of usefullness, this is the defined behavior of the setProperty callback.
1231 - Plus a little ASCII art, for the kids.
1233 2006-07-17 Timothy Hatcher <timothy@apple.com>
1237 <rdar://problem/4634874> WebScriptObject and WebUndefined are no longer defined by WebKit
1239 Moves WebScriptObject and WebUndefined up to WebCore.
1240 This change does create an upwards-dependancy on WebScriptObject existing
1241 in the loaded process, but this code path in JavaScriptCore does not get used
1242 unless it is through WebKit/WebCore. Moving all of the binding code out of
1243 JavaScriptCore might make sense in the future.
1245 * JavaScriptCore.exp:
1246 * JavaScriptCore.xcodeproj/project.pbxproj:
1247 * bindings/objc/WebScriptObject.h: Replaced.
1248 * bindings/objc/WebScriptObject.mm: Removed.
1249 * bindings/objc/WebScriptObjectPrivate.h: Removed.
1250 * bindings/objc/objc_class.h:
1251 * bindings/objc/objc_instance.h:
1252 * bindings/objc/objc_instance.mm:
1253 (ObjcInstance::~ObjcInstance):
1254 * bindings/objc/objc_runtime.h:
1255 * bindings/objc/objc_runtime.mm:
1256 (convertValueToObjcObject):
1257 * bindings/objc/objc_utility.mm:
1258 (KJS::Bindings::convertValueToObjcValue):
1259 (KJS::Bindings::convertObjcValueToValue):
1260 (KJS::Bindings::createObjcInstanceForValue):
1262 2006-07-17 Darin Adler <darin@apple.com>
1264 * API/JSBase.h: Fix comment formatting where things used to be lined up but
1265 are now ragged. Got rid of spaces that attempted to line things up.
1266 * API/JSObjectRef.h: Ditto. Also add missing periods for a couple of comments.
1268 2006-07-17 Geoffrey Garen <ggaren@apple.com>
1272 - Removed the exception parameter from the initialize callback and, by extension,
1273 JSObjectMake. We have never had a need for exceptions when iniitializing,
1274 so the parameter seemed likely to "get in the way."
1276 Also, an exception in JavaScript is thrown in response to input --
1277 "invalid URL", "index not a number", etc., so it's the job of the
1278 constructor function, not the initialize method, to throw.
1280 If initialize *really* wants to throw, it can communicate the throw to
1281 the constructor through the constructed object's private data (e.g., set
1282 it to NULL, signaling to the consntructor that initialization failed.)
1284 - Added JSObjectMakeWithData, which enables a constructor to set private
1285 data on an object *before* it has been initialized. That way, the initialize
1286 methods can properly operate on the data.
1288 * API/JSNode.c: Moved ref into the initialize method, for better encapsulation,
1289 now that it's possible.
1290 * API/JSNodeList.c: ditto
1292 (main): Do more aggressive garbage collection to test ref/deref and
1293 initialize/finalize.
1294 * API/minidom.js: store childNodes in a temporary so it doesn't get re-created
1295 like a thousand times. This makes debugging ref/deref easier
1297 2006-07-17 Geoffrey Garen <ggaren@apple.com>
1301 - Changed the initialize callback to run from least derived class (parent
1302 class) to most derived class. This enables C++ style initialization,
1303 and derived class overriding of member data.
1305 - Added excpetion propopgation to JSObjectMake, to support initialize
1306 exceptions, and generally round out our policy of making function
1307 signatures as long as possible.
1309 * API/JSCallbackObject.h: Use ExecState instead of ContextRef, cuz we're
1312 2006-07-17 Geoffrey Garen <ggaren@apple.com>
1316 - Changed JSObjectMakeConstructor to JSObjectMakeConstructorWithCallback,
1317 to match JSObjectMakeFunctionWithCallback.
1319 - Added prototype parameter, so the generated constructor
1320 automatically works with hasInstance / instanceof
1322 - Moved hasInstance implementation from InternalFunctionImp to JSObject
1323 so that subclasses can inherit it without inheriting function-related baggage.
1324 More refactoring here would be good, but this seems like a good short-term
1327 (KJS::JSCallbackFunction::implementsHasInstance): override and return false,
1328 because callback functions aren't constructors.
1330 2006-07-17 Maciej Stachowiak <mjs@apple.com>
1334 - add a JSContextRef parameter to all JSValueRef, JSObjectRef, and JSContextRef operations;
1335 except JSObject{Get,Set}PrivateData which can be assumed to be simple pure accessors.
1337 Also renamed the parameter "context" to "ctx" because it makes the code read better with this pervasive
1338 but usually uninteresting parameter.
1342 (JSCheckScriptSyntax):
1345 * API/JSCallbackObject.cpp:
1346 (KJS::JSCallbackObject::JSCallbackObject):
1347 (KJS::JSCallbackObject::init):
1348 (KJS::JSCallbackObject::getOwnPropertySlot):
1349 (KJS::JSCallbackObject::put):
1350 (KJS::JSCallbackObject::deleteProperty):
1351 (KJS::JSCallbackObject::toNumber):
1352 (KJS::JSCallbackObject::toString):
1353 * API/JSContextRef.cpp:
1354 (JSGlobalContextCreate):
1355 (JSGlobalContextRetain):
1356 (JSGlobalContextRelease):
1357 (JSContextGetGlobalObject):
1358 * API/JSContextRef.h:
1360 (JSNodePrototype_appendChild):
1361 (JSNodePrototype_removeChild):
1362 (JSNodePrototype_replaceChild):
1363 (JSNode_getNodeType):
1364 (JSNode_getFirstChild):
1367 (JSNodeListPrototype_item):
1368 (JSNodeList_length):
1369 (JSNodeList_getProperty):
1370 (JSNodeList_prototype):
1371 * API/JSObjectRef.cpp:
1373 (JSObjectMakeFunctionWithCallback):
1374 (JSObjectMakeConstructor):
1375 (JSObjectMakeFunction):
1376 (JSObjectGetPrototype):
1377 (JSObjectSetPrototype):
1378 (JSObjectHasProperty):
1379 (JSObjectGetProperty):
1380 (JSObjectSetProperty):
1381 (JSObjectGetPropertyAtIndex):
1382 (JSObjectSetPropertyAtIndex):
1383 (JSObjectDeleteProperty):
1384 (JSObjectIsFunction):
1385 (JSObjectCallAsFunction):
1386 (JSObjectIsConstructor):
1387 (JSObjectCallAsConstructor):
1388 (JSObjectCopyPropertyNames):
1389 * API/JSObjectRef.h:
1390 * API/JSStringRef.cpp:
1391 * API/JSValueRef.cpp:
1393 (JSValueIsUndefined):
1399 (JSValueIsObjectOfClass):
1401 (JSValueIsStrictEqual):
1402 (JSValueIsInstanceOfConstructor):
1403 (JSValueMakeUndefined):
1405 (JSValueMakeBoolean):
1406 (JSValueMakeNumber):
1407 (JSValueMakeString):
1410 (JSValueToStringCopy):
1418 (MyObject_getProperty):
1419 (MyObject_deleteProperty):
1420 (MyObject_callAsFunction):
1421 (MyObject_callAsConstructor):
1422 (MyObject_convertToType):
1423 (print_callAsFunction):
1426 2006-07-16 Geoffrey Garen <ggaren@apple.com>
1428 Approved by Maciej, RS by Beth.
1430 JSObjectMakeFunction -> JSObjectMakeFunctionWithCallback
1431 JSObjectMakeFunctionWithBody -> JSObjectMakeFunction
1433 because the latter is more common, and more fundamental, than the former.
1438 * API/JSCallbackObject.cpp:
1439 (KJS::JSCallbackObject::getOwnPropertySlot):
1440 (KJS::JSCallbackObject::put):
1441 (KJS::JSCallbackObject::deleteProperty):
1442 (KJS::JSCallbackObject::getPropertyNames):
1443 (KJS::JSCallbackObject::staticValueGetter):
1444 (KJS::JSCallbackObject::staticFunctionGetter):
1445 * API/JSClassRef.cpp:
1446 (OpaqueJSClass::OpaqueJSClass):
1447 (OpaqueJSClass::~OpaqueJSClass):
1449 * API/JSObjectRef.cpp:
1451 (JSObjectMakeFunctionWithCallback):
1452 (JSObjectMakeFunction):
1453 (OpaqueJSPropertyNameArray::OpaqueJSPropertyNameArray):
1454 (JSObjectCopyPropertyNames):
1455 * API/JSObjectRef.h:
1461 * JavaScriptCore.exp:
1463 2006-07-16 Geoffrey Garen <ggaren@apple.com>
1467 Replace __JS with OpaqueJS because the former, while used by CF, is
1468 a prefix that's triply-reserved by the compiler. (_* is reserved in global
1469 names, _[A-Z] is reserved in all names, and __ is reserved in all names
1472 Opaque is an alternative used by other Mac OS X framewokrs.
1477 * API/JSCallbackObject.cpp:
1478 (KJS::JSCallbackObject::getOwnPropertySlot):
1479 (KJS::JSCallbackObject::put):
1480 (KJS::JSCallbackObject::deleteProperty):
1481 (KJS::JSCallbackObject::getPropertyNames):
1482 (KJS::JSCallbackObject::staticValueGetter):
1483 (KJS::JSCallbackObject::staticFunctionGetter):
1484 * API/JSClassRef.cpp:
1485 (OpaqueJSClass::OpaqueJSClass):
1486 (OpaqueJSClass::~OpaqueJSClass):
1488 * API/JSObjectRef.cpp:
1490 (OpaqueJSPropertyNameArray::OpaqueJSPropertyNameArray):
1491 (JSObjectCopyPropertyNames):
1493 2006-07-16 Darin Adler <darin@apple.com>
1495 - try to fix Windows build
1497 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1498 Added some recently added files, removed some recently removed.
1500 2006-07-16 Geoffrey Garen <ggaren@apple.com>
1504 - Change getProperty* to return undefined, rather than NULL, for missing
1505 properties, since that's what the spec says. Also added exception out
1506 parameters to the *Index functions, because they can call through to the
1507 regular functions, which can throw for custom objects.
1509 * API/JSObjectRef.cpp:
1510 (JSObjectGetProperty):
1511 (JSObjectGetPropertyAtIndex):
1512 (JSObjectSetPropertyAtIndex):
1513 * API/JSObjectRef.h:
1517 2006-07-16 Geoffrey Garen <ggaren@apple.com>
1521 - Properly document and handle NULL callbacks for static properties. We
1522 throw an exception in any case other than a ReadOnly property with a NULL
1523 setProperty callback, because a NULL callback almost certainly indicates
1524 a programming error. Also throw an exception if hasProperty returns true
1525 for a property that getProperty can't get.
1527 - If a static setProperty callback returns 'false', to indicate that the
1528 property was not set, we no longer forward the set request up the class
1529 chain, because that's almost certainly not what the programmer expected.
1531 * API/JSCallbackObject.cpp:
1532 (KJS::JSCallbackObject::getOwnPropertySlot):
1533 (KJS::JSCallbackObject::put):
1534 (KJS::JSCallbackObject::staticValueGetter):
1535 (KJS::JSCallbackObject::staticFunctionGetter):
1536 (KJS::JSCallbackObject::callbackGetter):
1537 * API/JSObjectRef.h:
1540 (MyObject_hasProperty):
1543 2006-07-16 Geoffrey Garen <ggaren@apple.com>
1547 - Added names to functions.
1549 - Removed GetPrivate/SetPrivate from callbackFunctions and callbackConstructors.
1550 The private data idiom is that a JS object stores its native implementation
1551 as private data. For functions and constructors, the native implementation is nothing
1552 more than the callback they already store, so supporting private data, too,
1553 confuses the idiom. If you *really* want, you can still create a custom
1554 function with private data.
1556 * API/JSCallbackConstructor.cpp:
1557 * API/JSCallbackConstructor.h:
1558 * API/JSCallbackFunction.cpp:
1559 (KJS::JSCallbackFunction::JSCallbackFunction):
1560 * API/JSCallbackFunction.h:
1561 * API/JSCallbackObject.cpp:
1562 (KJS::JSCallbackObject::staticFunctionGetter):
1563 * API/JSObjectRef.cpp:
1564 (JSObjectMakeFunction):
1565 (JSObjectMakeFunctionWithBody):
1566 (JSObjectGetPrivate):
1567 (JSObjectSetPrivate):
1568 * API/JSObjectRef.h:
1574 2006-07-15 Maciej Stachowiak <mjs@apple.com>
1578 - switch property lists to be vector+set of Identifiers instead of list of References
1580 This has the following benefits:
1582 - no duplicates in property lists
1583 - simplifies API calls
1584 - probably more efficient, since linked list is gone
1585 - entirely removed Reference, ReferenceList and ProtectedReference types from the API
1587 * kjs/PropertyNameArray.cpp: Added.
1588 (KJS::PropertyNameArray::add): Check set, if not already there, add to
1590 * kjs/PropertyNameArray.h: Added.
1591 (KJS::PropertyNameArray::PropertyNameArray): Newly added type, combines
1592 a set and a vector to make a unique but ordered list of identifiers.
1593 (KJS::PropertyNameArray::begin): ditto
1594 (KJS::PropertyNameArray::end): ditto
1595 (KJS::PropertyNameArray::size): ditto
1596 (KJS::PropertyNameArray::operator[]): ditto
1597 * kjs/array_instance.h:
1598 * kjs/array_object.cpp:
1599 (ArrayInstance::getPropertyNames): renamed from getPropertyList, updated
1600 for PropertyNameArray
1601 (ArrayInstance::setLength): updated for PropertyNameArray
1602 (ArrayInstance::pushUndefinedObjectsToEnd): ditto
1604 (ForInNode::execute): updated for PropertyNameArray
1607 (KJS::JSObject::getPropertyNames): renamed from getPropertyList, updated
1608 for PropertyNameArray
1610 * kjs/property_map.cpp:
1611 (KJS::PropertyMap::getEnumerablePropertyNames): updated for PropertyNameArray
1612 (KJS::PropertyMap::getSparseArrayPropertyNames): ditto
1613 * kjs/property_map.h:
1614 * kjs/protected_reference.h: Removed.
1615 * kjs/reference.cpp: Removed.
1616 * kjs/reference.h: Removed.
1617 * kjs/reference_list.cpp: Removed.
1618 * kjs/reference_list.h: Removed.
1619 * kjs/scope_chain.cpp:
1620 (KJS::ScopeChain::print): Use PropertyNamesArray instead of ReferenceList.
1621 * kjs/string_object.cpp:
1622 (StringInstance::getPropertyNames): Updated for new approach.
1623 * kjs/string_object.h:
1626 (toJS): Added overload for PropertyNameAccumulatorRef / PropertyNameArray*
1629 * API/JSCallbackObject.cpp:
1630 (KJS::JSCallbackObject::getPropertyNames): Fixed for new API.
1631 * API/JSCallbackObject.h:
1632 * API/JSObjectRef.cpp:
1633 (__JSPropertyNameArray::__JSPropertyNameArray): Type used for a publicly vended
1634 JSPropertyNameArrayRef.
1635 (JSObjectCopyPropertyNames): New API call - renamed / refactored from
1636 JSObjectCreatePropertyList
1637 (JSPropertyNameArrayRetain): new retain call for JSPropertyNameArray.
1638 (JSPropertyNameArrayRelease): new release call for - " -.
1639 (JSPropertyNameArrayGetCount): Instead of having to use a stateful enumerator you
1640 can now get the count and items in any order.
1641 (JSPropertyNameArrayGetNameAtIndex): See above.
1642 (JSPropertyNameAccumulatorAddName): What you add properties to is now an opaque
1644 * API/JSObjectRef.h: Prototyped new functions, removed old ones
1645 * JavaScriptCore.exp: Updated exported symbols.
1646 * JavaScriptCore.xcodeproj/project.pbxproj: Added new files, removed old.
1648 (MyObject_getPropertyNames): Renamed / fixed callback to fit new paradigm.
1649 (main): Updated for new API.
1651 2006-07-15 Darin Adler <darin@apple.com>
1653 - oops, missed a few more arrays that had to be const
1656 (JSNodePrototype_appendChild): Added const.
1657 (JSNodePrototype_removeChild): Ditto.
1658 (JSNodePrototype_replaceChild): Ditto.
1659 (JSNode_construct): Ditto.
1661 (JSNodeListPrototype_item): Ditto.
1662 * API/JSObjectRef.cpp:
1663 (JSObjectMakeFunctionWithBody): Ditto.
1664 (JSObjectCallAsFunction): Ditto.
1665 (JSObjectCallAsConstructor): Ditto.
1669 (MyObject_callAsFunction): Ditto.
1670 (MyObject_callAsConstructor): Ditto.
1671 (print_callAsFunction): Ditto.
1672 (myConstructor_callAsConstructor): Ditto.
1674 2006-07-15 Darin Adler <darin@apple.com>
1678 * API/JSNode.h: Made an array parameter const.
1679 * API/JSObjectRef.h: Made array parameters const. Fixed a comment.
1681 2006-07-15 Geoffrey Garen <ggaren@apple.com>
1685 - JSObjectMakeFunctionWithBody includes a function name and named parameters now.
1687 * API/JSObjectRef.cpp:
1688 (JSObjectMakeFunctionWithBody):
1689 * API/JSObjectRef.h:
1691 (assertEqualsAsUTF8String): More informative failure reporting.
1692 (main): Test more function cases.
1694 2006-07-15 Geoffrey Garen <ggaren@apple.com>
1698 - Moved the arguments passed to JSClassCreate into a single structure,
1699 called JSClassDefinition. This will enable easier structure
1700 migration/versioning in the future, if necessary.
1702 - Added support for class names.
1704 - kJSClassDefinitionNull replaces kJSObjectCallbacksNone.
1706 - JSClass is becoming a fairly complex struct, so I migrated all of its
1707 implementation other than reference counting to the sruct.
1709 - Also moved JSClass* functions in the API to JSObjectRef.cpp, since they're
1710 declared in JSObjectRef.h
1712 - Also added some more informative explanation to the class structure doc.
1714 2006-07-15 Darin Adler <darin@apple.com>
1718 - fix http://bugs.webkit.org/show_bug.cgi?id=8395
1719 <rdar://problem/4613467>
1720 REGRESSION: RegEx seems broken for hex escaped non breaking space
1722 Test: fast/js/regexp-extended-characters-more.html
1725 (match): Got rid of utf16Length local variable to guarantee there's no
1726 extra stack usage in recursive calls. Fixed two places in the PCRE_UTF16
1727 code that were using the length variable, which is the UTF-8 length of
1728 a character in the pattern, to move in the UTF-16 subject string. Instead
1729 they hardcode lengths of 1 and 2 since the code already handles BMP
1730 characters and surrogate pairs separately. Also fixed some DPRINTF so
1731 I could compile with DEBUG on.
1732 (pcre_exec): Changed a place that was checking for multibyte characters
1733 in the subject string to use ISMIDCHAR. Instead it was using hardcoded
1734 logic that was right for UTF-8 but wrong for UTF-16.
1736 * pcre/pcre_compile.c: (pcre_compile2): Fixed a DPRINTF so I could compile
1739 2006-07-14 Geoffrey Garen <ggaren@apple.com>
1743 Global replace in the API of argc/argv with argumentCount/arguments.
1745 2006-07-14 Geoffrey Garen <ggaren@apple.com>
1749 - Finalized exception handling in the API.
1751 setProperty can throw because it throws for built-in arrays. getProperty
1752 and deleteProperty can throw because setProperty can throw and we want
1753 to be consistent, and also because they seem like "actions." callAsFunction,
1754 callAsConstructor, and hasInstance can throw, because they caan throw for
1757 toBoolean can't throw because it's defined that way in the spec.
1759 - Documented that toBoolean and toObject can't be overridden by custom
1760 objects because they're defined that way in the spec.
1762 === Safari-521.17 ===
1764 2006-07-14 Geoffrey Garen <ggaren@apple.com>
1768 - Implemented ref-counting of JSContexts by splitting into two datatypes:
1769 JSGlobalContext, which you can create/retain/release, and JSContext, which
1772 Internally, you retain a JSGlobalContext/ExecState by retaining its
1773 interpreter, which, in the case of a global ExecState, owns it.
1775 - Also made ~Interpreter() protected to catch places where Interpreter
1776 is manually deleted. (Can't make it private because some crazy fool
1777 decided it would be a good idea to subclass Interpreter in other frameworks.
1781 (toJS): Added cast for new JSGlobalContext
1782 * API/JSStringRef.h: Changed vague "you must" language to more specific
1783 (but, ultimately, equally vague) "behavior is undefined if you don't"
1785 (KJS::Interpreter::Interpreter): Factored more common initialization into
1787 * kjs/interpreter.h:
1788 (KJS::Interpreter::ref): new
1789 (KJS::Interpreter::deref): new
1790 (KJS::Interpreter::refCount): new
1792 (doIt): Ref-count the interpreter.
1794 2006-07-14 Maciej Stachowiak <mjs@apple.com>
1798 - removed bool return value from JSObjectSetProperty, since it is inefficient and
1799 also doesn't work quite right
1800 - added JSObjectGetPropertyAtIndex and JSObjectSetPropertyAtIndex
1802 * API/JSObjectRef.cpp:
1803 (JSObjectSetProperty): Removed return value and canPut stuff.
1804 (JSObjectGetPropertyAtIndex): Added.
1805 (JSObjectSetPropertyAtIndex): Added.
1806 * API/JSObjectRef.h: Prototyped and documented new functions.
1808 2006-07-14 Geoffrey Garen <ggaren@apple.com>
1812 Moved JSCheckScriptSyntax, JSEvaluateScript, and JSGarbageCollect into
1813 JSBase.h/.cpp. They don't belong in the value-specific or context-specific
1814 files because they're not part of the value or context implementations.
1817 * API/JSContextRef.cpp:
1818 (JSContextGetGlobalObject):
1819 * API/JSContextRef.h:
1820 * API/JSValueRef.cpp:
1823 * JavaScriptCore.xcodeproj/project.pbxproj:
1825 2006-07-13 Timothy Hatcher <timothy@apple.com>
1829 Moved JavaScriptCore to be a public framework.
1831 * JavaScriptCore.xcodeproj/project.pbxproj:
1833 2006-07-13 Mark Rowe <opendarwin.org@bdash.net.nz>
1835 Reviewed by Geoffrey.
1837 http://bugs.webkit.org/show_bug.cgi?id=9742
1838 Bug 9742: REGRESSION: WebKit hangs when loading <http://www.vtbook.com>
1841 (KJS::JSValue::getUInt32): Only types tagged as numeric can be converted to UInt32.
1843 2006-07-13 Geoffrey Garen <ggaren@apple.com>
1847 - Renamed JSEvaluate -> JSEvaluateScript, JSCheckSyntax -> JSCheckScriptSyntax
1848 - Added exception out parameters to JSValueTo* and JSValueIsEqual because
1850 - Removed JSObjectGetDescription because it's useless and vague, and
1851 JSValueToString/JSValueIsObjectOfClass do a better job, anyway
1852 - Clarified comments about "IsFunction/Constructor" to indicate that they
1853 are true of all functions/constructors, not just those created by JSObjectMake*
1855 2006-07-12 Geoffrey Garen <ggaren@apple.com>
1859 Finished previously approved JSInternalString -> JSString conversion
1860 by renaming the files.
1862 * API/JSCallbackObject.cpp:
1863 * API/JSInternalStringRef.cpp: Removed.
1864 * API/JSInternalStringRef.h: Removed.
1865 * API/JSStringRef.cpp: Added.
1866 * API/JSStringRef.h: Added.
1867 * API/JavaScriptCore.h:
1868 * JavaScriptCore.xcodeproj/project.pbxproj:
1870 2006-07-12 Geoffrey Garen <ggaren@apple.com>
1874 - Removed context and exception parameters from JSObjectGetPropertyEnumerator,
1875 removing the spurious use of ExecState inside JavaScriptCore that made
1876 us think this was necessary in the first place.
1878 (StringInstance::getPropertyList): Use getString instead of toString because
1879 we know we're dealing with a string -- we put it there in the first place.
1880 While we're at it, store the string's size instead of retrieving it each time
1881 through the loop, to avoid the unnecessary killing of puppies.
1882 * kjs/string_object.h:
1884 2006-07-12 Maciej Stachowiak <mjs@apple.com>
1888 - add handling of hasInstance callback for API objects
1890 * API/JSCallbackObject.cpp:
1891 (KJS::JSCallbackObject::implementsHasInstance): Check if callback is present.
1892 (KJS::JSCallbackObject::hasInstance): Invoke appropriate callback.
1893 * API/JSCallbackObject.h:
1894 * API/JSClassRef.cpp:
1895 * API/JSObjectRef.h:
1897 (MyObject_hasInstance): Test case; should match what construct would do.
1900 2006-07-11 Geoffrey Garen <ggaren@apple.com>
1904 - Implemented a vast number of renames and comment clarifications
1905 suggested during API review.
1907 JSInternalString -> JSString
1908 JS*Make -> JSValueMake*, JSObjectMake*
1909 JSTypeCode -> JSType
1910 JSValueIsInstanceOf -> JSValueIsInstanceOfConstructor (reads strangely well in client code)
1911 JSGC*Protect -> JSValue*Protect
1912 JS*Callback -> JSObject*Callback
1913 JSGetPropertyListCallback -> JSObjectAddPropertiesToListCallback
1914 JSPropertyEnumeratorGetNext -> JSPropertyEnumeratorGetNextName
1916 JSStringCreateWithUTF8CString, JSStringGetUTF8CString,
1917 JSStringGetMaximumUTF8CStringSize JSStringIsEqualToUTF8CString,
1918 JSStringCreateWithCFString, JSStringCopyCFString, JSStringCreateWithCharacters.
1920 - Changed functions taking a JSValue out arg and returning a bool indicating
1921 whether it was set to simply return a JSValue or NULL.
1923 - Removed JSStringGetCharacters because it's more documentation than code,
1924 and it's just a glorified memcpy built on existing API functionality.
1926 - Moved standard library includes into the headers that actually require them.
1928 - Standardized use of the phrase "Create Rule."
1930 - Removed JSLock from make functions that don't allocate.
1932 - Added exception handling to JSValueToBoolean, since we now allow
1933 callback objects to throw exceptions upon converting to boolean.
1935 - Renamed JSGCCollect to JSGarbageCollect.
1937 2006-07-10 Geoffrey Garen <ggaren@apple.com>
1941 - Changed public header includes to the <JavaScriptCore/ style.
1942 - Changed instances of 'buffer' to 'string' since we decided on
1943 JSInternalString instead of JSStringBuffer.
1945 * API/JSContextRef.h:
1946 * API/JSInternalStringRef.cpp:
1948 (JSInternalStringRetain):
1949 (JSInternalStringRelease):
1950 (JSValueCopyStringValue):
1951 (JSInternalStringGetLength):
1952 (JSInternalStringGetCharactersPtr):
1953 (JSInternalStringGetCharacters):
1954 (JSInternalStringGetMaxLengthUTF8):
1955 (JSInternalStringGetCharactersUTF8):
1956 (CFStringCreateWithJSInternalString):
1957 * API/JSInternalStringRef.h:
1959 (JSNodePrototype_appendChild):
1960 (JSNode_getNodeType):
1961 * API/JSObjectRef.cpp:
1962 (JSObjectCallAsConstructor):
1964 * API/JavaScriptCore.h:
1969 (MyObject_getPropertyList):
1970 (myConstructor_callAsConstructor):
1971 (main): I noticed that we were prematurely releasing some string buffers,
1972 so I moved their release calls to the end of main(). I got rid of 'Buf' in *Buf
1973 (sometimes changing to 'IString', when necessary to differentiate a variable)
1974 to match the buffer->string change.
1976 === Safari-521.16 ===
1978 2006-07-10 Darin Adler <darin@apple.com>
1980 * kjs/value.cpp: (KJS::JSValue::toInt32Inline): Added inline keyword one more place.
1983 2006-07-10 Darin Adler <darin@apple.com>
1985 - fix the release build
1989 (KJS::JSValue::toInt32Inline): Move the code here to an inline.
1990 (KJS::JSValue::toInt32): Call the inline from both overloaded toInt32 functions.
1992 2006-07-10 David Kilzer <ddkilzer@kilzer.net>
1996 - fix http://bugs.webkit.org/show_bug.cgi?id=9179
1997 Implement select.options.add() method
1999 * JavaScriptCore.exp: Added overloaded KJS::JSValue::toInt32() method.
2000 * JavaScriptCore.xcodeproj/project.pbxproj: Altered attributes metadata for
2001 kjs/value.h to make it available as a forwarded header.
2003 (KJS::lookupPut): Extracted a lookupPut() method from the existing lookupPut() method.
2004 The new method returns a boolean value if no entry is found in the lookup table.
2006 (KJS::JSValue::toInt32): Overloaded toInt32() method with boolean "Ok" argument.
2007 * kjs/value.h: Ditto.
2009 2006-07-10 Geoffrey Garen <ggaren@apple.com>
2011 No review necessary. Removed bogus file I accidentally checked in before.
2013 * API/JSInternalSringRef.h: Removed.
2015 2006-07-10 Geoffrey Garen <ggaren@apple.com>
2019 Added exception out parameter to API object callbacks, removed semi-bogus
2020 JSContext(.*)Exception functions.
2022 To make these calls syntactically simple, I added an exceptionSlot()
2023 method to the ExecState class, which provides a JSValue** slot in which to
2024 store a JSValue* exception.
2028 * API/JSCallbackConstructor.cpp:
2029 (KJS::JSCallbackConstructor::construct):
2030 * API/JSCallbackFunction.cpp:
2031 (KJS::JSCallbackFunction::callAsFunction):
2032 * API/JSCallbackObject.cpp:
2033 (KJS::JSCallbackObject::init):
2034 (KJS::JSCallbackObject::getOwnPropertySlot):
2035 (KJS::JSCallbackObject::put):
2036 (KJS::JSCallbackObject::deleteProperty):
2037 (KJS::JSCallbackObject::construct):
2038 (KJS::JSCallbackObject::callAsFunction):
2039 (KJS::JSCallbackObject::getPropertyList):
2040 (KJS::JSCallbackObject::toBoolean):
2041 (KJS::JSCallbackObject::toNumber):
2042 (KJS::JSCallbackObject::toString):
2043 (KJS::JSCallbackObject::staticValueGetter):
2044 (KJS::JSCallbackObject::callbackGetter):
2045 * API/JSContextRef.cpp:
2047 * API/JSContextRef.h:
2049 (JSNodePrototype_appendChild):
2050 (JSNodePrototype_removeChild):
2051 (JSNodePrototype_replaceChild):
2052 (JSNode_getNodeType):
2053 (JSNode_getChildNodes):
2054 (JSNode_getFirstChild):
2058 (JSNodeListPrototype_item):
2059 (JSNodeList_length):
2060 (JSNodeList_getProperty):
2061 * API/JSObjectRef.h:
2065 (MyObject_initialize):
2066 (MyObject_hasProperty):
2067 (MyObject_getProperty):
2068 (MyObject_setProperty):
2069 (MyObject_deleteProperty):
2070 (MyObject_getPropertyList):
2071 (MyObject_callAsFunction):
2072 (MyObject_callAsConstructor):
2073 (MyObject_convertToType):
2074 (print_callAsFunction):
2075 (myConstructor_callAsConstructor):
2077 * JavaScriptCore.exp:
2079 (KJS::ExecState::exceptionHandle):
2081 2006-07-10 Geoffrey Garen <ggaren@apple.com>
2085 Improved type safety by implementing opaque JSValue/JSObject typing through
2086 abuse of 'const', not void*. Also fixed an alarming number of bugs
2087 exposed by this new type safety.
2089 I made one design change in JavaScriptCore, which is that the JSObject
2090 constructor should take a JSValue* as its prototype argument, not a JSObject*,
2091 since we allow the prototype to be any JSValue*, including jsNull(), for
2097 * API/JSCallbackConstructor.cpp:
2098 (KJS::JSCallbackConstructor::construct):
2099 * API/JSCallbackFunction.cpp:
2100 (KJS::JSCallbackFunction::callAsFunction):
2101 * API/JSCallbackObject.cpp:
2102 (KJS::JSCallbackObject::JSCallbackObject):
2103 (KJS::JSCallbackObject::getOwnPropertySlot):
2104 (KJS::JSCallbackObject::put):
2105 (KJS::JSCallbackObject::construct):
2106 (KJS::JSCallbackObject::callAsFunction):
2107 (KJS::JSCallbackObject::staticFunctionGetter):
2108 * API/JSCallbackObject.h:
2109 * API/JSContextRef.cpp:
2112 (JSNodePrototype_appendChild):
2113 (JSNodePrototype_removeChild):
2114 (JSNodePrototype_replaceChild):
2115 * API/JSObjectRef.cpp:
2117 (JSFunctionMakeWithBody):
2118 (JSObjectGetProperty):
2119 (JSObjectCallAsFunction):
2120 (JSObjectCallAsConstructor):
2121 * API/JSObjectRef.h:
2126 (KJS::JSObject::JSObject):
2128 2006-07-10 Geoffrey Garen <ggaren@apple.com>
2130 Approved by Maciej, Darin.
2132 Renamed JSStringBufferRef to JSInternalStringRef. "Internal string" means the
2133 JavaScript engine's internal string representation, which is the most
2134 low-level and efficient representation to use when interfacing with JavaScript.
2140 * API/JSCallbackObject.cpp:
2141 (KJS::JSCallbackObject::getOwnPropertySlot):
2142 (KJS::JSCallbackObject::put):
2143 (KJS::JSCallbackObject::deleteProperty):
2144 (KJS::JSCallbackObject::staticValueGetter):
2145 (KJS::JSCallbackObject::callbackGetter):
2146 * API/JSContextRef.cpp:
2149 * API/JSContextRef.h:
2150 * API/JSInternalStringRef.cpp: Added.
2152 (JSInternalStringCreate):
2153 (JSInternalStringCreateUTF8):
2154 (JSInternalStringRetain):
2155 (JSInternalStringRelease):
2156 (JSValueCopyStringValue):
2157 (JSInternalStringGetLength):
2158 (JSInternalStringGetCharactersPtr):
2159 (JSInternalStringGetCharacters):
2160 (JSInternalStringGetMaxLengthUTF8):
2161 (JSInternalStringGetCharactersUTF8):
2162 (JSInternalStringIsEqual):
2163 (JSInternalStringIsEqualUTF8):
2164 (JSInternalStringCreateCF):
2165 (CFStringCreateWithJSInternalString):
2166 * API/JSInternalStringRef.h: Added.
2168 (JSNodePrototype_appendChild):
2169 (JSNode_getNodeType):
2170 (JSNode_getChildNodes):
2171 (JSNode_getFirstChild):
2173 (JSNodeList_length):
2174 (JSNodeList_getProperty):
2175 * API/JSObjectRef.cpp:
2176 (JSFunctionMakeWithBody):
2177 (JSObjectGetDescription):
2178 (JSObjectHasProperty):
2179 (JSObjectGetProperty):
2180 (JSObjectSetProperty):
2181 (JSObjectDeleteProperty):
2182 (JSPropertyEnumeratorGetNext):
2183 (JSPropertyListAdd):
2184 * API/JSObjectRef.h:
2185 * API/JSStringBufferRef.cpp: Removed.
2186 * API/JSStringBufferRef.h: Removed.
2188 * API/JavaScriptCore.h:
2193 (assertEqualsAsUTF8String):
2194 (assertEqualsAsCharactersPtr):
2195 (assertEqualsAsCharacters):
2196 (MyObject_hasProperty):
2197 (MyObject_getProperty):
2198 (MyObject_setProperty):
2199 (MyObject_deleteProperty):
2200 (MyObject_getPropertyList):
2201 (print_callAsFunction):
2202 (myConstructor_callAsConstructor):
2204 * JavaScriptCore.exp:
2205 * JavaScriptCore.xcodeproj/project.pbxproj:
2207 2006-07-08 Tim Omernick <timo@apple.com>
2211 Added an OpenGL drawing model to the Netscape Plug-in API.
2215 2006-07-08 Timothy Hatcher <timothy@apple.com>
2219 Moved KJS_GetCreatedJavaVMs to jni_utility.cpp.
2220 Switched KJS_GetCreatedJavaVMs over to use dlopen and dlsym
2221 now that NSAddImage, NSLookupSymbolInImage and NSAddressOfSymbol
2222 are deprecated in Leopard.
2224 * JavaScriptCore.exp:
2225 * JavaScriptCore.xcodeproj/project.pbxproj:
2226 * bindings/jni/jni_utility.cpp:
2227 (KJS::Bindings::KJS_GetCreatedJavaVMs):
2228 * bindings/softlinking.c: Removed.
2229 * bindings/softlinking.h: Removed.
2231 2006-07-08 Geoffrey Garen <ggaren@apple.com>
2235 - Make JSObjectGetProperty return a JSValue or NULL, like JSEvaluate does.
2237 * API/JSObjectRef.cpp:
2238 (JSObjectGetProperty):
2239 * API/JSObjectRef.h:
2243 2006-07-08 Geoffrey Garen <ggaren@apple.com>
2245 Style change -- no review necessary.
2247 Use 0 instead of NULL in API .cpp files, to match our style guidelines.
2249 * API/JSContextRef.cpp:
2251 * API/JSObjectRef.cpp:
2252 (JSFunctionMakeWithBody):
2253 (JSObjectCallAsFunction):
2254 (JSObjectCallAsConstructor):
2255 * API/JSValueRef.cpp:
2258 2006-07-08 Geoffrey Garen <ggaren@apple.com>
2262 - Added ability to pass NULL for thisObject when calling JSObjectCallAsFunction,
2263 to match JSEvaluate.
2265 * API/JSObjectRef.cpp:
2266 (JSObjectCallAsFunction):
2267 * API/JSObjectRef.h:
2271 === Safari-521.15 ===
2273 2006-07-07 Geoffrey Garen <ggaren@apple.com>
2277 - Standardized which functions take a JSContext as an argument. The rule is:
2278 if you might execute JavaScript, you take a JSContext, otherwise you don't.
2280 The FIXME in JSObjectRef.h requires refactoring some parts of Interpreter,
2281 but not API changes, so I'm putting it off until later.
2283 * API/JSCallbackObject.cpp:
2284 (KJS::JSCallbackObject::JSCallbackObject):
2285 (KJS::JSCallbackObject::init):
2286 * API/JSCallbackObject.h:
2287 * API/JSContextRef.cpp:
2289 * API/JSContextRef.h:
2290 * API/JSObjectRef.cpp:
2292 (JSPropertyEnumeratorGetNext):
2293 * API/JSObjectRef.h:
2295 (MyObject_initialize):
2297 * JavaScriptCore.exp:
2298 * kjs/array_object.cpp:
2299 (ArrayInstance::setLength):
2300 (ArrayInstance::pushUndefinedObjectsToEnd):
2302 (ForInNode::execute):
2303 * kjs/reference.cpp:
2304 (KJS::Reference::getPropertyName):
2305 (KJS::Reference::getValue):
2307 * kjs/scope_chain.cpp:
2308 (KJS::ScopeChain::print):
2310 2006-07-06 Geoffrey Garen <ggaren@apple.com>
2316 - Headerdoc finished
2319 - Added a JSContextRef argument to many functions, because you need a
2320 JSContextRef for doing virtually anything. I expect to add this argument
2321 to even more functions in a future patch.
2323 - Removed the globalObjectPrototype argument to JSContextCreate because
2324 you can't create an object until you have a context, so it's impossible
2325 to pass a prototype object to JSContextCreate. That's OK because (1) there's
2326 no reason to give the global object a prototype and (2) if you really want
2327 to, you can just use a separate call to JSObjectSetPrototype.
2329 - Removed the JSClassRef argument to JSClassCreate because it was unnecessary,
2330 and you need to be able to make the global object's class before you've
2331 created a JSContext.
2333 - Added an optional exception parameter to JSFunctionMakeWithBody because anything
2334 less would be uncivilized.
2336 - Made the return value parameter to JSObjectGetProperty optional to match
2337 all other return value parameters in the API.
2339 - Made JSObjectSetPrivate/JSObjectGetPrivate work on JSCallbackFunctions
2340 and JSCallbackConstructors. You could use an abstract base class or strategic
2341 placement of m_privateData in the class structure to implement this, but
2342 the former seemed like overkill, and the latter seemed too dangerous.
2344 - Fixed a bug where JSPropertyEnumeratorGetNext would skip the first property.
2347 - Reversed the logic of the JSChar #ifdef to avoid confusing headerdoc
2349 - Removed function names from @function declarations because headeroc
2350 can parse them automatically, and I wanted to rule out manual mismatch.
2352 - Changed Error::create to take a const UString& instead of a UString*
2353 because it was looking at me funny.
2355 - Renamed JSStringBufferCreateWithCFString to JSStringBufferCreateCF
2356 because the latter is more concise and it matches JSStringBufferCreateUTF8.
2358 * API/JSCallbackObject.cpp:
2359 (KJS::JSCallbackObject::getOwnPropertySlot):
2360 (KJS::JSCallbackObject::put):
2361 (KJS::JSCallbackObject::deleteProperty):
2362 (KJS::JSCallbackObject::getPropertyList):
2363 (KJS::JSCallbackObject::toBoolean):
2364 (KJS::JSCallbackObject::toNumber):
2365 (KJS::JSCallbackObject::toString):
2366 * API/JSClassRef.cpp:
2368 * API/JSContextRef.cpp:
2370 (JSContextSetException):
2371 * API/JSContextRef.h:
2373 (JSNodePrototype_class):
2376 (JSNodeListPrototype_class):
2378 * API/JSObjectRef.cpp:
2379 (JSObjectGetProperty):
2380 (JSObjectGetPrivate):
2381 (JSObjectSetPrivate):
2382 (JSObjectCallAsFunction):
2383 (JSObjectCallAsConstructor):
2384 (JSPropertyEnumeratorGetNext):
2385 * API/JSObjectRef.h:
2386 * API/JSStringBufferRef.cpp:
2387 (JSStringBufferCreateCF):
2388 * API/JSStringBufferRef.h:
2389 * API/JSValueRef.cpp:
2390 (JSValueIsInstanceOf):
2396 (MyObject_hasProperty):
2397 (MyObject_setProperty):
2398 (MyObject_deleteProperty):
2399 (MyObject_getPropertyList):
2400 (MyObject_convertToType):
2403 * JavaScriptCore.exp:
2405 2006-07-07 Geoffrey Garen <ggaren@apple.com>
2409 - Fixed a few crashes resulting from NULL parameters to JSClassCreate.
2411 * API/JSClassRef.cpp:
2414 * API/testapi.c: Added test for NULL parameters.
2417 2006-07-07 Geoffrey Garen <ggaren@apple.com>
2419 Reviewed by John, mocked by Darin.
2421 - Changed JSEvaluate to take a JSObjectRef instead of a JSValueRef as
2422 "this," since "this" must be an object.
2424 * API/JSContextRef.cpp:
2426 * API/JSContextRef.h:
2428 2006-07-07 Geoffrey Garen <ggaren@apple.com>
2435 * JavaScriptCore.xcodeproj/project.pbxproj:
2437 2006-07-05 Geoffrey Garen <ggaren@apple.com>
2441 Renamed JSCharBufferRef, which was universally unpopular, to JSStringBufferRef,
2442 which, hopefully, will be less unpopular.
2448 * API/JSCallbackObject.cpp:
2449 (KJS::JSCallbackObject::getOwnPropertySlot):
2450 (KJS::JSCallbackObject::put):
2451 (KJS::JSCallbackObject::deleteProperty):
2452 (KJS::JSCallbackObject::staticValueGetter):
2453 (KJS::JSCallbackObject::callbackGetter):
2454 * API/JSCharBufferRef.cpp: Removed.
2455 * API/JSCharBufferRef.h: Removed.
2456 * API/JSContextRef.cpp:
2459 * API/JSContextRef.h:
2461 (JSNodePrototype_appendChild):
2462 (JSNode_getNodeType):
2463 (JSNode_getChildNodes):
2464 (JSNode_getFirstChild):
2466 (JSNodeList_length):
2467 (JSNodeList_getProperty):
2468 * API/JSObjectRef.cpp:
2469 (JSFunctionMakeWithBody):
2470 (JSObjectGetDescription):
2471 (JSObjectHasProperty):
2472 (JSObjectGetProperty):
2473 (JSObjectSetProperty):
2474 (JSObjectDeleteProperty):
2475 (JSPropertyEnumeratorGetNext):
2476 (JSPropertyListAdd):
2477 * API/JSObjectRef.h:
2478 * API/JSStringBufferRef.cpp: Added.
2480 (JSStringBufferCreate):
2481 (JSStringBufferCreateUTF8):
2482 (JSStringBufferRetain):
2483 (JSStringBufferRelease):
2484 (JSValueCopyStringValue):
2485 (JSStringBufferGetLength):
2486 (JSStringBufferGetCharactersPtr):
2487 (JSStringBufferGetCharacters):
2488 (JSStringBufferGetMaxLengthUTF8):
2489 (JSStringBufferGetCharactersUTF8):
2490 (JSStringBufferIsEqual):
2491 (JSStringBufferIsEqualUTF8):
2492 (JSStringBufferCreateWithCFString):
2493 (CFStringCreateWithJSStringBuffer):
2494 * API/JSStringBufferRef.h: Added.
2496 * API/JavaScriptCore.h:
2501 (assertEqualsAsUTF8String):
2502 (assertEqualsAsCharactersPtr):
2503 (assertEqualsAsCharacters):
2504 (MyObject_hasProperty):
2505 (MyObject_getProperty):
2506 (MyObject_setProperty):
2507 (MyObject_deleteProperty):
2508 (MyObject_getPropertyList):
2509 (print_callAsFunction):
2510 (myConstructor_callAsConstructor):
2512 * JavaScriptCore.exp:
2513 * JavaScriptCore.xcodeproj/project.pbxproj:
2515 2006-07-05 Geoffrey Garen <ggaren@apple.com>
2519 Moved some code around for more logical file separation.
2522 * API/JSContextRef.h:
2523 * API/JSObjectRef.cpp:
2524 * API/JSValueRef.cpp:
2528 2006-07-03 Geoffrey Garen <ggaren@apple.com>
2532 Implemented JSFunctionMakeWithBody, which parses a script as a function body
2533 in the global scope, and returns the resulting anonymous function.
2535 I also removed private data from JSCallbackFunction. It never worked,
2536 since JSCallbackFunction doesn't inherit from JSCallbackObject.
2538 * API/JSCallbackConstructor.cpp: Removed.
2539 * API/JSCallbackConstructor.h: Removed.
2540 * API/JSCallbackFunction.cpp:
2541 (KJS::JSCallbackFunction::JSCallbackFunction):
2542 (KJS::JSCallbackFunction::implementsConstruct):
2543 (KJS::JSCallbackFunction::construct):
2544 (KJS::JSCallbackFunction::implementsCall):
2545 (KJS::JSCallbackFunction::callAsFunction):
2546 * API/JSCallbackFunction.h:
2547 * API/JSCallbackObject.cpp:
2548 (KJS::JSCallbackObject::staticFunctionGetter):
2549 * API/JSObjectRef.cpp:
2551 (JSFunctionMakeWithCallbacks):
2552 * API/JSObjectRef.h:
2558 * JavaScriptCore.exp: Programmatically added all symbols exported by
2559 API object files, and sorted results
2560 * JavaScriptCore.xcodeproj/project.pbxproj:
2562 2006-07-03 Geoffrey Garen <ggaren@apple.com>
2566 - Return syntax error in JSCheckSyntax through a JSValueRef* exception
2570 * API/JSContextRef.cpp:
2574 * JavaScriptCore.exp:
2575 * kjs/interpreter.cpp:
2576 (KJS::Interpreter::checkSyntax):
2577 * kjs/interpreter.h:
2579 2006-07-04 Darin Adler <darin@apple.com>
2583 * wtf/MathExtras.h: Oops. Added missing #endif.
2585 2006-07-04 Bjoern Graf <bjoern.graf@gmail.com>
2588 Tweaked a bit by Darin.
2590 - http://bugs.webkit.org/show_bug.cgi?id=9678
2591 work around MSVCRT's fmod function returning NaN for fmod(x, infinity) instead of x
2593 * wtf/MathExtras.h: Added include of <float.h>.
2594 (isinf): Fix to return false for NAN.
2595 (wtf_fmod): Added. An inline that works around the bug.
2598 * kjs/number_object.cpp:
2599 * kjs/operations.cpp:
2601 Added includes of MathExtras.h to all files using fmod.
2603 * JavaScriptCore.xcodeproj/project.pbxproj: Let Xcode 2.3 have its way with
2606 2006-07-01 Geoffrey Garen <ggaren@apple.com>
2610 - Refined value conversions in the API:
2611 - failed toNumber returns NaN
2612 - failed toObject returns NULL
2613 - failed toString returns empty string
2615 - Refined excpetion handling in the API:
2616 - failed value conversions do not throw exceptions
2617 - uncaught exceptions in JSEvaluate, JSObjectCallAsFunction, and
2618 JSObjectCallAsConstructor are returned through a JSValueRef* exception
2620 - removed JSContextHasException, because JSContextGetException does
2624 * API/JSCharBufferRef.cpp:
2625 (JSValueCopyStringValue):
2626 * API/JSContextRef.cpp:
2628 * API/JSContextRef.h:
2629 * API/JSNodeList.c: Added test code demonstrating how you would use
2630 toNumber, and why you probably don't need toUInt32, etc.
2631 (JSNodeListPrototype_item):
2632 (JSNodeList_getProperty):
2633 * API/JSObjectRef.cpp:
2635 (JSObjectCallAsFunction):
2636 (JSObjectCallAsConstructor):
2637 * API/JSObjectRef.h:
2638 * API/JSValueRef.cpp:
2644 (main): Added tests for new rules, and call to JSGCProtect to fix Intel
2646 * JavaScriptCore.exp:
2648 2006-07-03 Darin Adler <darin@apple.com>
2650 - Rolled out HashMap implementation of NPRuntime, at least temporarily.
2652 Fixes hang in the bindings section of layout tests seen on the
2655 This code was using HashMap<const char*, PrivateIdentifier*>.
2656 But that hashes based on pointer identity, not string value.
2657 The default hash for any pointer type is to hash based on the pointer.
2658 And WTF doesn't currently have a string hash for char*.
2659 We'll need to fix that before re-landing this patch.
2661 (Formatting was also incorrect -- extra spaces in parentheses.)
2663 * bindings/npruntime.cpp: Rolled out last change.
2665 2006-07-02 Justin Haygood <jhaygood@spsu.edu>
2667 Reviewed, tweaked, landed by ggaren.
2669 - Port NPRuntime from CFDictionary to HashMap.
2671 * bindings/npruntime.cpp:
2672 (getStringIdentifierDictionary):
2673 (getIntIdentifierDictionary):
2674 (_NPN_GetStringIdentifier):
2675 (_NPN_GetIntIdentifier):
2676 * bindings/npruntime.h:
2678 2006-07-01 Geoffrey Garen <ggaren@apple.com>
2682 - Fixed <rdar://problem/4611197> REGRESSION: Liveconnect with Java test
2683 fails at http://www-sor.inria.fr/~dedieu/notes/liveconnect/simple_example.html
2685 * JavaScriptCore.exp: Export symbols used by liveconnect
2687 2006-06-29 Geoffrey Garen <ggaren@apple.com>
2691 - Phase 2 in the JS API.
2693 - Added support for specifying static tables of values -- this should
2694 obviate the need for using complicated callbacks for most lookups.
2696 - API objects are now created with classes (JSClassRef) -- in order to support
2697 static values, and in order to prevent API objects from storing their
2698 data inline, and thus falling into the oversized (read: slow and prone to
2699 giving Maciej the frowny face) heap.
2701 - Added two specialized JSObject subclasses -- JSCallbackFunction and JSCallbackConstructor --
2702 to allow JSFunctionMake and JSConstructorMake to continue to work with
2703 the new class model. Another solution to this problem would be to create
2704 a custom class object for each function and constructor you make. This
2705 solution is more code but also more efficient.
2707 - Substantially beefed up the minidom example to demonstrate and test a
2708 lot of these techniques. Its output is still pretty haphazard, though.
2710 - Gave the <kjs/ preface to some includes -- I'm told this matters to
2711 building on some versions of Linux.
2713 - Implemented JSValueIsInstanceOf and JSValueIsObjectOfClass
2715 - Removed GetDescription callback. Something in the class datastructure
2716 should take care of this.
2719 * API/JSCallbackConstructor.cpp: Added.
2721 (KJS::JSCallbackConstructor::JSCallbackConstructor):
2722 (KJS::JSCallbackConstructor::implementsConstruct):
2723 (KJS::JSCallbackConstructor::construct):
2724 (KJS::JSCallbackConstructor::setPrivate):
2725 (KJS::JSCallbackConstructor::getPrivate):
2726 * API/JSCallbackConstructor.h: Added.
2727 (KJS::JSCallbackConstructor::classInfo):
2728 * API/JSCallbackFunction.cpp: Added.
2730 (KJS::JSCallbackFunction::JSCallbackFunction):
2731 (KJS::JSCallbackFunction::implementsCall):
2732 (KJS::JSCallbackFunction::callAsFunction):
2733 (KJS::JSCallbackFunction::setPrivate):
2734 (KJS::JSCallbackFunction::getPrivate):
2735 * API/JSCallbackFunction.h: Added.
2736 (KJS::JSCallbackFunction::classInfo):
2737 * API/JSCallbackObject.cpp:
2739 (KJS::JSCallbackObject::JSCallbackObject):
2740 (KJS::JSCallbackObject::init):
2741 (KJS::JSCallbackObject::~JSCallbackObject):
2742 (KJS::JSCallbackObject::className):
2743 (KJS::JSCallbackObject::getOwnPropertySlot):
2744 (KJS::JSCallbackObject::put):
2745 (KJS::JSCallbackObject::deleteProperty):
2746 (KJS::JSCallbackObject::implementsConstruct):
2747 (KJS::JSCallbackObject::construct):
2748 (KJS::JSCallbackObject::implementsCall):
2749 (KJS::JSCallbackObject::callAsFunction):
2750 (KJS::JSCallbackObject::getPropertyList):
2751 (KJS::JSCallbackObject::toBoolean):
2752 (KJS::JSCallbackObject::toNumber):
2753 (KJS::JSCallbackObject::toString):
2754 (KJS::JSCallbackObject::inherits):
2755 (KJS::JSCallbackObject::staticValueGetter):
2756 (KJS::JSCallbackObject::staticFunctionGetter):
2757 (KJS::JSCallbackObject::callbackGetter):
2758 * API/JSCallbackObject.h:
2759 * API/JSCharBufferRef.cpp:
2760 * API/JSClassRef.cpp: Added.
2764 * API/JSClassRef.h: Added.
2765 (StaticValueEntry::StaticValueEntry):
2766 (StaticFunctionEntry::StaticFunctionEntry):
2767 (__JSClass::__JSClass):
2768 * API/JSContextRef.cpp:
2771 * API/JSContextRef.h:
2772 * API/JSNode.c: Added.
2773 (JSNodePrototype_appendChild):
2774 (JSNodePrototype_removeChild):
2775 (JSNodePrototype_replaceChild):
2776 (JSNodePrototype_class):
2777 (JSNode_getNodeType):
2778 (JSNode_getChildNodes):
2779 (JSNode_getFirstChild):
2785 * API/JSNode.h: Added.
2786 * API/JSNodeList.c: Added.
2787 (JSNodeListPrototype_item):
2788 (JSNodeListPrototype_class):
2789 (JSNodeList_length):
2790 (JSNodeList_getProperty):
2791 (JSNodeList_finalize):
2793 (JSNodeList_prototype):
2795 * API/JSNodeList.h: Added.
2796 * API/JSObjectRef.cpp:
2799 (JSConstructorMake):
2800 (__JSPropertyEnumerator::__JSPropertyEnumerator):
2801 (JSObjectCreatePropertyEnumerator):
2802 (JSPropertyEnumeratorGetNext):
2803 (JSPropertyEnumeratorRetain):
2804 (JSPropertyEnumeratorRelease):
2805 * API/JSObjectRef.h:
2806 (__JSObjectCallbacks::):
2807 * API/JSValueRef.cpp:
2808 (JSValueIsObjectOfClass):
2809 (JSValueIsInstanceOf):
2811 * API/Node.c: Added.
2815 (Node_replaceChild):
2818 * API/Node.h: Added.
2819 * API/NodeList.c: Added.
2825 * API/NodeList.h: Added.
2829 (createStringWithContentsOfFile):
2832 (assertEqualsAsCharacters):
2833 (MyObject_getProperty):
2835 (myConstructor_callAsConstructor):
2838 * JavaScriptCore.xcodeproj/project.pbxproj:
2840 2006-06-26 Kevin Ollivier <kevino@theolliviers.com>
2842 Reviewed and tweaked by Darin.
2844 - Compile fixes for wx port / gcc 4.0.2
2846 * kjs/array_object.cpp:
2847 Added missing headers.
2850 gcc needs class prototypes before defining those classes as friend classes
2852 2006-06-30 Mike Emmel <mike.emmel@gmail.com>
2856 Compilation fixes for Linux/Gdk.
2858 * JavaScriptCore/kjs/interpreter.cpp: added include of signal.h
2859 * JavaScriptCore/kjs/ExecState.h: added missing class declaration
2860 * JavaScriptCore/kjs/ExecState.cpp: case wrong on include of context.h
2861 * JavaScriptCore/JavaScriptCoreSources.bkl: added Context.cpp and ExecState.cpp
2863 === Safari-521.14 ===
2865 2006-06-29 Maciej Stachowiak <mjs@apple.com>
2869 - add headerdoc comments to some of the new JS API headers
2874 2006-06-28 Timothy Hatcher <timothy@apple.com>
2876 Prefer the Stabs debugging symbols format until DWARF bugs are fixed.
2878 * JavaScriptCore.xcodeproj/project.pbxproj:
2880 2006-06-27 Timothy Hatcher <timothy@apple.com>
2884 <rdar://problem/4448350> Deprecated ObjC language API used in JavaScriptCore, WebCore, WebKit and WebBrowser
2886 Switch to the new ObjC 2 API, ifdefed the old code around OBJC_API_VERSION so it still works on Tiger.
2887 Removed the use of the old stringWithCString, switched to the new Tiger version that accepts an encoding.
2888 Lots of code style cleanup.
2890 * JavaScriptCore.xcodeproj/project.pbxproj:
2891 * bindings/objc/objc_class.h:
2892 * bindings/objc/objc_class.mm:
2893 (KJS::Bindings::ObjcClass::~ObjcClass):
2894 (KJS::Bindings::_createClassesByIsAIfNecessary):
2895 (KJS::Bindings::ObjcClass::classForIsA):
2896 (KJS::Bindings::ObjcClass::name):
2897 (KJS::Bindings::ObjcClass::methodsNamed):
2898 (KJS::Bindings::ObjcClass::fieldNamed):
2899 (KJS::Bindings::ObjcClass::fallbackObject):
2900 * bindings/objc/objc_header.h:
2901 * bindings/objc/objc_instance.h:
2902 * bindings/objc/objc_instance.mm:
2903 (ObjcInstance::ObjcInstance):
2904 (ObjcInstance::~ObjcInstance):
2905 (ObjcInstance::operator=):
2906 (ObjcInstance::begin):
2907 (ObjcInstance::end):
2908 (ObjcInstance::getClass):
2909 (ObjcInstance::invokeMethod):
2910 (ObjcInstance::invokeDefaultMethod):
2911 (ObjcInstance::setValueOfField):
2912 (ObjcInstance::supportsSetValueOfUndefinedField):
2913 (ObjcInstance::setValueOfUndefinedField):
2914 (ObjcInstance::getValueOfField):
2915 (ObjcInstance::getValueOfUndefinedField):
2916 (ObjcInstance::defaultValue):
2917 (ObjcInstance::stringValue):
2918 (ObjcInstance::numberValue):
2919 (ObjcInstance::booleanValue):
2920 (ObjcInstance::valueOf):
2921 * bindings/objc/objc_runtime.h:
2922 * bindings/objc/objc_runtime.mm:
2923 (ObjcMethod::ObjcMethod):
2925 (ObjcMethod::getMethodSignature):
2926 (ObjcMethod::setJavaScriptName):
2929 (ObjcField::valueFromInstance):
2930 (convertValueToObjcObject):
2931 (ObjcField::setValueToInstance):
2932 (ObjcArray::operator=):
2933 (ObjcArray::setValueAt):
2934 (ObjcArray::valueAt):
2935 (ObjcFallbackObjectImp::ObjcFallbackObjectImp):
2936 (ObjcFallbackObjectImp::callAsFunction):
2937 (ObjcFallbackObjectImp::defaultValue):
2939 2006-06-28 Anders Carlsson <acarlsson@apple.com>
2943 http://bugs.webkit.org/show_bug.cgi?id=8636
2944 REGRESSION: JavaScript access to Java applet causes hang (_webViewURL not implemented)
2946 * bindings/jni/jni_objc.mm:
2947 (KJS::Bindings::dispatchJNICall):
2948 Just pass nil as the calling URL. This will cause the Java plugin to use the URL of the page
2949 containing the applet (which is what we used to do).
2951 2006-06-27 Timothy Hatcher <timothy@apple.com>
2955 <rdar://problem/4406785> Add an export file to TOT JavaScriptCore like the Safari-2-0-branch
2957 * JavaScriptCore.exp: Added.
2958 * JavaScriptCore.xcodeproj/project.pbxproj:
2960 2006-06-25 Geoffrey Garen <ggaren@apple.com>
2964 - Added JSConstructorMake to match JSFunctionMake, along with test code.
2966 [ I checked in the ChangeLog before without the actual files. ]
2968 * API/JSObjectRef.cpp:
2969 (JSConstructorMake):
2970 * API/JSObjectRef.h:
2972 (myConstructor_callAsConstructor):
2976 * JavaScriptCore.xcodeproj/project.pbxproj: Moved testapi.c to the testapi
2977 target -- this was an oversight in my earlier check-in.
2979 2006-06-25 Timothy Hatcher <timothy@apple.com>
2983 Bug 9574: Drosera should show inline scripts within the original HTML
2984 http://bugs.webkit.org/show_bug.cgi?id=9574
2986 Pass the starting line number and error message to the debugger.
2989 (Debugger::sourceParsed):
2992 (KJS::GlobalFuncImp::callAsFunction):
2993 * kjs/function_object.cpp:
2994 (FunctionObjectImp::construct):
2995 * kjs/interpreter.cpp:
2996 (KJS::Interpreter::evaluate):
2998 2006-06-24 Alexey Proskuryakov <ap@nypop.com>
3000 Rubber-stamped by Eric.
3002 Add a -h (do not follow symlinks) option to ln in derived sources build script (without it,
3003 a symlink was created inside the source directory on second build).
3005 * JavaScriptCore.xcodeproj/project.pbxproj:
3007 2006-06-24 David Kilzer <ddkilzer@kilzer.net>
3009 Reviewed by Timothy.
3011 * Info.plist: Fixed copyright to include 2003-2006.
3013 2006-06-24 Alexey Proskuryakov <ap@nypop.com>
3017 - http://bugs.webkit.org/show_bug.cgi?id=9418
3018 WebKit will not build when Space exists in path
3020 * JavaScriptCore.xcodeproj/project.pbxproj: Enclose search paths in quotes; create symlinks to
3021 avoid passing paths with spaces to make.
3023 2006-06-23 Timothy Hatcher <timothy@apple.com>
3027 Adding more operator[] overloads for long and short types.
3030 (WTF::Vector::operator[]):
3032 === JavaScriptCore-521.13 ===
3034 2006-06-22 Alexey Proskuryakov <ap@nypop.com>
3038 - http://bugs.webkit.org/show_bug.cgi?id=9539
3039 Another case error preventing build
3041 * API/JSObjectRef.cpp: Changed "identifier.h" to "Identifier.h"
3043 2006-06-22 David Kilzer <ddkilzer@kilzer.net>
3047 http://bugs.webkit.org/show_bug.cgi?id=9539
3048 Another case error preventing build
3050 * API/APICast.h: Changed "UString.h" to "ustring.h".
3052 2006-06-21 Geoffrey Garen <ggaren@apple.com>
3054 Fixed release build, fixed accidental infinite recursion due to
3055 last minute global replace gone awry.
3060 (assertEqualsAsBoolean):
3061 (assertEqualsAsNumber):
3062 (assertEqualsAsUTF8String):
3063 (assertEqualsAsCharactersPtr):
3064 * JavaScriptCore.xcodeproj/project.pbxproj:
3066 2006-06-21 Geoffrey Garen <ggaren@apple.com>
3070 - First cut at C API to JavaScript. Includes a unit test, 'testapi.c',
3071 and the outline of a test app, 'minidom.c'.
3073 Includes one change to JSC internals: Rename propList to getPropertyList and have it
3074 take its target property list by reference so that subclasses can
3075 add properties to the list before calling through to their superclasses.
3077 Also, I just ran prepare-ChangeLog in about 10 seconds, and I would like
3078 to give a shout-out to that.
3080 * API/APICast.h: Added.
3083 * API/JSBase.h: Added.
3084 * API/JSCallbackObject.cpp: Added.
3086 (KJS::JSCallbackObject::JSCallbackObject):
3087 (KJS::JSCallbackObject::~JSCallbackObject):
3088 (KJS::JSCallbackObject::className):
3089 (KJS::JSCallbackObject::getOwnPropertySlot):
3090 (KJS::JSCallbackObject::put):
3091 (KJS::JSCallbackObject::deleteProperty):
3092 (KJS::JSCallbackObject::implementsConstruct):
3093 (KJS::JSCallbackObject::construct):
3094 (KJS::JSCallbackObject::implementsCall):
3095 (KJS::JSCallbackObject::callAsFunction):
3096 (KJS::JSCallbackObject::getPropertyList):
3097 (KJS::JSCallbackObject::toBoolean):
3098 (KJS::JSCallbackObject::toNumber):
3099 (KJS::JSCallbackObject::toString):
3100 (KJS::JSCallbackObject::setPrivate):
3101 (KJS::JSCallbackObject::getPrivate):
3102 (KJS::JSCallbackObject::cachedValueGetter):
3103 (KJS::JSCallbackObject::callbackGetter):
3104 * API/JSCallbackObject.h: Added.
3105 (KJS::JSCallbackObject::classInfo):
3106 * API/JSCharBufferRef.cpp: Added.
3108 (JSCharBufferCreate):
3109 (JSCharBufferCreateUTF8):
3110 (JSCharBufferRetain):
3111 (JSCharBufferRelease):
3112 (JSValueCopyStringValue):
3113 (JSCharBufferGetLength):
3114 (JSCharBufferGetCharactersPtr):
3115 (JSCharBufferGetCharacters):
3116 (JSCharBufferGetMaxLengthUTF8):
3117 (JSCharBufferGetCharactersUTF8):
3118 (JSCharBufferIsEqual):
3119 (JSCharBufferIsEqualUTF8):
3120 (JSCharBufferCreateWithCFString):
3121 (CFStringCreateWithJSCharBuffer):
3122 * API/JSCharBufferRef.h: Added.
3123 * API/JSContextRef.cpp: Added.
3126 (JSContextGetGlobalObject):
3129 (JSContextHasException):
3130 (JSContextGetException):
3131 (JSContextClearException):
3132 (JSContextSetException):
3133 * API/JSContextRef.h: Added.
3134 * API/JSObjectRef.cpp: Added.
3138 (JSObjectGetDescription):
3139 (JSObjectGetPrototype):
3140 (JSObjectSetPrototype):
3141 (JSObjectHasProperty):
3142 (JSObjectGetProperty):
3143 (JSObjectSetProperty):
3144 (JSObjectDeleteProperty):
3145 (JSObjectGetPrivate):
3146 (JSObjectSetPrivate):
3147 (JSObjectIsFunction):
3148 (JSObjectCallAsFunction):
3149 (JSObjectIsConstructor):
3150 (JSObjectCallAsConstructor):
3151 (__JSPropertyListEnumerator::__JSPropertyListEnumerator):
3152 (JSObjectCreatePropertyEnumerator):
3153 (JSPropertyEnumeratorGetNext):
3154 (JSPropertyEnumeratorRetain):
3155 (JSPropertyEnumeratorRelease):
3156 (JSPropertyListAdd):
3157 * API/JSObjectRef.h: Added.
3158 * API/JSValueRef.cpp: Added.
3160 (JSValueIsUndefined):
3167 (JSValueIsStrictEqual):
3177 * API/JSValueRef.h: Added.
3178 * API/JavaScriptCore.h: Added.
3179 * API/minidom.c: Added.
3181 * API/minidom.html: Added.
3182 * API/minidom.js: Added.
3183 * API/testapi.c: Added.
3184 (assertEqualsAsBoolean):
3185 (assertEqualsAsNumber):
3186 (assertEqualsAsUTF8String):
3187 (assertEqualsAsCharactersPtr):
3188 (assertEqualsAsCharacters):
3189 (MyObject_initialize):
3190 (MyObject_copyDescription):
3191 (MyObject_hasProperty):
3192 (MyObject_getProperty):
3193 (MyObject_setProperty):
3194 (MyObject_deleteProperty):
3195 (MyObject_getPropertyList):
3196 (MyObject_callAsFunction):
3197 (MyObject_callAsConstructor):
3198 (MyObject_convertToType):
3199 (MyObject_finalize):
3200 (print_callAsFunction):
3202 (createStringWithContentsOfFile):
3203 * API/testapi.js: Added.
3205 * JavaScriptCore.xcodeproj/project.pbxproj:
3206 * bindings/npruntime_impl.h:
3207 * kjs/array_instance.h:
3208 * kjs/array_object.cpp:
3209 (ArrayInstance::getPropertyList):
3210 * kjs/interpreter.cpp:
3211 (KJS::Interpreter::evaluate):
3213 (ForInNode::execute):
3215 (KJS::JSObject::put):
3216 (KJS::JSObject::canPut):
3217 (KJS::JSObject::deleteProperty):
3218 (KJS::JSObject::propertyIsEnumerable):
3219 (KJS::JSObject::getPropertyAttributes):
3220 (KJS::JSObject::getPropertyList):
3222 * kjs/property_map.cpp:
3223 (KJS::PropertyMap::get):
3224 * kjs/property_map.h:
3225 * kjs/scope_chain.cpp:
3226 (KJS::ScopeChain::print):
3227 * kjs/string_object.cpp:
3228 (StringInstance::getPropertyList):
3229 * kjs/string_object.h:
3231 (KJS::UString::Rep::ref):
3233 2006-06-20 Timothy Hatcher <timothy@apple.com>
3237 Make sure we clear the exception before returning so
3238 that future calls will not fail because of an earlier
3239 exception state. Assert on entry that the WebScriptObject
3240 is working with an ExecState that dose not have an exception.
3241 Document that evaluateWebScript and callWebScriptMethod return
3242 WebUndefined when an exception is thrown.
3244 * bindings/objc/WebScriptObject.h:
3245 * bindings/objc/WebScriptObject.mm:
3246 (-[WebScriptObject callWebScriptMethod:withArguments:]):
3247 (-[WebScriptObject evaluateWebScript:]):
3248 (-[WebScriptObject setValue:forKey:]):
3249 (-[WebScriptObject valueForKey:]):
3250 (-[WebScriptObject removeWebScriptKey:]):
3251 (-[WebScriptObject webScriptValueAtIndex:]):
3252 (-[WebScriptObject setWebScriptValueAtIndex:value:]):
3254 2006-06-19 Anders Carlsson <acarlsson@apple.com>
3258 * kjs/interpreter.cpp:
3259 (KJS::TimeoutChecker::pauseTimeoutCheck):
3260 (KJS::TimeoutChecker::resumeTimeoutCheck):
3261 Fix argument order in setitimer calls.
3263 2006-06-18 Anders Carlsson <acarlsson@apple.com>
3267 * kjs/interpreter.cpp:
3268 (KJS::TimeoutChecker::pauseTimeoutCheck):
3269 Do nothing if the timeout check hasn't been started.
3271 (KJS::TimeoutChecker::resumeTimeoutCheck):
3272 Do nothing if the timeout check hasn't been started.
3273 Use the right signal handler when unblocking.
3275 (KJS::Interpreter::handleTimeout):
3276 pause/resume the timeout check around the call to
3277 shouldInterruptScript().
3279 2006-06-16 Ben Goodger <beng@google.com>
3283 http://bugs.webkit.org/show_bug.cgi?id=9491
3284 Windows build breaks in interpreter.cpp
3286 * kjs/interpreter.cpp
3287 (KJS::TimeoutChecker::pauseTimeoutCheck):
3288 (KJS::TimeoutChecker::resumeTimeoutCheck):
3289 Make sure to only assert equality with s_executingInterpreter when it
3290 is being used (i.e. when HAVE(SYS_TIME_H) == true)
3292 2006-06-17 David Kilzer <ddkilzer@kilzer.net>
3296 http://bugs.webkit.org/show_bug.cgi?id=9477
3297 REGRESSION: fast/dom/replaceChild.html crashes on WebKit ToT in debug build
3300 (KJS::FunctionImp::callAsFunction): Refetch the debugger after executing the function
3301 in case the WebFrame it was running in has since been destroyed.
3303 2006-06-17 David Kilzer <ddkilzer@kilzer.net>
3307 http://bugs.webkit.org/show_bug.cgi?id=9476
3308 REGRESSION: Reproducible crash after closing window after viewing
3309 css2.1/t0803-c5501-imrgn-t-00-b-ag.html
3312 (Debugger::detach): Call setDebugger(0) for all interpreters removed from
3313 the 'attached to a debugger' list.
3315 2006-06-17 Anders Carlsson <acarlsson@apple.com>
3317 Reviewed by Maciej and Geoff.
3319 http://bugs.webkit.org/show_bug.cgi?id=7080
3320 Provide some way to stop a JavaScript infinite loop
3324 Add Interrupted completion type.
3327 (KJS::FunctionImp::callAsFunction):
3328 (KJS::GlobalFuncImp::callAsFunction):
3329 Only set the exception on the new ExecState if the current one has had one.
3331 * kjs/interpreter.cpp:
3332 (KJS::TimeoutChecker::startTimeoutCheck):
3333 (KJS::TimeoutChecker::stopTimeoutCheck):
3334 (KJS::TimeoutChecker::alarmHandler):
3335 (KJS::TimeoutChecker::pauseTimeoutCheck):
3336 (KJS::TimeoutChecker::resumeTimeoutCheck):
3337 New TimeoutChecker class which handles setting Interpreter::m_timedOut flag after a given
3338 period of time. This currently only works on Unix platforms where setitimer and signals are used.
3340 (KJS::Interpreter::Interpreter):
3341 Initialize new member variables.
3343 (KJS::Interpreter::~Interpreter):
3344 Destroy the timeout checker.
3346 (KJS::Interpreter::startTimeoutCheck):
3347 (KJS::Interpreter::stopTimeoutCheck):
3348 (KJS::Interpreter::pauseTimeoutCheck):
3349 (KJS::Interpreter::resumeTimeoutCheck):
3350 Call the timeout checker.
3352 (KJS::Interpreter::handleTimeout):
3353 Called on timeout. Resets the m_timedOut flag and calls shouldInterruptScript.
3355 * kjs/interpreter.h:
3356 (KJS::Interpreter::setTimeoutTime):
3357 New function for setting the timeout time.
3359 (KJS::Interpreter::shouldInterruptScript):
3360 New function. The idea is that this should be overridden by subclasses in order to for example
3361 pop up a dialog asking the user if the script should be interrupted.
3363 (KJS::Interpreter::checkTimeout):
3364 New function which checks the m_timedOut flag and calls handleTimeout if it's set.
3367 (DoWhileNode::execute):
3368 (WhileNode::execute):
3370 Call Interpreter::checkTimeout after each iteration of the loop.
3372 2006-06-15 Timothy Hatcher <timothy@apple.com>
3374 Reviewed by Geoff and Darin.
3376 Prefer the DWARF debugging symbols format for use in Xcode 2.3.
3378 * JavaScriptCore.xcodeproj/project.pbxproj:
3380 2006-06-14 Geoffrey Garen <ggaren@apple.com>
3384 - fixed http://bugs.webkit.org/show_bug.cgi?id=9438
3385 Someone broke ToT: cannot build
3387 * JavaScriptCore.xcodeproj/project.pbxproj:
3388 * bindings/runtime_root.h: Changed "Interpreter.h" to "interpreter.h"
3390 2006-06-12 Geoffrey Garen <ggaren@apple.com>
3394 * bindings/objc/WebScriptObject.mm:
3395 (+[WebScriptObject throwException:]): Restore assignment I accidentally
3396 deleted in previous commit
3398 2006-06-12 Geoffrey Garen <ggaren@apple.com>
3400 Reviewed by TimO, Maciej.
3402 - Merged InterpreterImp code into Interpreter, which implements
3403 all interpreter functionality now. This is part of my continuing quest
3404 to create an external notion of JS "execution context" that is unified and simple --
3405 something to replace the mix of Context, ContextImp, ExecState, Interpreter,
3406 InterpreterImp, and JSRun.
3408 All tests pass. Leaks test has not regressed from its baseline ~207 leaks
3409 with ~3460 leaked nodes.
3411 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3412 * JavaScriptCore.xcodeproj/project.pbxproj:
3413 * bindings/NP_jsobject.cpp:
3414 * bindings/objc/WebScriptObject.mm:
3415 (+[WebScriptObject throwException:]):
3416 * bindings/runtime_root.cpp:
3417 * bindings/runtime_root.h:
3419 (KJS::Context::Context):
3420 * kjs/ExecState.cpp: Added.
3421 (KJS::ExecState::lexicalInterpreter):
3422 * kjs/ExecState.h: Added.
3423 (KJS::ExecState::dynamicInterpreter):
3424 * kjs/SavedBuiltins.h: Added.
3425 * kjs/bool_object.cpp:
3426 (BooleanPrototype::BooleanPrototype):
3427 * kjs/collector.cpp:
3428 (KJS::Collector::collect):
3429 (KJS::Collector::numInterpreters):
3435 (KJS::FunctionImp::callAsFunction):
3436 (KJS::GlobalFuncImp::callAsFunction):
3437 * kjs/function_object.cpp:
3438 (FunctionObjectImp::construct):
3441 * kjs/interpreter.cpp:
3442 (KJS::interpreterMap):
3443 (KJS::Interpreter::Interpreter):
3444 (KJS::Interpreter::init):
3445 (KJS::Interpreter::~Interpreter):
3446 (KJS::Interpreter::globalObject):
3447 (KJS::Interpreter::initGlobalObject):
3448 (KJS::Interpreter::globalExec):
3449 (KJS::Interpreter::checkSyntax):
3450 (KJS::Interpreter::evaluate):
3451 (KJS::Interpreter::builtinObject):
3452 (KJS::Interpreter::builtinFunction):
3453 (KJS::Interpreter::builtinArray):
3454 (KJS::Interpreter::builtinBoolean):
3455 (KJS::Interpreter::builtinString):
3456 (KJS::Interpreter::builtinNumber):
3457 (KJS::Interpreter::builtinDate):
3458 (KJS::Interpreter::builtinRegExp):
3459 (KJS::Interpreter::builtinError):
3460 (KJS::Interpreter::builtinObjectPrototype):
3461 (KJS::Interpreter::builtinFunctionPrototype):
3462 (KJS::Interpreter::builtinArrayPrototype):
3463 (KJS::Interpreter::builtinBooleanPrototype):
3464 (KJS::Interpreter::builtinStringPrototype):
3465 (KJS::Interpreter::builtinNumberPrototype):
3466 (KJS::Interpreter::builtinDatePrototype):
3467 (KJS::Interpreter::builtinRegExpPrototype):
3468 (KJS::Interpreter::builtinErrorPrototype):
3469 (KJS::Interpreter::builtinEvalError):
3470 (KJS::Interpreter::builtinRangeError):
3471 (KJS::Interpreter::builtinReferenceError):
3472 (KJS::Interpreter::builtinSyntaxError):
3473 (KJS::Interpreter::builtinTypeError):
3474 (KJS::Interpreter::builtinURIError):
3475 (KJS::Interpreter::builtinEvalErrorPrototype):
3476 (KJS::Interpreter::builtinRangeErrorPrototype):
3477 (KJS::Interpreter::builtinReferenceErrorPrototype):
3478 (KJS::Interpreter::builtinSyntaxErrorPrototype):
3479 (KJS::Interpreter::builtinTypeErrorPrototype):
3480 (KJS::Interpreter::builtinURIErrorPrototype):
3481 (KJS::Interpreter::mark):
3482 (KJS::Interpreter::interpreterWithGlobalObject):
3483 (KJS::Interpreter::saveBuiltins):
3484 (KJS::Interpreter::restoreBuiltins):
3485 * kjs/interpreter.h:
3486 (KJS::Interpreter::setCompatMode):
3487 (KJS::Interpreter::compatMode):
3488 (KJS::Interpreter::firstInterpreter):
3489 (KJS::Interpreter::nextInterpreter):
3490 (KJS::Interpreter::prevInterpreter):
3491 (KJS::Interpreter::debugger):
3492 (KJS::Interpreter::setDebugger):
3493 (KJS::Interpreter::setContext):
3494 (KJS::Interpreter::context):
3496 (StatementNode::hitStatement):
3497 (RegExpNode::evaluate):
3500 2006-06-12 Geoffrey Garen <ggaren@apple.com>
3504 - Have *.lut.h files #include lookup.h to eliminate surprising header
3505 include order dependency.
3507 * DerivedSources.make:
3508 * kjs/array_object.cpp:
3509 * kjs/date_object.cpp:
3510 * kjs/date_object.h:
3511 (KJS::DateProtoFunc::):
3513 * kjs/math_object.cpp:
3514 * kjs/number_object.cpp:
3515 * kjs/regexp_object.cpp:
3516 * kjs/string_object.cpp:
3518 2006-06-10 Geoffrey Garen <ggaren@apple.com>
3520 - http://bugs.webkit.org/show_bug.cgi?id=8515
3521 Linux porting compile bug
3523 Fix by Mike Emmel, Reviewed by Darin.
3525 * JavaScriptCoreSources.bkl:
3529 2006-06-09 Geoffrey Garen <ggaren@apple.com>
3531 Build fix -- I think :).
3533 * JavaScriptCore.xcodeproj/project.pbxproj:
3536 2006-06-09 Geoffrey Garen <ggaren@apple.com>
3538 Reviewed by Eric (yay!).
3540 - Removed Context wrapper for ContextImp, renamed ContextImp to Context,
3541 split Context into its own file -- Context.cpp -- renamed _var to m_var,
3542 change ' *' to '* '.
3544 * JavaScriptCore.xcodeproj/project.pbxproj:
3545 * kjs/Context.cpp: Added.
3546 (KJS::Context::Context):
3547 (KJS::Context::~Context):
3548 (KJS::Context::mark):
3550 (KJS::Context::scopeChain):
3551 (KJS::Context::variableObject):
3552 (KJS::Context::setVariableObject):
3553 (KJS::Context::thisValue):
3554 (KJS::Context::callingContext):
3555 (KJS::Context::activationObject):
3556 (KJS::Context::currentBody):
3557 (KJS::Context::function):
3558 (KJS::Context::arguments):
3559 (KJS::Context::pushScope):
3560 (KJS::Context::seenLabels):
3562 (KJS::FunctionImp::callAsFunction):
3563 (KJS::FunctionImp::processParameters):
3564 (KJS::FunctionImp::argumentsGetter):
3565 (KJS::GlobalFuncImp::callAsFunction):
3567 (KJS::InterpreterImp::evalu