1 2006-10-02 Nikolas Zimmermann <zimmermann@kde.org>
3 Reviewed/landed by Adam.
5 Build testkjs on Qt/Linux.
9 2006-10-02 Nikolas Zimmermann <zimmermann@kde.org>
11 Reviewed by eseidel. Landed by eseidel.
13 Fix win32 build, which has no inttypes.h
17 2006-10-02 Nikolas Zimmermann <zimmermann@kde.org>
19 Reviewed by eseidel & mjs. Landed by eseidel.
21 Fix Qt/Linux build with older gcc 3.3.4.
22 http://bugs.webkit.org/show_bug.cgi?id=11116
24 * kjs/lookup.h: Move cacheGlobalObject into KJS namespace.
25 (KJS::cacheGlobalObject): Also remove GCC_ROOT_NS_HACK.
26 * wtf/Assertions.h: Include inttypes.h for uintptr_t.
28 2006-09-28 Steve Falkenburg <sfalken@apple.com>
32 Use $(ConfigSuffix) set via vsprops files to add _debug
33 to end of debug filenames.
35 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
36 * JavaScriptCore.vcproj/debug.vsprops: Added.
37 * JavaScriptCore.vcproj/dftables/dftables.vcproj:
38 * JavaScriptCore.vcproj/release.vsprops: Added.
39 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
41 2006-09-28 Darin Adler <darin@apple.com>
45 - support for change that should fix <rdar://problem/4733044>
46 REGRESSION: XML iBench shows 10% perf. regression (copying
47 strings while decoding)
49 * wtf/Vector.h: Changed VectorBuffer so that the general case
50 contains an instance of the 0 case, since deriving from it
51 was violating the Liskov Substitution Principle.
52 (WTF::VectorBuffer::releaseBuffer): Added. Releases the buffer so it can
53 be adopted by another data structure that uses the FastMalloc.h allocator.
54 Returns 0 if the internal buffer was being used.
55 (WTF::Vector::releaseBuffer): Added. Releases the buffer as above or creates
56 a new one in the case where the internal buffer was being used.
58 2006-09-28 Maciej Stachowiak <mjs@apple.com>
62 - change garbage collection to happen at increments proportional to number of live objects, not always
63 every 1000 allocations
66 (KJS::Collector::allocate):
68 2006-09-28 Maciej Stachowiak <mjs@apple.com>
72 - fixed REGRESSION (r16606): javascriptCore Crash on website load
76 - fixed some possible off-by-one bugs
77 - use indexing, not iterators, for Vectors
78 - store Vector by pointer instead of by value to avoid blowing out FunctionImp size
81 (KJS::FunctionImp::addParameter):
82 (KJS::FunctionImp::parameterString):
83 (KJS::FunctionImp::processParameters):
84 (KJS::FunctionImp::lengthGetter):
85 (KJS::FunctionImp::getParameterName):
88 2006-09-27 Steve Falkenburg <sfalken@apple.com>
94 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
95 * JavaScriptCore.vcproj/JavaScriptCore/dstroot-to-sdk.cmd: Removed.
97 2006-09-27 John Sullivan <sullivan@apple.com>
100 (KJS::FunctionImp::getParameterName):
101 removed assertion that displeased gcc 4.0.1 (build 5420):
102 ASSERT(static_cast<size_t>(index) == index);
104 2006-09-27 Kevin McCullough <KMcCullough@apple.com>
108 Cleanup of previous fix which was to address Radar: 4752492
111 (KJS::FunctionImp::addParameter):
112 (KJS::FunctionImp::parameterString):
113 (KJS::FunctionImp::processParameters):
114 (KJS::FunctionImp::lengthGetter):
115 (KJS::FunctionImp::getParameterName):
118 2006-09-27 Kevin McCullough <KMcCullough@apple.com>
122 Fixes a GC stack overflow crash.
123 The change is to move from a linked list implementation of Parameters to a Vector.
124 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.
127 (KJS::Parameter::Parameter):
128 (KJS::FunctionImp::addParameter):
129 (KJS::FunctionImp::parameterString):
130 (KJS::FunctionImp::processParameters):
131 (KJS::FunctionImp::lengthGetter):
132 (KJS::FunctionImp::getParameterName):
135 2006-09-27 Steve Falkenburg <sfalken@apple.com>
139 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
141 2006-09-27 Steve Falkenburg <sfalken@apple.com>
143 Set path before build.
145 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
147 2006-09-27 Sean Gies <seangies@apple.com>
149 Reviewed by Adam Roben.
151 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Debug config should link to debug runtime.
152 * JavaScriptCore.vcproj/dftables/dftables.vcproj: Debug config should link to debug runtime.
154 2006-09-27 Don Melton <gramps@apple.com>
156 Reviewed by Adam Roben.
158 Changed line ending from DOS to UNIX format so it doesn't die running
161 * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
163 2006-09-23 Alexey Proskuryakov <ap@nypop.com>
167 http://bugs.webkit.org/show_bug.cgi?id=10183
168 REGRESSION: obfuscated JS decoding breaks because of soft hyphen removal
169 (Fanfiction.net author pages not listing stories)
171 Rolled out the fix for bug 4139.
176 * tests/mozilla/ecma/Array/15.4.5.1-1.js:
177 * tests/mozilla/expected.html:
179 2006-09-22 Steve Falkenburg <sfalken@apple.com>
183 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
185 2006-09-22 Darin Adler <darin@apple.com>
189 * wtf/Vector.h: Add an append that takes a pointer and length.
190 Generalize the existing Vector append to work on vectors with
191 any value for inlineCapacity. Change the append algorithm so
192 it doesn't check capacity each time through the loop.
194 2006-09-22 Steve Falkenburg <sfalken@apple.com>
198 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
200 2006-09-21 Geoffrey Garen <ggaren@apple.com>
204 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
205 Updated to include the right path.
206 * wtf/FastMalloc.h: #include Platform.h, since we use Platform macros.
208 === Safari-521.27 ===
210 2006-09-20 Anders Carlsson <acarlsson@apple.com>
212 Reviewed by Dave Hyatt.
217 2006-09-20 Sean Gies <seangies@apple.com>
219 Reviewed by Steve Falkenburg.
221 * wtf/Assertions.cpp: Debug messages should go into debugger console.
223 2006-09-20 David Hyatt <hyatt@apple.com>
225 Add an implementation of lrint for Win32.
232 2006-09-15 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
236 http://bugs.webkit.org/show_bug.cgi?id=10864
237 Bug 10864: Linux\GDK build fixes
239 * JavaScriptCoreSources.bkl:
242 2006-09-15 Adam Roben <aroben@apple.com>
246 * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
248 2006-09-15 Anders Carlsson <acarlsson@apple.com>
250 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
251 Fix the release build.
253 2006-09-15 Anders Carlsson <acarlsson@apple.com>
257 Add JavaScriptCore API to the build.
259 * API/JSCallbackConstructor.cpp:
260 * API/JSCallbackFunction.cpp:
261 * API/JSCallbackObject.cpp:
262 * API/JSClassRef.cpp:
263 * API/JSContextRef.cpp:
264 * API/JSObjectRef.cpp:
265 * API/JSStringRef.cpp:
266 * API/JSValueRef.cpp:
267 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
268 * os-win32/stdbool.h: Added.
270 2006-09-12 Steve Falkenburg <sfalken@apple.com>
274 Build tweaks (doing JavaScriptCore now since it doesn't have
277 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
278 * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
279 * JavaScriptCore.vcproj/JavaScriptCore/dstroot-to-sdk.cmd: Added.
280 * JavaScriptCore.vcproj/dftables/dftables.vcproj:
281 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
283 2006-09-11 Brady Eidson <beidson@apple.com>
285 Build fix - I think Tim's last checkin wasn't tested on Tiger, possibly. I simply
286 commented out the undefined constants until he can have a chance to make the right call
288 * bindings/objc/objc_utility.mm:
289 (KJS::Bindings::objcValueTypeForType): Commented out undefined symbols
291 2006-09-11 Timothy Hatcher <timothy@apple.com>
293 Reviewed by Tim O. and Darin.
295 Add support for more method signatures affecting ObjC methods called from JavaScript:
296 - Added unsigned types and long long.
297 - Allow methods that use const, oneway, bycopy and byref type modifiers.
299 * bindings/objc/objc_instance.mm:
300 (ObjcInstance::invokeMethod):
301 * bindings/objc/objc_utility.h:
303 * bindings/objc/objc_utility.mm:
304 (KJS::Bindings::convertValueToObjcValue):
305 (KJS::Bindings::convertObjcValueToValue):
306 (KJS::Bindings::objcValueTypeForType):
308 2006-09-05 Timothy Hatcher <timothy@apple.com>
312 <rdar://problem/4715840> SEL is not char*
314 * bindings/objc/objc_class.mm:
315 (KJS::Bindings::ObjcClass::methodsNamed): use sel_getName instead of a char* cast.
316 * bindings/objc/objc_runtime.mm:
317 (ObjcFallbackObjectImp::callAsFunction): ditto
319 2006-09-03 Alexey Proskuryakov <ap@nypop.com>
323 http://bugs.webkit.org/show_bug.cgi?id=10693
324 Convert JavaScript arrays to AppleScript lists
326 * JavaScriptCore.exp: Export ArrayInstance::info and ArrayInstance::getItem().
327 * kjs/array_instance.h:
328 * kjs/array_object.cpp:
329 (ArrayInstance::getItem): Added a method to access array items from C++.
331 2006-09-02 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
335 Bug 10454: Unix bakefile fixes
336 http://bugs.webkit.org/show_bug.cgi?id=10454
338 * JavaScriptCoreSources.bkl:
340 2006-09-01 Nikolas Zimmermann <zimmermann@kde.org>
342 Reviewed by hyatt. Landed by eseidel.
346 * pcre/CMakeLists.txt: Add wtf/ include.
348 2006-09-01 Nikolas Zimmermann <zimmermann@kde.org>
350 Reviewed and landed by ap.
352 Fix build on Linux (C89 without gcc extensions enabled).
354 * pcre/pcre_internal.h: Use C style comments.
355 * wtf/Assertions.h: Use C style comments.
356 * wtf/Platform.h: Use C style comments.
358 2006-09-01 Steve Falkenburg <sfalken@apple.com>
362 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
363 * JavaScriptCore.vcproj/dftables/dftables.vcproj:
365 2006-08-31 Anders Carlsson <acarlsson@apple.com>
369 Add new portability functions to MathExtras.h and add StringExtras.h which is for
370 string portability functions.
372 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
373 * bindings/c/c_instance.cpp:
374 * kjs/date_object.cpp:
378 * wtf/StringExtras.h: Added.
382 2006-08-31 Anders Carlsson <acarlsson@apple.com>
388 * JavaScriptCore.vcproj/dftables/dftables.vcproj:
389 * pcre/pcre_internal.h:
391 2006-08-31 Timothy Hatcher <timothy@apple.com>
395 Band-aid fix for PCRE to compile for ppc64 and x86_64 now that
396 we use -Wshorten-64-to-32. Adds an INT_CAST macro that ASSERTs
397 the value <= INT_MAX.
399 I filed <rdar://problem/4712064> to track the need to verify
400 PCRE's 64-bit compliance.
402 * pcre/pcre_compile.c:
411 (pcre_get_substring_list):
412 * pcre/pcre_internal.h:
413 * pcre/pcre_tables.c:
414 * pcre/pcre_try_flipped.c:
417 2006-08-30 Darin Adler <darin@apple.com>
419 Reviewed by Tim Hatcher.
421 - add WTF::getPtr, a function template that makes it possible to write
422 generic code that gets a raw pointer out of any of our pointer types
424 * JavaScriptCore.xcodeproj/project.pbxproj:
425 * wtf/GetPtr.h: Added.
426 * wtf/ListRefPtr.h: (WTF::getPtr): Added.
427 * wtf/OwnArrayPtr.h: (WTF::getPtr): Added.
428 * wtf/OwnPtr.h: (WTF::getPtr): Added.
429 * wtf/PassRefPtr.h: (WTF::getPtr): Added.
430 * wtf/RefPtr.h: (WTF::getPtr): Added.
432 2006-08-29 waylonis <waylonis@google.com>
434 Reviewed, tweaked by ggaren.
436 - Added storage and accessor functions for ExecState as a fix for
437 http://bugs.webkit.org/show_bug.cgi?id=10114
440 (KJS::ExecState::ExecState):
443 (KJS::Context::setExecState):
444 (KJS::Context::execState):
446 2006-08-30 Nikolas Zimmermann <zimmermann@kde.org>
450 Commit KDE related tweaks, to be able to
451 differentiate between a Qt-only or a KDE build.
453 * CMakeLists.txt: Install wtf-unity library.
454 * wtf/Platform.h: Add define for the KDE platform.
456 2006-08-28 Darin Adler <darin@apple.com>
460 * kjs/list.h: Use explicit in constructor (as appropriate).
462 2006-08-24 Nikolas Zimmermann <zimmermann@kde.org>
464 Reviewed, tweaked and landed by ap
466 http://bugs.webkit.org/show_bug.cgi?id=10467
467 WebKit should have Qt platform support (Part II)
469 * CMakeLists.txt: Adjust to Anders' build fixes.
470 * wtf/Platform.h: Fix define for the Qt platform (we don't use/need Cairo.)
472 2006-08-23 David Hyatt <hyatt@apple.com>
474 Fix Platform.h to include #defines for graphics features.
478 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
481 2006-08-23 Anders Carlsson <acarlsson@apple.com>
485 Make the bindings compile without CoreFoundation.
487 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
488 * bindings/c/c_instance.cpp:
489 * bindings/c/c_utility.cpp:
490 (KJS::Bindings::convertUTF8ToUTF16):
492 * bindings/runtime.cpp:
493 (KJS::Bindings::Instance::createBindingForLanguageInstance):
494 (KJS::Bindings::Instance::createLanguageInstanceForValue):
495 * bindings/runtime_root.cpp:
496 * bindings/runtime_root.h:
497 * kjs/interpreter.cpp:
498 (KJS::Interpreter::createLanguageInstanceForValue):
501 2006-08-22 Anders Carlsson <acarlsson@apple.com>
505 Move the npruntime code over to using HashMap and the runtime_root code over to using
506 HashMap and HashCountedSet.
508 * bindings/NP_jsobject.cpp:
509 * bindings/c/c_utility.cpp:
510 (KJS::Bindings::identifierFromNPIdentifier):
511 * bindings/c/c_utility.h:
512 * bindings/jni/jni_jsobject.cpp:
513 (JavaJSObject::invoke):
514 * bindings/npruntime.cpp:
515 (getStringIdentifierMap):
516 (getIntIdentifierMap):
517 (_NPN_GetStringIdentifier):
518 (_NPN_GetIntIdentifier):
519 * bindings/runtime_root.cpp:
520 (getReferencesByRootMap):
522 (KJS::Bindings::findReferenceSet):
523 (KJS::Bindings::rootForImp):
524 (KJS::Bindings::rootForInterpreter):
525 (KJS::Bindings::addNativeReference):
526 (KJS::Bindings::removeNativeReference):
527 (RootObject::removeAllNativeReferences):
528 * bindings/runtime_root.h:
530 2006-08-22 Anders Carlsson <acarlsson@apple.com>
534 Switch over the NPAPI and Java bindings to using HashMaps instead of dictionaries.
536 * JavaScriptCore.xcodeproj/project.pbxproj:
537 * bindings/c/c_class.cpp:
538 (KJS::Bindings::CClass::CClass):
539 (KJS::Bindings::CClass::~CClass):
540 (KJS::Bindings::CClass::classForIsA):
541 (KJS::Bindings::CClass::methodsNamed):
542 (KJS::Bindings::CClass::fieldNamed):
543 * bindings/c/c_class.h:
544 * bindings/jni/jni_class.cpp:
545 (JavaClass::JavaClass):
546 (JavaClass::~JavaClass):
547 (JavaClass::methodsNamed):
548 (JavaClass::fieldNamed):
549 * bindings/jni/jni_class.h:
550 * bindings/objc/objc_class.h:
551 * bindings/objc/objc_class.mm:
552 (KJS::Bindings::deleteMethod):
553 (KJS::Bindings::deleteField):
555 (KJS::Bindings::ObjcClass::methodsNamed):
556 (KJS::Bindings::ObjcClass::fieldNamed):
557 * bindings/runtime.cpp:
558 * bindings/runtime.h:
559 * bindings/runtime_object.cpp:
560 (RuntimeObjectImp::fieldGetter):
561 (RuntimeObjectImp::getOwnPropertySlot):
562 (RuntimeObjectImp::put):
563 (RuntimeObjectImp::canPut):
565 2006-08-21 Vladimir Olexa <vladimir.olexa@gmail.com>
569 http://bugs.webkit.org/show_bug.cgi?id=6252
570 JavaScript 1.6 Array.lastIndexOf
572 Test: fast/js/array-lastIndexOf.html
574 * kjs/array_object.cpp:
575 (ArrayProtoFunc::callAsFunction): Added a LastIndexOf case.
576 * kjs/array_object.h:
577 (KJS::ArrayProtoFunc::): Added LastIndexOf to enum.
578 * tests/mozilla/expected.html: Two more tests now pass.
580 2006-08-20 Nikolas Zimmermann <zimmermann@kde.org>
582 Reviewed by Maciej. Landed by rwlbuis.
584 Fixes parts of: http://bugs.webkit.org/show_bug.cgi?id=10463
585 WebKit should have Qt platform support
587 Removing obsolete QConstString/QString constructors in kjs code.
592 2006-08-17 Nikolas Zimmermann <zimmermann@kde.org>
594 Reviewed by Maciej. Landed by rwlbuis.
596 Fixes: http://bugs.webkit.org/show_bug.cgi?id=10463
597 WTF Changes needed for Qt platform code.
600 * wtf/unicode/UnicodeDecomposition.h: Added.
602 * wtf/unicode/UnicodeDirection.h: Added.
604 * wtf/unicode/qt4/UnicodeQt4.cpp: Added.
605 (WTF::Unicode::direction):
606 (WTF::Unicode::category):
607 (WTF::Unicode::decomposition):
608 * wtf/unicode/qt4/UnicodeQt4.h:
609 (WTF::Unicode::toLower):
610 (WTF::Unicode::toUpper):
611 (WTF::Unicode::isPrintableChar):
612 (WTF::Unicode::isSpace):
613 (WTF::Unicode::isPunct):
614 (WTF::Unicode::isDigit):
615 (WTF::Unicode::mirroredChar):
616 (WTF::Unicode::compare):
618 2006-08-17 Nikolas Zimmermann <zimmermann@kde.org>
620 Reviewed by Eric. Landed by rwlbuis.
622 Fixes: http://bugs.webkit.org/show_bug.cgi?id=10464
623 Offer a cmake build system for Qt platform.
625 * CMakeLists.txt: Added.
626 * pcre/CMakeLists.txt: Added.
628 2006-08-17 Anders Carlsson <acarlsson@apple.com>
635 2006-08-15 Steve Falkenburg <sfalken@apple.com>
641 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
644 2006-08-15 Mark Rowe <opendarwin.org@bdash.net.nz>
648 Build fix: DWARF and -gfull are incompatible with symbol separation.
650 * JavaScriptCore.xcodeproj/project.pbxproj:
652 2006-08-15 Mark Rowe <opendarwin.org@bdash.net.nz>
656 http://bugs.webkit.org/show_bug.cgi?id=10394
657 Bug 10394: WebKit Release and Production configurations should enable dead code stripping
659 * JavaScriptCore.xcodeproj/project.pbxproj:
661 2006-08-15 Mark Rowe <opendarwin.org@bdash.net.nz>
665 http://bugs.webkit.org/show_bug.cgi?id=10384
666 Bug 10384: Switch to DWARF for Release configuration
668 * JavaScriptCore.xcodeproj/project.pbxproj:
670 2006-08-13 Maks Orlovich <maksim@kde.org>
672 Reviewed (and tweaked a little) by Maciej.
674 - shrank the size of JSObject by 8 bytes and made the corresponding reduction to the cell size, resulting
675 in a 1.2% speed improvement on JS iBench (and probably overall memory savings).
677 This was done by removing _scope and _internalValue data members
678 from JSObject and moving them only to the subclasses that actually
682 (KJS::JSObject::mark): No need to mark scope or internal value here.
684 (KJS::JSObject::JSObject): Don't initialize them.
685 * kjs/JSWrapperObject.cpp: Added. New base class for object types that
686 wrap primitive values (Number, String, Boolean, Date).
687 (KJS::JSWrapperObject::mark):
688 * kjs/JSWrapperObject.h: Added.
689 (KJS::JSWrapperObject::JSWrapperObject):
690 (KJS::JSWrapperObject::internalValue):
691 (KJS::JSWrapperObject::setInternalValue):
692 * kjs/array_object.cpp:
693 (ArrayPrototype::ArrayPrototype): Don't set useless internal value.
694 * kjs/bool_object.cpp:
695 (BooleanInstance::BooleanInstance): Inherit from JSWrapperObject.
696 (BooleanProtoFunc::callAsFunction): Fixed to account for fact that not all
697 JSObjects have an internal value.
698 (BooleanObjectImp::construct): ditto.
700 * kjs/collector.cpp: Lowered cell size to 48.
701 (KJS::Collector::allocate): meaningless whitespace change
702 * kjs/date_object.cpp:
703 (KJS::DateInstance::DateInstance): Inherit from JSWrapperObject.
704 (KJS::DateProtoFunc::callAsFunction): adjusted for move of internalValue
705 (KJS::DateObjectImp::construct): ditto
707 * kjs/error_object.cpp:
708 (ErrorPrototype::ErrorPrototype): don't set internal value
709 * kjs/function.cpp: move _scope and related handling here
710 (KJS::FunctionImp::mark): mark scope
712 (KJS::FunctionImp::scope): moved here from JSObject
713 (KJS::FunctionImp::setScope): ditto
714 * kjs/number_object.cpp:
715 (NumberInstance::NumberInstance): inherit from JSWrapperObject
716 (NumberProtoFunc::callAsFunction): adjusted
717 (NumberObjectImp::construct): adjusted
718 * kjs/number_object.h: shring RegExp-related objects a little
719 * kjs/regexp_object.cpp:
720 (RegExpPrototype::RegExpPrototype): Adjust for size tweaks
721 (RegExpObjectImp::RegExpObjectImp): ditto
722 * kjs/regexp_object.h:
723 * kjs/string_object.cpp:
724 (StringInstance::StringInstance): inherit from JSWrapperObject
725 (StringProtoFunc::callAsFunction): adjusted
726 * kjs/string_object.h:
727 * JavaScriptCore.exp: Exported new methods as needed.
728 * JavaScriptCore.xcodeproj/project.pbxproj: Added new files to build.
730 2006-08-04 Brady Eidson <beidson@apple.com>
732 Reviewed by Geoff's rubber stamp
734 Fix a build break on Intel hardware causes by adapting stricter
735 compiler warnings (-Wshorten-64-to-32)
738 (assertEqualsAsNumber): manually cast some doubles to floats
741 2006-08-04 Sam Weinig <sam.weinig@gmail.com>
745 - patch for http://bugs.webkit.org/show_bug.cgi?id=10192
746 Make WebCore (and friends) compile with -Wshorten-64-to-32
748 * Adds -Wshorten-64-to-32 flag to Xcode project.
749 * Adds explicit casts where OK.
753 (JSNodeList_getProperty):
754 * JavaScriptCore.xcodeproj/project.pbxproj:
756 2006-08-04 Adam Roben <aroben@apple.com>
760 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Convert
763 2006-08-03 Sam Weinig <sam.weinig@gmail.com>
767 - patch for http://bugs.webkit.org/show_bug.cgi?id=10176
768 Make WebCore compile with -Wundef
770 * Adds -Wundef flag to Xcode project
771 * Converts #ifs to #ifdef and #ifndefs where needed.
772 * Added #define YYMAXDEPTH 10000 in kjs/grammar.y
773 to fix a warning from within Bison.
775 * JavaScriptCore.xcodeproj/project.pbxproj:
776 * bindings/jni/jni_jsobject.cpp:
777 (JavaJSObject::getSlot):
778 (JavaJSObject::setSlot):
780 * bindings/objc/objc_class.mm:
781 (KJS::Bindings::ObjcClass::methodsNamed):
782 (KJS::Bindings::ObjcClass::fieldNamed):
783 * bindings/objc/objc_instance.mm:
784 (ObjcInstance::invokeMethod):
785 * bindings/objc/objc_runtime.mm:
786 (ObjcMethod::getMethodSignature):
792 2006-08-03 Anders Carlsson <acarlsson@apple.com>
794 Reviewed by John Sullivan.
798 Return *this in operator=
800 2006-08-03 Adam Roben <aroben@apple.com>
804 - Fixed Windows build
806 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
807 * wtf/MathExtras.h: Implement inline versions of these functions
811 2006-08-02 Adam Roben <aroben@apple.com>
817 * kjs/date_object.cpp:
820 2006-07-29 Darin Adler <darin@apple.com>
822 - Removed tabs from these source files that still had them.
823 We don't use them; that way source files look fine in editors
824 that have tabs set to 8 spaces or to 4 spaces.
825 - Removed allow-tabs Subversion property from the files too.
827 * bindings/NP_jsobject.cpp:
828 * bindings/c/c_utility.cpp:
829 * bindings/jni/jni_runtime.cpp:
830 * bindings/jni/jni_utility.cpp:
831 * bindings/objc/objc_utility.mm:
832 * bindings/runtime.cpp:
833 * bindings/runtime_method.cpp:
834 * bindings/testbindings.cpp:
835 * bindings/testbindings.mm:
836 * kjs/date_object.cpp:
841 * kjs/string_object.cpp:
844 2006-07-29 Darin Adler <darin@apple.com>
846 * tests/mozilla/expected.html: Update test results now that regress-185165.js
847 is succeeding. I suspect Anders fix for bug 4620655 is the reason.
849 2006-07-29 Sam Weinig <sam.weinig@gmail.com>
853 - patch for http://bugs.webkit.org/show_bug.cgi?id=10080
854 Adopt pedantic changes from the Unity project to improve
855 cross-compiler compatibility
858 * Removing trailing semicolon from namespace braces.
859 * Removing trailing comma from last enum declaration.
860 * Updating to match style guidelines.
861 * Adding missing newline to the end of the file.
862 * Turning on gcc warning for missing newline at the end of a source file
863 (GCC_WARN_ABOUT_MISSING_NEWLINE in Xcode, -Wnewline in gcc).
864 * Alphabetical sorting of Xcode source list files.
865 * Replace use of non-portable variable-size array with Vector.
866 * Use C-style comments instead of C++ comments in files that might
867 be included by either C or C++ files.
869 * API/JSCallbackConstructor.cpp:
870 (KJS::JSCallbackConstructor::construct):
871 * API/JSCallbackFunction.cpp:
872 (KJS::JSCallbackFunction::callAsFunction):
873 * API/JSCallbackObject.cpp:
874 (KJS::JSCallbackObject::construct):
875 (KJS::JSCallbackObject::callAsFunction):
876 * JavaScriptCore.xcodeproj/project.pbxproj:
877 * JavaScriptCorePrefix.h:
878 * bindings/jni/jni_class.cpp:
879 (JavaClass::fieldNamed):
880 * bindings/jni/jni_class.h:
881 * bindings/jni/jni_instance.cpp:
882 (JavaInstance::JavaInstance):
883 (JavaInstance::valueOf):
884 * bindings/jni/jni_objc.mm:
885 (KJS::Bindings::dispatchJNICall):
886 * bindings/jni/jni_runtime.cpp:
887 (JavaParameter::JavaParameter):
888 (JavaArray::JavaArray):
889 * bindings/jni/jni_runtime.h:
890 * bindings/jni/jni_utility.h:
891 * bindings/objc/objc_instance.h:
892 * bindings/runtime_array.h:
898 2006-07-29 Mike Emmel <mike.emmel@gmail.com>
902 - fixes for Linux build
904 * JavaScriptCoreSources.bkl: Added new files to build, kjs/PropertyNameArray.cpp
905 and kjs/testkjs.cpp, and removed old files.
907 2006-07-24 Dan Waylonis <waylonis@google.com>
909 Reviewed and tweaked a bit by Darin.
911 - fix http://bugs.webkit.org/show_bug.cgi?id=9902
912 jsNull and NSNull not properly converted between JS and ObjC
914 * bindings/objc/objc_utility.mm: (KJS::Bindings::convertObjcValueToValue):
915 Added case for converting NSNull to jsNull.
917 2006-07-24 Rob Buis <buis@kde.org>
921 http://bugs.webkit.org/show_bug.cgi?id=4258
922 Date().toString() only includes GMT offset, not timezone string
924 Use the info in tm_zone to append timezone abbreviation
925 to Date().toString().
927 * kjs/date_object.cpp:
930 2006-07-24 Rob Buis <buis@kde.org>
934 http://bugs.webkit.org/show_bug.cgi?id=5257
935 setYear() does not match FireFox/IE behavior
937 Make sure the right values end up in tm_year.
939 * kjs/date_object.cpp:
942 2006-07-23 Mark Rowe <opendarwin.org@bdash.net.nz>
946 Bug 9686: [Drosera] Need the ability to break into Drosera on Javascript exceptions
947 http://bugs.webkit.org/show_bug.cgi?id=9686
949 JavaScriptCore portion of the fix.
951 * JavaScriptCore.exp: Update symbol for change in argument type.
953 (Debugger::detach): Clear map of recent exceptions.
954 (Debugger::hasHandledException): Track the most recent exception
955 thrown by an interpreter.
956 (Debugger::exception): Change exception argument to a JSValue.
959 (Node::debugExceptionIfNeeded): Notify the debugger of an exception
960 if it hasn't seen it before.
961 (ThrowNode::execute): Notify the debugger that an exception is being thrown.
964 2006-07-23 Geoffrey Garen <ggaren@apple.com>
966 Patch by Eric Albert, reviewed by Darin and me.
968 - Fixed <rdar://problem/4645931> JavaScriptCore stack-scanning code
969 crashes (Collector::markStackObjectsConservatively)
971 * bindings/jni/jni_jsobject.cpp: On 64bit systems, jint is a long, not an
973 (JavaJSObject::getSlot):
974 (JavaJSObject::setSlot):
976 (KJS::Collector::markCurrentThreadConservatively): Use a pointer instead of
977 an int as 'dummy,' because on LP64 systems, an int is not pointer-aligned,
978 and we want to scan the stack for pointers.
979 * JavaScriptCore.xcodeproj/project.pbxproj: After a tense cease-fire, the
980 XCode war has started up again!
982 === Safari-521.20 ===
984 2006-07-21 Geoffrey Garen <ggaren@apple.com>
988 <rdar://problem/4507265> REGRESSION: overlays don't work on HousingMaps.com (Google Maps-based site)
990 - Added support for strings that masquerade as undefined. Currently used
991 by WebCore to implement undetectable style.filter.
993 The name is a little long, but it's only used in one line of code, so I
994 thought clarity should win over brevity.
996 * JavaScriptCore.exp:
997 * JavaScriptCore.xcodeproj/project.pbxproj:
999 * kjs/string_object.h:
1000 (KJS::StringInstanceThatMasqueradesAsUndefined::StringInstanceThatMasqueradesAsUndefined):
1001 (KJS::StringInstanceThatMasqueradesAsUndefined::masqueradeAsUndefined):
1002 (KJS::StringInstanceThatMasqueradesAsUndefined::toBoolean):
1004 === Safari-521.19 ===
1006 2006-07-20 Steve Falkenburg <sfalken@apple.com>
1011 (KJS::escapeStringForPrettyPrinting):
1013 2006-07-19 Anders Carlsson <acarlsson@apple.com>
1017 <rdar://problem/4620655> REGRESSION(10.4.7-10.5): preview button for a blogger.com post doesn't work
1019 * kjs/nodes2string.cpp:
1020 (StringNode::streamTo):
1021 Return the escaped string.
1023 (RegExpNode::streamTo):
1024 Use the correct syntax.
1027 (KJS::escapeStringForPrettyPrinting):
1029 Add escape function which escapes a string for pretty-printing so it can be parsed again.
1031 * wtf/unicode/icu/UnicodeIcu.h:
1032 (WTF::Unicode::isPrintableChar):
1035 2006-07-18 Maciej Stachowiak <mjs@apple.com>
1037 Reviewed by Adele Peterson.
1039 <rdar://problem/4589530> REGRESSION: null character in JS string causes parse error (works in Tiger and in other browsers)
1045 (Lexer::scanRegExp):
1048 2006-07-18 Tim Omernick <timo@apple.com>
1050 Reviewed by Tim Hatcher.
1052 Removed a misleading comment; we recently added support for the NPNVPluginElementNPObject
1057 === Safari-521.18 ===
1059 2006-07-18 Timothy Hatcher <timothy@apple.com>
1061 Made the following headers public:
1070 * JavaScriptCore.xcodeproj/project.pbxproj:
1072 2006-07-17 Geoffrey Garen <ggaren@apple.com>
1076 - Added automatic prototype creation for classes.
1078 A class stores a weak reference to a prototype, which is cleared when
1079 the prototype is garbage collected, to avoid a reference cycle.
1081 We now have an attributes field in JSClassDefinition, that currently is
1082 used only to override automatic prototype creation when you want to manage your
1083 own prototypes, but can be extended in the future for other nefarious purposes.
1085 Similarly, we have JSObjectMake and JSObjectMakeWithPrototype, the latter
1086 allowing you to manage your own prototypes.
1088 JSObjectMakeConstructor is more interesting now, able to make a constructor
1089 on your behalf if you just give it a class.
1091 - Removed bogus old code from minidom.js.
1093 - Tweaked the headerdocs.
1095 - Added more GC testing, which caught some leaks, and tested more funny
1096 edge cases in lookup, which caught a lookup bug. Removed some testing
1097 we used to do with MyObject because it was redundant with the new, cool
1100 While fixing the lookup bug I retracted this change:
1102 "If a static setProperty callback returns 'false', to indicate that the
1103 property was not set, we no longer forward the set request up the class
1104 chain, because that's almost certainly not what the programmer expected."
1106 Returning false when setting a static property is a little silly, but you can see
1107 it being useful when shadowing a base class's static properties, and, regardless
1108 of usefullness, this is the defined behavior of the setProperty callback.
1110 - Plus a little ASCII art, for the kids.
1112 2006-07-17 Timothy Hatcher <timothy@apple.com>
1116 <rdar://problem/4634874> WebScriptObject and WebUndefined are no longer defined by WebKit
1118 Moves WebScriptObject and WebUndefined up to WebCore.
1119 This change does create an upwards-dependancy on WebScriptObject existing
1120 in the loaded process, but this code path in JavaScriptCore does not get used
1121 unless it is through WebKit/WebCore. Moving all of the binding code out of
1122 JavaScriptCore might make sense in the future.
1124 * JavaScriptCore.exp:
1125 * JavaScriptCore.xcodeproj/project.pbxproj:
1126 * bindings/objc/WebScriptObject.h: Replaced.
1127 * bindings/objc/WebScriptObject.mm: Removed.
1128 * bindings/objc/WebScriptObjectPrivate.h: Removed.
1129 * bindings/objc/objc_class.h:
1130 * bindings/objc/objc_instance.h:
1131 * bindings/objc/objc_instance.mm:
1132 (ObjcInstance::~ObjcInstance):
1133 * bindings/objc/objc_runtime.h:
1134 * bindings/objc/objc_runtime.mm:
1135 (convertValueToObjcObject):
1136 * bindings/objc/objc_utility.mm:
1137 (KJS::Bindings::convertValueToObjcValue):
1138 (KJS::Bindings::convertObjcValueToValue):
1139 (KJS::Bindings::createObjcInstanceForValue):
1141 2006-07-17 Darin Adler <darin@apple.com>
1143 * API/JSBase.h: Fix comment formatting where things used to be lined up but
1144 are now ragged. Got rid of spaces that attempted to line things up.
1145 * API/JSObjectRef.h: Ditto. Also add missing periods for a couple of comments.
1147 2006-07-17 Geoffrey Garen <ggaren@apple.com>
1151 - Removed the exception parameter from the initialize callback and, by extension,
1152 JSObjectMake. We have never had a need for exceptions when iniitializing,
1153 so the parameter seemed likely to "get in the way."
1155 Also, an exception in JavaScript is thrown in response to input --
1156 "invalid URL", "index not a number", etc., so it's the job of the
1157 constructor function, not the initialize method, to throw.
1159 If initialize *really* wants to throw, it can communicate the throw to
1160 the constructor through the constructed object's private data (e.g., set
1161 it to NULL, signaling to the consntructor that initialization failed.)
1163 - Added JSObjectMakeWithData, which enables a constructor to set private
1164 data on an object *before* it has been initialized. That way, the initialize
1165 methods can properly operate on the data.
1167 * API/JSNode.c: Moved ref into the initialize method, for better encapsulation,
1168 now that it's possible.
1169 * API/JSNodeList.c: ditto
1171 (main): Do more aggressive garbage collection to test ref/deref and
1172 initialize/finalize.
1173 * API/minidom.js: store childNodes in a temporary so it doesn't get re-created
1174 like a thousand times. This makes debugging ref/deref easier
1176 2006-07-17 Geoffrey Garen <ggaren@apple.com>
1180 - Changed the initialize callback to run from least derived class (parent
1181 class) to most derived class. This enables C++ style initialization,
1182 and derived class overriding of member data.
1184 - Added excpetion propopgation to JSObjectMake, to support initialize
1185 exceptions, and generally round out our policy of making function
1186 signatures as long as possible.
1188 * API/JSCallbackObject.h: Use ExecState instead of ContextRef, cuz we're
1191 2006-07-17 Geoffrey Garen <ggaren@apple.com>
1195 - Changed JSObjectMakeConstructor to JSObjectMakeConstructorWithCallback,
1196 to match JSObjectMakeFunctionWithCallback.
1198 - Added prototype parameter, so the generated constructor
1199 automatically works with hasInstance / instanceof
1201 - Moved hasInstance implementation from InternalFunctionImp to JSObject
1202 so that subclasses can inherit it without inheriting function-related baggage.
1203 More refactoring here would be good, but this seems like a good short-term
1206 (KJS::JSCallbackFunction::implementsHasInstance): override and return false,
1207 because callback functions aren't constructors.
1209 2006-07-17 Maciej Stachowiak <mjs@apple.com>
1213 - add a JSContextRef parameter to all JSValueRef, JSObjectRef, and JSContextRef operations;
1214 except JSObject{Get,Set}PrivateData which can be assumed to be simple pure accessors.
1216 Also renamed the parameter "context" to "ctx" because it makes the code read better with this pervasive
1217 but usually uninteresting parameter.
1221 (JSCheckScriptSyntax):
1224 * API/JSCallbackObject.cpp:
1225 (KJS::JSCallbackObject::JSCallbackObject):
1226 (KJS::JSCallbackObject::init):
1227 (KJS::JSCallbackObject::getOwnPropertySlot):
1228 (KJS::JSCallbackObject::put):
1229 (KJS::JSCallbackObject::deleteProperty):
1230 (KJS::JSCallbackObject::toNumber):
1231 (KJS::JSCallbackObject::toString):
1232 * API/JSContextRef.cpp:
1233 (JSGlobalContextCreate):
1234 (JSGlobalContextRetain):
1235 (JSGlobalContextRelease):
1236 (JSContextGetGlobalObject):
1237 * API/JSContextRef.h:
1239 (JSNodePrototype_appendChild):
1240 (JSNodePrototype_removeChild):
1241 (JSNodePrototype_replaceChild):
1242 (JSNode_getNodeType):
1243 (JSNode_getFirstChild):
1246 (JSNodeListPrototype_item):
1247 (JSNodeList_length):
1248 (JSNodeList_getProperty):
1249 (JSNodeList_prototype):
1250 * API/JSObjectRef.cpp:
1252 (JSObjectMakeFunctionWithCallback):
1253 (JSObjectMakeConstructor):
1254 (JSObjectMakeFunction):
1255 (JSObjectGetPrototype):
1256 (JSObjectSetPrototype):
1257 (JSObjectHasProperty):
1258 (JSObjectGetProperty):
1259 (JSObjectSetProperty):
1260 (JSObjectGetPropertyAtIndex):
1261 (JSObjectSetPropertyAtIndex):
1262 (JSObjectDeleteProperty):
1263 (JSObjectIsFunction):
1264 (JSObjectCallAsFunction):
1265 (JSObjectIsConstructor):
1266 (JSObjectCallAsConstructor):
1267 (JSObjectCopyPropertyNames):
1268 * API/JSObjectRef.h:
1269 * API/JSStringRef.cpp:
1270 * API/JSValueRef.cpp:
1272 (JSValueIsUndefined):
1278 (JSValueIsObjectOfClass):
1280 (JSValueIsStrictEqual):
1281 (JSValueIsInstanceOfConstructor):
1282 (JSValueMakeUndefined):
1284 (JSValueMakeBoolean):
1285 (JSValueMakeNumber):
1286 (JSValueMakeString):
1289 (JSValueToStringCopy):
1297 (MyObject_getProperty):
1298 (MyObject_deleteProperty):
1299 (MyObject_callAsFunction):
1300 (MyObject_callAsConstructor):
1301 (MyObject_convertToType):
1302 (print_callAsFunction):
1305 2006-07-16 Geoffrey Garen <ggaren@apple.com>
1307 Approved by Maciej, RS by Beth.
1309 JSObjectMakeFunction -> JSObjectMakeFunctionWithCallback
1310 JSObjectMakeFunctionWithBody -> JSObjectMakeFunction
1312 because the latter is more common, and more fundamental, than the former.
1317 * API/JSCallbackObject.cpp:
1318 (KJS::JSCallbackObject::getOwnPropertySlot):
1319 (KJS::JSCallbackObject::put):
1320 (KJS::JSCallbackObject::deleteProperty):
1321 (KJS::JSCallbackObject::getPropertyNames):
1322 (KJS::JSCallbackObject::staticValueGetter):
1323 (KJS::JSCallbackObject::staticFunctionGetter):
1324 * API/JSClassRef.cpp:
1325 (OpaqueJSClass::OpaqueJSClass):
1326 (OpaqueJSClass::~OpaqueJSClass):
1328 * API/JSObjectRef.cpp:
1330 (JSObjectMakeFunctionWithCallback):
1331 (JSObjectMakeFunction):
1332 (OpaqueJSPropertyNameArray::OpaqueJSPropertyNameArray):
1333 (JSObjectCopyPropertyNames):
1334 * API/JSObjectRef.h:
1340 * JavaScriptCore.exp:
1342 2006-07-16 Geoffrey Garen <ggaren@apple.com>
1346 Replace __JS with OpaqueJS because the former, while used by CF, is
1347 a prefix that's triply-reserved by the compiler. (_* is reserved in global
1348 names, _[A-Z] is reserved in all names, and __ is reserved in all names
1351 Opaque is an alternative used by other Mac OS X framewokrs.
1356 * API/JSCallbackObject.cpp:
1357 (KJS::JSCallbackObject::getOwnPropertySlot):
1358 (KJS::JSCallbackObject::put):
1359 (KJS::JSCallbackObject::deleteProperty):
1360 (KJS::JSCallbackObject::getPropertyNames):
1361 (KJS::JSCallbackObject::staticValueGetter):
1362 (KJS::JSCallbackObject::staticFunctionGetter):
1363 * API/JSClassRef.cpp:
1364 (OpaqueJSClass::OpaqueJSClass):
1365 (OpaqueJSClass::~OpaqueJSClass):
1367 * API/JSObjectRef.cpp:
1369 (OpaqueJSPropertyNameArray::OpaqueJSPropertyNameArray):
1370 (JSObjectCopyPropertyNames):
1372 2006-07-16 Darin Adler <darin@apple.com>
1374 - try to fix Windows build
1376 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1377 Added some recently added files, removed some recently removed.
1379 2006-07-16 Geoffrey Garen <ggaren@apple.com>
1383 - Change getProperty* to return undefined, rather than NULL, for missing
1384 properties, since that's what the spec says. Also added exception out
1385 parameters to the *Index functions, because they can call through to the
1386 regular functions, which can throw for custom objects.
1388 * API/JSObjectRef.cpp:
1389 (JSObjectGetProperty):
1390 (JSObjectGetPropertyAtIndex):
1391 (JSObjectSetPropertyAtIndex):
1392 * API/JSObjectRef.h:
1396 2006-07-16 Geoffrey Garen <ggaren@apple.com>
1400 - Properly document and handle NULL callbacks for static properties. We
1401 throw an exception in any case other than a ReadOnly property with a NULL
1402 setProperty callback, because a NULL callback almost certainly indicates
1403 a programming error. Also throw an exception if hasProperty returns true
1404 for a property that getProperty can't get.
1406 - If a static setProperty callback returns 'false', to indicate that the
1407 property was not set, we no longer forward the set request up the class
1408 chain, because that's almost certainly not what the programmer expected.
1410 * API/JSCallbackObject.cpp:
1411 (KJS::JSCallbackObject::getOwnPropertySlot):
1412 (KJS::JSCallbackObject::put):
1413 (KJS::JSCallbackObject::staticValueGetter):
1414 (KJS::JSCallbackObject::staticFunctionGetter):
1415 (KJS::JSCallbackObject::callbackGetter):
1416 * API/JSObjectRef.h:
1419 (MyObject_hasProperty):
1422 2006-07-16 Geoffrey Garen <ggaren@apple.com>
1426 - Added names to functions.
1428 - Removed GetPrivate/SetPrivate from callbackFunctions and callbackConstructors.
1429 The private data idiom is that a JS object stores its native implementation
1430 as private data. For functions and constructors, the native implementation is nothing
1431 more than the callback they already store, so supporting private data, too,
1432 confuses the idiom. If you *really* want, you can still create a custom
1433 function with private data.
1435 * API/JSCallbackConstructor.cpp:
1436 * API/JSCallbackConstructor.h:
1437 * API/JSCallbackFunction.cpp:
1438 (KJS::JSCallbackFunction::JSCallbackFunction):
1439 * API/JSCallbackFunction.h:
1440 * API/JSCallbackObject.cpp:
1441 (KJS::JSCallbackObject::staticFunctionGetter):
1442 * API/JSObjectRef.cpp:
1443 (JSObjectMakeFunction):
1444 (JSObjectMakeFunctionWithBody):
1445 (JSObjectGetPrivate):
1446 (JSObjectSetPrivate):
1447 * API/JSObjectRef.h:
1453 2006-07-15 Maciej Stachowiak <mjs@apple.com>
1457 - switch property lists to be vector+set of Identifiers instead of list of References
1459 This has the following benefits:
1461 - no duplicates in property lists
1462 - simplifies API calls
1463 - probably more efficient, since linked list is gone
1464 - entirely removed Reference, ReferenceList and ProtectedReference types from the API
1466 * kjs/PropertyNameArray.cpp: Added.
1467 (KJS::PropertyNameArray::add): Check set, if not already there, add to
1469 * kjs/PropertyNameArray.h: Added.
1470 (KJS::PropertyNameArray::PropertyNameArray): Newly added type, combines
1471 a set and a vector to make a unique but ordered list of identifiers.
1472 (KJS::PropertyNameArray::begin): ditto
1473 (KJS::PropertyNameArray::end): ditto
1474 (KJS::PropertyNameArray::size): ditto
1475 (KJS::PropertyNameArray::operator[]): ditto
1476 * kjs/array_instance.h:
1477 * kjs/array_object.cpp:
1478 (ArrayInstance::getPropertyNames): renamed from getPropertyList, updated
1479 for PropertyNameArray
1480 (ArrayInstance::setLength): updated for PropertyNameArray
1481 (ArrayInstance::pushUndefinedObjectsToEnd): ditto
1483 (ForInNode::execute): updated for PropertyNameArray
1486 (KJS::JSObject::getPropertyNames): renamed from getPropertyList, updated
1487 for PropertyNameArray
1489 * kjs/property_map.cpp:
1490 (KJS::PropertyMap::getEnumerablePropertyNames): updated for PropertyNameArray
1491 (KJS::PropertyMap::getSparseArrayPropertyNames): ditto
1492 * kjs/property_map.h:
1493 * kjs/protected_reference.h: Removed.
1494 * kjs/reference.cpp: Removed.
1495 * kjs/reference.h: Removed.
1496 * kjs/reference_list.cpp: Removed.
1497 * kjs/reference_list.h: Removed.
1498 * kjs/scope_chain.cpp:
1499 (KJS::ScopeChain::print): Use PropertyNamesArray instead of ReferenceList.
1500 * kjs/string_object.cpp:
1501 (StringInstance::getPropertyNames): Updated for new approach.
1502 * kjs/string_object.h:
1505 (toJS): Added overload for PropertyNameAccumulatorRef / PropertyNameArray*
1508 * API/JSCallbackObject.cpp:
1509 (KJS::JSCallbackObject::getPropertyNames): Fixed for new API.
1510 * API/JSCallbackObject.h:
1511 * API/JSObjectRef.cpp:
1512 (__JSPropertyNameArray::__JSPropertyNameArray): Type used for a publicly vended
1513 JSPropertyNameArrayRef.
1514 (JSObjectCopyPropertyNames): New API call - renamed / refactored from
1515 JSObjectCreatePropertyList
1516 (JSPropertyNameArrayRetain): new retain call for JSPropertyNameArray.
1517 (JSPropertyNameArrayRelease): new release call for - " -.
1518 (JSPropertyNameArrayGetCount): Instead of having to use a stateful enumerator you
1519 can now get the count and items in any order.
1520 (JSPropertyNameArrayGetNameAtIndex): See above.
1521 (JSPropertyNameAccumulatorAddName): What you add properties to is now an opaque
1523 * API/JSObjectRef.h: Prototyped new functions, removed old ones
1524 * JavaScriptCore.exp: Updated exported symbols.
1525 * JavaScriptCore.xcodeproj/project.pbxproj: Added new files, removed old.
1527 (MyObject_getPropertyNames): Renamed / fixed callback to fit new paradigm.
1528 (main): Updated for new API.
1530 2006-07-15 Darin Adler <darin@apple.com>
1532 - oops, missed a few more arrays that had to be const
1535 (JSNodePrototype_appendChild): Added const.
1536 (JSNodePrototype_removeChild): Ditto.
1537 (JSNodePrototype_replaceChild): Ditto.
1538 (JSNode_construct): Ditto.
1540 (JSNodeListPrototype_item): Ditto.
1541 * API/JSObjectRef.cpp:
1542 (JSObjectMakeFunctionWithBody): Ditto.
1543 (JSObjectCallAsFunction): Ditto.
1544 (JSObjectCallAsConstructor): Ditto.
1548 (MyObject_callAsFunction): Ditto.
1549 (MyObject_callAsConstructor): Ditto.
1550 (print_callAsFunction): Ditto.
1551 (myConstructor_callAsConstructor): Ditto.
1553 2006-07-15 Darin Adler <darin@apple.com>
1557 * API/JSNode.h: Made an array parameter const.
1558 * API/JSObjectRef.h: Made array parameters const. Fixed a comment.
1560 2006-07-15 Geoffrey Garen <ggaren@apple.com>
1564 - JSObjectMakeFunctionWithBody includes a function name and named parameters now.
1566 * API/JSObjectRef.cpp:
1567 (JSObjectMakeFunctionWithBody):
1568 * API/JSObjectRef.h:
1570 (assertEqualsAsUTF8String): More informative failure reporting.
1571 (main): Test more function cases.
1573 2006-07-15 Geoffrey Garen <ggaren@apple.com>
1577 - Moved the arguments passed to JSClassCreate into a single structure,
1578 called JSClassDefinition. This will enable easier structure
1579 migration/versioning in the future, if necessary.
1581 - Added support for class names.
1583 - kJSClassDefinitionNull replaces kJSObjectCallbacksNone.
1585 - JSClass is becoming a fairly complex struct, so I migrated all of its
1586 implementation other than reference counting to the sruct.
1588 - Also moved JSClass* functions in the API to JSObjectRef.cpp, since they're
1589 declared in JSObjectRef.h
1591 - Also added some more informative explanation to the class structure doc.
1593 2006-07-15 Darin Adler <darin@apple.com>
1597 - fix http://bugs.webkit.org/show_bug.cgi?id=8395
1598 <rdar://problem/4613467>
1599 REGRESSION: RegEx seems broken for hex escaped non breaking space
1601 Test: fast/js/regexp-extended-characters-more.html
1604 (match): Got rid of utf16Length local variable to guarantee there's no
1605 extra stack usage in recursive calls. Fixed two places in the PCRE_UTF16
1606 code that were using the length variable, which is the UTF-8 length of
1607 a character in the pattern, to move in the UTF-16 subject string. Instead
1608 they hardcode lengths of 1 and 2 since the code already handles BMP
1609 characters and surrogate pairs separately. Also fixed some DPRINTF so
1610 I could compile with DEBUG on.
1611 (pcre_exec): Changed a place that was checking for multibyte characters
1612 in the subject string to use ISMIDCHAR. Instead it was using hardcoded
1613 logic that was right for UTF-8 but wrong for UTF-16.
1615 * pcre/pcre_compile.c: (pcre_compile2): Fixed a DPRINTF so I could compile
1618 2006-07-14 Geoffrey Garen <ggaren@apple.com>
1622 Global replace in the API of argc/argv with argumentCount/arguments.
1624 2006-07-14 Geoffrey Garen <ggaren@apple.com>
1628 - Finalized exception handling in the API.
1630 setProperty can throw because it throws for built-in arrays. getProperty
1631 and deleteProperty can throw because setProperty can throw and we want
1632 to be consistent, and also because they seem like "actions." callAsFunction,
1633 callAsConstructor, and hasInstance can throw, because they caan throw for
1636 toBoolean can't throw because it's defined that way in the spec.
1638 - Documented that toBoolean and toObject can't be overridden by custom
1639 objects because they're defined that way in the spec.
1641 === Safari-521.17 ===
1643 2006-07-14 Geoffrey Garen <ggaren@apple.com>
1647 - Implemented ref-counting of JSContexts by splitting into two datatypes:
1648 JSGlobalContext, which you can create/retain/release, and JSContext, which
1651 Internally, you retain a JSGlobalContext/ExecState by retaining its
1652 interpreter, which, in the case of a global ExecState, owns it.
1654 - Also made ~Interpreter() protected to catch places where Interpreter
1655 is manually deleted. (Can't make it private because some crazy fool
1656 decided it would be a good idea to subclass Interpreter in other frameworks.
1660 (toJS): Added cast for new JSGlobalContext
1661 * API/JSStringRef.h: Changed vague "you must" language to more specific
1662 (but, ultimately, equally vague) "behavior is undefined if you don't"
1664 (KJS::Interpreter::Interpreter): Factored more common initialization into
1666 * kjs/interpreter.h:
1667 (KJS::Interpreter::ref): new
1668 (KJS::Interpreter::deref): new
1669 (KJS::Interpreter::refCount): new
1671 (doIt): Ref-count the interpreter.
1673 2006-07-14 Maciej Stachowiak <mjs@apple.com>
1677 - removed bool return value from JSObjectSetProperty, since it is inefficient and
1678 also doesn't work quite right
1679 - added JSObjectGetPropertyAtIndex and JSObjectSetPropertyAtIndex
1681 * API/JSObjectRef.cpp:
1682 (JSObjectSetProperty): Removed return value and canPut stuff.
1683 (JSObjectGetPropertyAtIndex): Added.
1684 (JSObjectSetPropertyAtIndex): Added.
1685 * API/JSObjectRef.h: Prototyped and documented new functions.
1687 2006-07-14 Geoffrey Garen <ggaren@apple.com>
1691 Moved JSCheckScriptSyntax, JSEvaluateScript, and JSGarbageCollect into
1692 JSBase.h/.cpp. They don't belong in the value-specific or context-specific
1693 files because they're not part of the value or context implementations.
1696 * API/JSContextRef.cpp:
1697 (JSContextGetGlobalObject):
1698 * API/JSContextRef.h:
1699 * API/JSValueRef.cpp:
1702 * JavaScriptCore.xcodeproj/project.pbxproj:
1704 2006-07-13 Timothy Hatcher <timothy@apple.com>
1708 Moved JavaScriptCore to be a public framework.
1710 * JavaScriptCore.xcodeproj/project.pbxproj:
1712 2006-07-13 Mark Rowe <opendarwin.org@bdash.net.nz>
1714 Reviewed by Geoffrey.
1716 http://bugs.webkit.org/show_bug.cgi?id=9742
1717 Bug 9742: REGRESSION: WebKit hangs when loading <http://www.vtbook.com>
1720 (KJS::JSValue::getUInt32): Only types tagged as numeric can be converted to UInt32.
1722 2006-07-13 Geoffrey Garen <ggaren@apple.com>
1726 - Renamed JSEvaluate -> JSEvaluateScript, JSCheckSyntax -> JSCheckScriptSyntax
1727 - Added exception out parameters to JSValueTo* and JSValueIsEqual because
1729 - Removed JSObjectGetDescription because it's useless and vague, and
1730 JSValueToString/JSValueIsObjectOfClass do a better job, anyway
1731 - Clarified comments about "IsFunction/Constructor" to indicate that they
1732 are true of all functions/constructors, not just those created by JSObjectMake*
1734 2006-07-12 Geoffrey Garen <ggaren@apple.com>
1738 Finished previously approved JSInternalString -> JSString conversion
1739 by renaming the files.
1741 * API/JSCallbackObject.cpp:
1742 * API/JSInternalStringRef.cpp: Removed.
1743 * API/JSInternalStringRef.h: Removed.
1744 * API/JSStringRef.cpp: Added.
1745 * API/JSStringRef.h: Added.
1746 * API/JavaScriptCore.h:
1747 * JavaScriptCore.xcodeproj/project.pbxproj:
1749 2006-07-12 Geoffrey Garen <ggaren@apple.com>
1753 - Removed context and exception parameters from JSObjectGetPropertyEnumerator,
1754 removing the spurious use of ExecState inside JavaScriptCore that made
1755 us think this was necessary in the first place.
1757 (StringInstance::getPropertyList): Use getString instead of toString because
1758 we know we're dealing with a string -- we put it there in the first place.
1759 While we're at it, store the string's size instead of retrieving it each time
1760 through the loop, to avoid the unnecessary killing of puppies.
1761 * kjs/string_object.h:
1763 2006-07-12 Maciej Stachowiak <mjs@apple.com>
1767 - add handling of hasInstance callback for API objects
1769 * API/JSCallbackObject.cpp:
1770 (KJS::JSCallbackObject::implementsHasInstance): Check if callback is present.
1771 (KJS::JSCallbackObject::hasInstance): Invoke appropriate callback.
1772 * API/JSCallbackObject.h:
1773 * API/JSClassRef.cpp:
1774 * API/JSObjectRef.h:
1776 (MyObject_hasInstance): Test case; should match what construct would do.
1779 2006-07-11 Geoffrey Garen <ggaren@apple.com>
1783 - Implemented a vast number of renames and comment clarifications
1784 suggested during API review.
1786 JSInternalString -> JSString
1787 JS*Make -> JSValueMake*, JSObjectMake*
1788 JSTypeCode -> JSType
1789 JSValueIsInstanceOf -> JSValueIsInstanceOfConstructor (reads strangely well in client code)
1790 JSGC*Protect -> JSValue*Protect
1791 JS*Callback -> JSObject*Callback
1792 JSGetPropertyListCallback -> JSObjectAddPropertiesToListCallback
1793 JSPropertyEnumeratorGetNext -> JSPropertyEnumeratorGetNextName
1795 JSStringCreateWithUTF8CString, JSStringGetUTF8CString,
1796 JSStringGetMaximumUTF8CStringSize JSStringIsEqualToUTF8CString,
1797 JSStringCreateWithCFString, JSStringCopyCFString, JSStringCreateWithCharacters.
1799 - Changed functions taking a JSValue out arg and returning a bool indicating
1800 whether it was set to simply return a JSValue or NULL.
1802 - Removed JSStringGetCharacters because it's more documentation than code,
1803 and it's just a glorified memcpy built on existing API functionality.
1805 - Moved standard library includes into the headers that actually require them.
1807 - Standardized use of the phrase "Create Rule."
1809 - Removed JSLock from make functions that don't allocate.
1811 - Added exception handling to JSValueToBoolean, since we now allow
1812 callback objects to throw exceptions upon converting to boolean.
1814 - Renamed JSGCCollect to JSGarbageCollect.
1816 2006-07-10 Geoffrey Garen <ggaren@apple.com>
1820 - Changed public header includes to the <JavaScriptCore/ style.
1821 - Changed instances of 'buffer' to 'string' since we decided on
1822 JSInternalString instead of JSStringBuffer.
1824 * API/JSContextRef.h:
1825 * API/JSInternalStringRef.cpp:
1827 (JSInternalStringRetain):
1828 (JSInternalStringRelease):
1829 (JSValueCopyStringValue):
1830 (JSInternalStringGetLength):
1831 (JSInternalStringGetCharactersPtr):
1832 (JSInternalStringGetCharacters):
1833 (JSInternalStringGetMaxLengthUTF8):
1834 (JSInternalStringGetCharactersUTF8):
1835 (CFStringCreateWithJSInternalString):
1836 * API/JSInternalStringRef.h:
1838 (JSNodePrototype_appendChild):
1839 (JSNode_getNodeType):
1840 * API/JSObjectRef.cpp:
1841 (JSObjectCallAsConstructor):
1843 * API/JavaScriptCore.h:
1848 (MyObject_getPropertyList):
1849 (myConstructor_callAsConstructor):
1850 (main): I noticed that we were prematurely releasing some string buffers,
1851 so I moved their release calls to the end of main(). I got rid of 'Buf' in *Buf
1852 (sometimes changing to 'IString', when necessary to differentiate a variable)
1853 to match the buffer->string change.
1855 === Safari-521.16 ===
1857 2006-07-10 Darin Adler <darin@apple.com>
1859 * kjs/value.cpp: (KJS::JSValue::toInt32Inline): Added inline keyword one more place.
1862 2006-07-10 Darin Adler <darin@apple.com>
1864 - fix the release build
1868 (KJS::JSValue::toInt32Inline): Move the code here to an inline.
1869 (KJS::JSValue::toInt32): Call the inline from both overloaded toInt32 functions.
1871 2006-07-10 David Kilzer <ddkilzer@kilzer.net>
1875 - fix http://bugs.webkit.org/show_bug.cgi?id=9179
1876 Implement select.options.add() method
1878 * JavaScriptCore.exp: Added overloaded KJS::JSValue::toInt32() method.
1879 * JavaScriptCore.xcodeproj/project.pbxproj: Altered attributes metadata for
1880 kjs/value.h to make it available as a forwarded header.
1882 (KJS::lookupPut): Extracted a lookupPut() method from the existing lookupPut() method.
1883 The new method returns a boolean value if no entry is found in the lookup table.
1885 (KJS::JSValue::toInt32): Overloaded toInt32() method with boolean "Ok" argument.
1886 * kjs/value.h: Ditto.
1888 2006-07-10 Geoffrey Garen <ggaren@apple.com>
1890 No review necessary. Removed bogus file I accidentally checked in before.
1892 * API/JSInternalSringRef.h: Removed.
1894 2006-07-10 Geoffrey Garen <ggaren@apple.com>
1898 Added exception out parameter to API object callbacks, removed semi-bogus
1899 JSContext(.*)Exception functions.
1901 To make these calls syntactically simple, I added an exceptionSlot()
1902 method to the ExecState class, which provides a JSValue** slot in which to
1903 store a JSValue* exception.
1907 * API/JSCallbackConstructor.cpp:
1908 (KJS::JSCallbackConstructor::construct):
1909 * API/JSCallbackFunction.cpp:
1910 (KJS::JSCallbackFunction::callAsFunction):
1911 * API/JSCallbackObject.cpp:
1912 (KJS::JSCallbackObject::init):
1913 (KJS::JSCallbackObject::getOwnPropertySlot):
1914 (KJS::JSCallbackObject::put):
1915 (KJS::JSCallbackObject::deleteProperty):
1916 (KJS::JSCallbackObject::construct):
1917 (KJS::JSCallbackObject::callAsFunction):
1918 (KJS::JSCallbackObject::getPropertyList):
1919 (KJS::JSCallbackObject::toBoolean):
1920 (KJS::JSCallbackObject::toNumber):
1921 (KJS::JSCallbackObject::toString):
1922 (KJS::JSCallbackObject::staticValueGetter):
1923 (KJS::JSCallbackObject::callbackGetter):
1924 * API/JSContextRef.cpp:
1926 * API/JSContextRef.h:
1928 (JSNodePrototype_appendChild):
1929 (JSNodePrototype_removeChild):
1930 (JSNodePrototype_replaceChild):
1931 (JSNode_getNodeType):
1932 (JSNode_getChildNodes):
1933 (JSNode_getFirstChild):
1937 (JSNodeListPrototype_item):
1938 (JSNodeList_length):
1939 (JSNodeList_getProperty):
1940 * API/JSObjectRef.h:
1944 (MyObject_initialize):
1945 (MyObject_hasProperty):
1946 (MyObject_getProperty):
1947 (MyObject_setProperty):
1948 (MyObject_deleteProperty):
1949 (MyObject_getPropertyList):
1950 (MyObject_callAsFunction):
1951 (MyObject_callAsConstructor):
1952 (MyObject_convertToType):
1953 (print_callAsFunction):
1954 (myConstructor_callAsConstructor):
1956 * JavaScriptCore.exp:
1958 (KJS::ExecState::exceptionHandle):
1960 2006-07-10 Geoffrey Garen <ggaren@apple.com>
1964 Improved type safety by implementing opaque JSValue/JSObject typing through
1965 abuse of 'const', not void*. Also fixed an alarming number of bugs
1966 exposed by this new type safety.
1968 I made one design change in JavaScriptCore, which is that the JSObject
1969 constructor should take a JSValue* as its prototype argument, not a JSObject*,
1970 since we allow the prototype to be any JSValue*, including jsNull(), for
1976 * API/JSCallbackConstructor.cpp:
1977 (KJS::JSCallbackConstructor::construct):
1978 * API/JSCallbackFunction.cpp:
1979 (KJS::JSCallbackFunction::callAsFunction):
1980 * API/JSCallbackObject.cpp:
1981 (KJS::JSCallbackObject::JSCallbackObject):
1982 (KJS::JSCallbackObject::getOwnPropertySlot):
1983 (KJS::JSCallbackObject::put):
1984 (KJS::JSCallbackObject::construct):
1985 (KJS::JSCallbackObject::callAsFunction):
1986 (KJS::JSCallbackObject::staticFunctionGetter):
1987 * API/JSCallbackObject.h:
1988 * API/JSContextRef.cpp:
1991 (JSNodePrototype_appendChild):
1992 (JSNodePrototype_removeChild):
1993 (JSNodePrototype_replaceChild):
1994 * API/JSObjectRef.cpp:
1996 (JSFunctionMakeWithBody):
1997 (JSObjectGetProperty):
1998 (JSObjectCallAsFunction):
1999 (JSObjectCallAsConstructor):
2000 * API/JSObjectRef.h:
2005 (KJS::JSObject::JSObject):
2007 2006-07-10 Geoffrey Garen <ggaren@apple.com>
2009 Approved by Maciej, Darin.
2011 Renamed JSStringBufferRef to JSInternalStringRef. "Internal string" means the
2012 JavaScript engine's internal string representation, which is the most
2013 low-level and efficient representation to use when interfacing with JavaScript.
2019 * API/JSCallbackObject.cpp:
2020 (KJS::JSCallbackObject::getOwnPropertySlot):
2021 (KJS::JSCallbackObject::put):
2022 (KJS::JSCallbackObject::deleteProperty):
2023 (KJS::JSCallbackObject::staticValueGetter):
2024 (KJS::JSCallbackObject::callbackGetter):
2025 * API/JSContextRef.cpp:
2028 * API/JSContextRef.h:
2029 * API/JSInternalStringRef.cpp: Added.
2031 (JSInternalStringCreate):
2032 (JSInternalStringCreateUTF8):
2033 (JSInternalStringRetain):
2034 (JSInternalStringRelease):
2035 (JSValueCopyStringValue):
2036 (JSInternalStringGetLength):
2037 (JSInternalStringGetCharactersPtr):
2038 (JSInternalStringGetCharacters):
2039 (JSInternalStringGetMaxLengthUTF8):
2040 (JSInternalStringGetCharactersUTF8):
2041 (JSInternalStringIsEqual):
2042 (JSInternalStringIsEqualUTF8):
2043 (JSInternalStringCreateCF):
2044 (CFStringCreateWithJSInternalString):
2045 * API/JSInternalStringRef.h: Added.
2047 (JSNodePrototype_appendChild):
2048 (JSNode_getNodeType):
2049 (JSNode_getChildNodes):
2050 (JSNode_getFirstChild):
2052 (JSNodeList_length):
2053 (JSNodeList_getProperty):
2054 * API/JSObjectRef.cpp:
2055 (JSFunctionMakeWithBody):
2056 (JSObjectGetDescription):
2057 (JSObjectHasProperty):
2058 (JSObjectGetProperty):
2059 (JSObjectSetProperty):
2060 (JSObjectDeleteProperty):
2061 (JSPropertyEnumeratorGetNext):
2062 (JSPropertyListAdd):
2063 * API/JSObjectRef.h:
2064 * API/JSStringBufferRef.cpp: Removed.
2065 * API/JSStringBufferRef.h: Removed.
2067 * API/JavaScriptCore.h:
2072 (assertEqualsAsUTF8String):
2073 (assertEqualsAsCharactersPtr):
2074 (assertEqualsAsCharacters):
2075 (MyObject_hasProperty):
2076 (MyObject_getProperty):
2077 (MyObject_setProperty):
2078 (MyObject_deleteProperty):
2079 (MyObject_getPropertyList):
2080 (print_callAsFunction):
2081 (myConstructor_callAsConstructor):
2083 * JavaScriptCore.exp:
2084 * JavaScriptCore.xcodeproj/project.pbxproj:
2086 2006-07-08 Tim Omernick <timo@apple.com>
2090 Added an OpenGL drawing model to the Netscape Plug-in API.
2094 2006-07-08 Timothy Hatcher <timothy@apple.com>
2098 Moved KJS_GetCreatedJavaVMs to jni_utility.cpp.
2099 Switched KJS_GetCreatedJavaVMs over to use dlopen and dlsym
2100 now that NSAddImage, NSLookupSymbolInImage and NSAddressOfSymbol
2101 are deprecated in Leopard.
2103 * JavaScriptCore.exp:
2104 * JavaScriptCore.xcodeproj/project.pbxproj:
2105 * bindings/jni/jni_utility.cpp:
2106 (KJS::Bindings::KJS_GetCreatedJavaVMs):
2107 * bindings/softlinking.c: Removed.
2108 * bindings/softlinking.h: Removed.
2110 2006-07-08 Geoffrey Garen <ggaren@apple.com>
2114 - Make JSObjectGetProperty return a JSValue or NULL, like JSEvaluate does.
2116 * API/JSObjectRef.cpp:
2117 (JSObjectGetProperty):
2118 * API/JSObjectRef.h:
2122 2006-07-08 Geoffrey Garen <ggaren@apple.com>
2124 Style change -- no review necessary.
2126 Use 0 instead of NULL in API .cpp files, to match our style guidelines.
2128 * API/JSContextRef.cpp:
2130 * API/JSObjectRef.cpp:
2131 (JSFunctionMakeWithBody):
2132 (JSObjectCallAsFunction):
2133 (JSObjectCallAsConstructor):
2134 * API/JSValueRef.cpp:
2137 2006-07-08 Geoffrey Garen <ggaren@apple.com>
2141 - Added ability to pass NULL for thisObject when calling JSObjectCallAsFunction,
2142 to match JSEvaluate.
2144 * API/JSObjectRef.cpp:
2145 (JSObjectCallAsFunction):
2146 * API/JSObjectRef.h:
2150 === Safari-521.15 ===
2152 2006-07-07 Geoffrey Garen <ggaren@apple.com>
2156 - Standardized which functions take a JSContext as an argument. The rule is:
2157 if you might execute JavaScript, you take a JSContext, otherwise you don't.
2159 The FIXME in JSObjectRef.h requires refactoring some parts of Interpreter,
2160 but not API changes, so I'm putting it off until later.
2162 * API/JSCallbackObject.cpp:
2163 (KJS::JSCallbackObject::JSCallbackObject):
2164 (KJS::JSCallbackObject::init):
2165 * API/JSCallbackObject.h:
2166 * API/JSContextRef.cpp:
2168 * API/JSContextRef.h:
2169 * API/JSObjectRef.cpp:
2171 (JSPropertyEnumeratorGetNext):
2172 * API/JSObjectRef.h:
2174 (MyObject_initialize):
2176 * JavaScriptCore.exp:
2177 * kjs/array_object.cpp:
2178 (ArrayInstance::setLength):
2179 (ArrayInstance::pushUndefinedObjectsToEnd):
2181 (ForInNode::execute):
2182 * kjs/reference.cpp:
2183 (KJS::Reference::getPropertyName):
2184 (KJS::Reference::getValue):
2186 * kjs/scope_chain.cpp:
2187 (KJS::ScopeChain::print):
2189 2006-07-06 Geoffrey Garen <ggaren@apple.com>
2195 - Headerdoc finished
2198 - Added a JSContextRef argument to many functions, because you need a
2199 JSContextRef for doing virtually anything. I expect to add this argument
2200 to even more functions in a future patch.
2202 - Removed the globalObjectPrototype argument to JSContextCreate because
2203 you can't create an object until you have a context, so it's impossible
2204 to pass a prototype object to JSContextCreate. That's OK because (1) there's
2205 no reason to give the global object a prototype and (2) if you really want
2206 to, you can just use a separate call to JSObjectSetPrototype.
2208 - Removed the JSClassRef argument to JSClassCreate because it was unnecessary,
2209 and you need to be able to make the global object's class before you've
2210 created a JSContext.
2212 - Added an optional exception parameter to JSFunctionMakeWithBody because anything
2213 less would be uncivilized.
2215 - Made the return value parameter to JSObjectGetProperty optional to match
2216 all other return value parameters in the API.
2218 - Made JSObjectSetPrivate/JSObjectGetPrivate work on JSCallbackFunctions
2219 and JSCallbackConstructors. You could use an abstract base class or strategic
2220 placement of m_privateData in the class structure to implement this, but
2221 the former seemed like overkill, and the latter seemed too dangerous.
2223 - Fixed a bug where JSPropertyEnumeratorGetNext would skip the first property.
2226 - Reversed the logic of the JSChar #ifdef to avoid confusing headerdoc
2228 - Removed function names from @function declarations because headeroc
2229 can parse them automatically, and I wanted to rule out manual mismatch.
2231 - Changed Error::create to take a const UString& instead of a UString*
2232 because it was looking at me funny.
2234 - Renamed JSStringBufferCreateWithCFString to JSStringBufferCreateCF
2235 because the latter is more concise and it matches JSStringBufferCreateUTF8.
2237 * API/JSCallbackObject.cpp:
2238 (KJS::JSCallbackObject::getOwnPropertySlot):
2239 (KJS::JSCallbackObject::put):
2240 (KJS::JSCallbackObject::deleteProperty):
2241 (KJS::JSCallbackObject::getPropertyList):
2242 (KJS::JSCallbackObject::toBoolean):
2243 (KJS::JSCallbackObject::toNumber):
2244 (KJS::JSCallbackObject::toString):
2245 * API/JSClassRef.cpp:
2247 * API/JSContextRef.cpp:
2249 (JSContextSetException):
2250 * API/JSContextRef.h:
2252 (JSNodePrototype_class):
2255 (JSNodeListPrototype_class):
2257 * API/JSObjectRef.cpp:
2258 (JSObjectGetProperty):
2259 (JSObjectGetPrivate):
2260 (JSObjectSetPrivate):
2261 (JSObjectCallAsFunction):
2262 (JSObjectCallAsConstructor):
2263 (JSPropertyEnumeratorGetNext):
2264 * API/JSObjectRef.h:
2265 * API/JSStringBufferRef.cpp:
2266 (JSStringBufferCreateCF):
2267 * API/JSStringBufferRef.h:
2268 * API/JSValueRef.cpp:
2269 (JSValueIsInstanceOf):
2275 (MyObject_hasProperty):
2276 (MyObject_setProperty):
2277 (MyObject_deleteProperty):
2278 (MyObject_getPropertyList):
2279 (MyObject_convertToType):
2282 * JavaScriptCore.exp:
2284 2006-07-07 Geoffrey Garen <ggaren@apple.com>
2288 - Fixed a few crashes resulting from NULL parameters to JSClassCreate.
2290 * API/JSClassRef.cpp:
2293 * API/testapi.c: Added test for NULL parameters.
2296 2006-07-07 Geoffrey Garen <ggaren@apple.com>
2298 Reviewed by John, mocked by Darin.
2300 - Changed JSEvaluate to take a JSObjectRef instead of a JSValueRef as
2301 "this," since "this" must be an object.
2303 * API/JSContextRef.cpp:
2305 * API/JSContextRef.h:
2307 2006-07-07 Geoffrey Garen <ggaren@apple.com>
2314 * JavaScriptCore.xcodeproj/project.pbxproj:
2316 2006-07-05 Geoffrey Garen <ggaren@apple.com>
2320 Renamed JSCharBufferRef, which was universally unpopular, to JSStringBufferRef,
2321 which, hopefully, will be less unpopular.
2327 * API/JSCallbackObject.cpp:
2328 (KJS::JSCallbackObject::getOwnPropertySlot):
2329 (KJS::JSCallbackObject::put):
2330 (KJS::JSCallbackObject::deleteProperty):
2331 (KJS::JSCallbackObject::staticValueGetter):
2332 (KJS::JSCallbackObject::callbackGetter):
2333 * API/JSCharBufferRef.cpp: Removed.
2334 * API/JSCharBufferRef.h: Removed.
2335 * API/JSContextRef.cpp:
2338 * API/JSContextRef.h:
2340 (JSNodePrototype_appendChild):
2341 (JSNode_getNodeType):
2342 (JSNode_getChildNodes):
2343 (JSNode_getFirstChild):
2345 (JSNodeList_length):
2346 (JSNodeList_getProperty):
2347 * API/JSObjectRef.cpp:
2348 (JSFunctionMakeWithBody):
2349 (JSObjectGetDescription):
2350 (JSObjectHasProperty):
2351 (JSObjectGetProperty):
2352 (JSObjectSetProperty):
2353 (JSObjectDeleteProperty):
2354 (JSPropertyEnumeratorGetNext):
2355 (JSPropertyListAdd):
2356 * API/JSObjectRef.h:
2357 * API/JSStringBufferRef.cpp: Added.
2359 (JSStringBufferCreate):
2360 (JSStringBufferCreateUTF8):
2361 (JSStringBufferRetain):
2362 (JSStringBufferRelease):
2363 (JSValueCopyStringValue):
2364 (JSStringBufferGetLength):
2365 (JSStringBufferGetCharactersPtr):
2366 (JSStringBufferGetCharacters):
2367 (JSStringBufferGetMaxLengthUTF8):
2368 (JSStringBufferGetCharactersUTF8):
2369 (JSStringBufferIsEqual):
2370 (JSStringBufferIsEqualUTF8):
2371 (JSStringBufferCreateWithCFString):
2372 (CFStringCreateWithJSStringBuffer):
2373 * API/JSStringBufferRef.h: Added.
2375 * API/JavaScriptCore.h:
2380 (assertEqualsAsUTF8String):
2381 (assertEqualsAsCharactersPtr):
2382 (assertEqualsAsCharacters):
2383 (MyObject_hasProperty):
2384 (MyObject_getProperty):
2385 (MyObject_setProperty):
2386 (MyObject_deleteProperty):
2387 (MyObject_getPropertyList):
2388 (print_callAsFunction):
2389 (myConstructor_callAsConstructor):
2391 * JavaScriptCore.exp:
2392 * JavaScriptCore.xcodeproj/project.pbxproj:
2394 2006-07-05 Geoffrey Garen <ggaren@apple.com>
2398 Moved some code around for more logical file separation.
2401 * API/JSContextRef.h:
2402 * API/JSObjectRef.cpp:
2403 * API/JSValueRef.cpp:
2407 2006-07-03 Geoffrey Garen <ggaren@apple.com>
2411 Implemented JSFunctionMakeWithBody, which parses a script as a function body
2412 in the global scope, and returns the resulting anonymous function.
2414 I also removed private data from JSCallbackFunction. It never worked,
2415 since JSCallbackFunction doesn't inherit from JSCallbackObject.
2417 * API/JSCallbackConstructor.cpp: Removed.
2418 * API/JSCallbackConstructor.h: Removed.
2419 * API/JSCallbackFunction.cpp:
2420 (KJS::JSCallbackFunction::JSCallbackFunction):
2421 (KJS::JSCallbackFunction::implementsConstruct):
2422 (KJS::JSCallbackFunction::construct):
2423 (KJS::JSCallbackFunction::implementsCall):
2424 (KJS::JSCallbackFunction::callAsFunction):
2425 * API/JSCallbackFunction.h:
2426 * API/JSCallbackObject.cpp:
2427 (KJS::JSCallbackObject::staticFunctionGetter):
2428 * API/JSObjectRef.cpp:
2430 (JSFunctionMakeWithCallbacks):
2431 * API/JSObjectRef.h:
2437 * JavaScriptCore.exp: Programmatically added all symbols exported by
2438 API object files, and sorted results
2439 * JavaScriptCore.xcodeproj/project.pbxproj:
2441 2006-07-03 Geoffrey Garen <ggaren@apple.com>
2445 - Return syntax error in JSCheckSyntax through a JSValueRef* exception
2449 * API/JSContextRef.cpp:
2453 * JavaScriptCore.exp:
2454 * kjs/interpreter.cpp:
2455 (KJS::Interpreter::checkSyntax):
2456 * kjs/interpreter.h:
2458 2006-07-04 Darin Adler <darin@apple.com>
2462 * wtf/MathExtras.h: Oops. Added missing #endif.
2464 2006-07-04 Bjoern Graf <bjoern.graf@gmail.com>
2467 Tweaked a bit by Darin.
2469 - http://bugs.webkit.org/show_bug.cgi?id=9678
2470 work around MSVCRT's fmod function returning NaN for fmod(x, infinity) instead of x
2472 * wtf/MathExtras.h: Added include of <float.h>.
2473 (isinf): Fix to return false for NAN.
2474 (wtf_fmod): Added. An inline that works around the bug.
2477 * kjs/number_object.cpp:
2478 * kjs/operations.cpp:
2480 Added includes of MathExtras.h to all files using fmod.
2482 * JavaScriptCore.xcodeproj/project.pbxproj: Let Xcode 2.3 have its way with
2485 2006-07-01 Geoffrey Garen <ggaren@apple.com>
2489 - Refined value conversions in the API:
2490 - failed toNumber returns NaN
2491 - failed toObject returns NULL
2492 - failed toString returns empty string
2494 - Refined excpetion handling in the API:
2495 - failed value conversions do not throw exceptions
2496 - uncaught exceptions in JSEvaluate, JSObjectCallAsFunction, and
2497 JSObjectCallAsConstructor are returned through a JSValueRef* exception
2499 - removed JSContextHasException, because JSContextGetException does
2503 * API/JSCharBufferRef.cpp:
2504 (JSValueCopyStringValue):
2505 * API/JSContextRef.cpp:
2507 * API/JSContextRef.h:
2508 * API/JSNodeList.c: Added test code demonstrating how you would use
2509 toNumber, and why you probably don't need toUInt32, etc.
2510 (JSNodeListPrototype_item):
2511 (JSNodeList_getProperty):
2512 * API/JSObjectRef.cpp:
2514 (JSObjectCallAsFunction):
2515 (JSObjectCallAsConstructor):
2516 * API/JSObjectRef.h:
2517 * API/JSValueRef.cpp:
2523 (main): Added tests for new rules, and call to JSGCProtect to fix Intel
2525 * JavaScriptCore.exp:
2527 2006-07-03 Darin Adler <darin@apple.com>
2529 - Rolled out HashMap implementation of NPRuntime, at least temporarily.
2531 Fixes hang in the bindings section of layout tests seen on the
2534 This code was using HashMap<const char*, PrivateIdentifier*>.
2535 But that hashes based on pointer identity, not string value.
2536 The default hash for any pointer type is to hash based on the pointer.
2537 And WTF doesn't currently have a string hash for char*.
2538 We'll need to fix that before re-landing this patch.
2540 (Formatting was also incorrect -- extra spaces in parentheses.)
2542 * bindings/npruntime.cpp: Rolled out last change.
2544 2006-07-02 Justin Haygood <jhaygood@spsu.edu>
2546 Reviewed, tweaked, landed by ggaren.
2548 - Port NPRuntime from CFDictionary to HashMap.
2550 * bindings/npruntime.cpp:
2551 (getStringIdentifierDictionary):
2552 (getIntIdentifierDictionary):
2553 (_NPN_GetStringIdentifier):
2554 (_NPN_GetIntIdentifier):
2555 * bindings/npruntime.h:
2557 2006-07-01 Geoffrey Garen <ggaren@apple.com>
2561 - Fixed <rdar://problem/4611197> REGRESSION: Liveconnect with Java test
2562 fails at http://www-sor.inria.fr/~dedieu/notes/liveconnect/simple_example.html
2564 * JavaScriptCore.exp: Export symbols used by liveconnect
2566 2006-06-29 Geoffrey Garen <ggaren@apple.com>
2570 - Phase 2 in the JS API.
2572 - Added support for specifying static tables of values -- this should
2573 obviate the need for using complicated callbacks for most lookups.
2575 - API objects are now created with classes (JSClassRef) -- in order to support
2576 static values, and in order to prevent API objects from storing their
2577 data inline, and thus falling into the oversized (read: slow and prone to
2578 giving Maciej the frowny face) heap.
2580 - Added two specialized JSObject subclasses -- JSCallbackFunction and JSCallbackConstructor --
2581 to allow JSFunctionMake and JSConstructorMake to continue to work with
2582 the new class model. Another solution to this problem would be to create
2583 a custom class object for each function and constructor you make. This
2584 solution is more code but also more efficient.
2586 - Substantially beefed up the minidom example to demonstrate and test a
2587 lot of these techniques. Its output is still pretty haphazard, though.
2589 - Gave the <kjs/ preface to some includes -- I'm told this matters to
2590 building on some versions of Linux.
2592 - Implemented JSValueIsInstanceOf and JSValueIsObjectOfClass
2594 - Removed GetDescription callback. Something in the class datastructure
2595 should take care of this.
2598 * API/JSCallbackConstructor.cpp: Added.
2600 (KJS::JSCallbackConstructor::JSCallbackConstructor):
2601 (KJS::JSCallbackConstructor::implementsConstruct):
2602 (KJS::JSCallbackConstructor::construct):
2603 (KJS::JSCallbackConstructor::setPrivate):
2604 (KJS::JSCallbackConstructor::getPrivate):
2605 * API/JSCallbackConstructor.h: Added.
2606 (KJS::JSCallbackConstructor::classInfo):
2607 * API/JSCallbackFunction.cpp: Added.
2609 (KJS::JSCallbackFunction::JSCallbackFunction):
2610 (KJS::JSCallbackFunction::implementsCall):
2611 (KJS::JSCallbackFunction::callAsFunction):
2612 (KJS::JSCallbackFunction::setPrivate):
2613 (KJS::JSCallbackFunction::getPrivate):
2614 * API/JSCallbackFunction.h: Added.
2615 (KJS::JSCallbackFunction::classInfo):
2616 * API/JSCallbackObject.cpp:
2618 (KJS::JSCallbackObject::JSCallbackObject):
2619 (KJS::JSCallbackObject::init):
2620 (KJS::JSCallbackObject::~JSCallbackObject):
2621 (KJS::JSCallbackObject::className):
2622 (KJS::JSCallbackObject::getOwnPropertySlot):
2623 (KJS::JSCallbackObject::put):
2624 (KJS::JSCallbackObject::deleteProperty):
2625 (KJS::JSCallbackObject::implementsConstruct):
2626 (KJS::JSCallbackObject::construct):
2627 (KJS::JSCallbackObject::implementsCall):
2628 (KJS::JSCallbackObject::callAsFunction):
2629 (KJS::JSCallbackObject::getPropertyList):
2630 (KJS::JSCallbackObject::toBoolean):
2631 (KJS::JSCallbackObject::toNumber):
2632 (KJS::JSCallbackObject::toString):
2633 (KJS::JSCallbackObject::inherits):
2634 (KJS::JSCallbackObject::staticValueGetter):
2635 (KJS::JSCallbackObject::staticFunctionGetter):
2636 (KJS::JSCallbackObject::callbackGetter):
2637 * API/JSCallbackObject.h:
2638 * API/JSCharBufferRef.cpp:
2639 * API/JSClassRef.cpp: Added.
2643 * API/JSClassRef.h: Added.
2644 (StaticValueEntry::StaticValueEntry):
2645 (StaticFunctionEntry::StaticFunctionEntry):
2646 (__JSClass::__JSClass):
2647 * API/JSContextRef.cpp:
2650 * API/JSContextRef.h:
2651 * API/JSNode.c: Added.
2652 (JSNodePrototype_appendChild):
2653 (JSNodePrototype_removeChild):
2654 (JSNodePrototype_replaceChild):
2655 (JSNodePrototype_class):
2656 (JSNode_getNodeType):
2657 (JSNode_getChildNodes):
2658 (JSNode_getFirstChild):
2664 * API/JSNode.h: Added.
2665 * API/JSNodeList.c: Added.
2666 (JSNodeListPrototype_item):
2667 (JSNodeListPrototype_class):
2668 (JSNodeList_length):
2669 (JSNodeList_getProperty):
2670 (JSNodeList_finalize):
2672 (JSNodeList_prototype):
2674 * API/JSNodeList.h: Added.
2675 * API/JSObjectRef.cpp:
2678 (JSConstructorMake):
2679 (__JSPropertyEnumerator::__JSPropertyEnumerator):
2680 (JSObjectCreatePropertyEnumerator):
2681 (JSPropertyEnumeratorGetNext):
2682 (JSPropertyEnumeratorRetain):
2683 (JSPropertyEnumeratorRelease):
2684 * API/JSObjectRef.h:
2685 (__JSObjectCallbacks::):
2686 * API/JSValueRef.cpp:
2687 (JSValueIsObjectOfClass):
2688 (JSValueIsInstanceOf):
2690 * API/Node.c: Added.
2694 (Node_replaceChild):
2697 * API/Node.h: Added.
2698 * API/NodeList.c: Added.
2704 * API/NodeList.h: Added.
2708 (createStringWithContentsOfFile):
2711 (assertEqualsAsCharacters):
2712 (MyObject_getProperty):
2714 (myConstructor_callAsConstructor):
2717 * JavaScriptCore.xcodeproj/project.pbxproj:
2719 2006-06-26 Kevin Ollivier <kevino@theolliviers.com>
2721 Reviewed and tweaked by Darin.
2723 - Compile fixes for wx port / gcc 4.0.2
2725 * kjs/array_object.cpp:
2726 Added missing headers.
2729 gcc needs class prototypes before defining those classes as friend classes
2731 2006-06-30 Mike Emmel <mike.emmel@gmail.com>
2735 Compilation fixes for Linux/Gdk.
2737 * JavaScriptCore/kjs/interpreter.cpp: added include of signal.h
2738 * JavaScriptCore/kjs/ExecState.h: added missing class declaration
2739 * JavaScriptCore/kjs/ExecState.cpp: case wrong on include of context.h
2740 * JavaScriptCore/JavaScriptCoreSources.bkl: added Context.cpp and ExecState.cpp
2742 === Safari-521.14 ===
2744 2006-06-29 Maciej Stachowiak <mjs@apple.com>
2748 - add headerdoc comments to some of the new JS API headers
2753 2006-06-28 Timothy Hatcher <timothy@apple.com>
2755 Prefer the Stabs debugging symbols format until DWARF bugs are fixed.
2757 * JavaScriptCore.xcodeproj/project.pbxproj:
2759 2006-06-27 Timothy Hatcher <timothy@apple.com>
2763 <rdar://problem/4448350> Deprecated ObjC language API used in JavaScriptCore, WebCore, WebKit and WebBrowser
2765 Switch to the new ObjC 2 API, ifdefed the old code around OBJC_API_VERSION so it still works on Tiger.
2766 Removed the use of the old stringWithCString, switched to the new Tiger version that accepts an encoding.
2767 Lots of code style cleanup.
2769 * JavaScriptCore.xcodeproj/project.pbxproj:
2770 * bindings/objc/objc_class.h:
2771 * bindings/objc/objc_class.mm:
2772 (KJS::Bindings::ObjcClass::~ObjcClass):
2773 (KJS::Bindings::_createClassesByIsAIfNecessary):
2774 (KJS::Bindings::ObjcClass::classForIsA):
2775 (KJS::Bindings::ObjcClass::name):
2776 (KJS::Bindings::ObjcClass::methodsNamed):
2777 (KJS::Bindings::ObjcClass::fieldNamed):
2778 (KJS::Bindings::ObjcClass::fallbackObject):
2779 * bindings/objc/objc_header.h:
2780 * bindings/objc/objc_instance.h:
2781 * bindings/objc/objc_instance.mm:
2782 (ObjcInstance::ObjcInstance):
2783 (ObjcInstance::~ObjcInstance):
2784 (ObjcInstance::operator=):
2785 (ObjcInstance::begin):
2786 (ObjcInstance::end):
2787 (ObjcInstance::getClass):
2788 (ObjcInstance::invokeMethod):
2789 (ObjcInstance::invokeDefaultMethod):
2790 (ObjcInstance::setValueOfField):
2791 (ObjcInstance::supportsSetValueOfUndefinedField):
2792 (ObjcInstance::setValueOfUndefinedField):
2793 (ObjcInstance::getValueOfField):
2794 (ObjcInstance::getValueOfUndefinedField):
2795 (ObjcInstance::defaultValue):
2796 (ObjcInstance::stringValue):
2797 (ObjcInstance::numberValue):
2798 (ObjcInstance::booleanValue):
2799 (ObjcInstance::valueOf):
2800 * bindings/objc/objc_runtime.h:
2801 * bindings/objc/objc_runtime.mm:
2802 (ObjcMethod::ObjcMethod):
2804 (ObjcMethod::getMethodSignature):
2805 (ObjcMethod::setJavaScriptName):
2808 (ObjcField::valueFromInstance):
2809 (convertValueToObjcObject):
2810 (ObjcField::setValueToInstance):
2811 (ObjcArray::operator=):
2812 (ObjcArray::setValueAt):
2813 (ObjcArray::valueAt):
2814 (ObjcFallbackObjectImp::ObjcFallbackObjectImp):
2815 (ObjcFallbackObjectImp::callAsFunction):
2816 (ObjcFallbackObjectImp::defaultValue):
2818 2006-06-28 Anders Carlsson <acarlsson@apple.com>
2822 http://bugs.webkit.org/show_bug.cgi?id=8636
2823 REGRESSION: JavaScript access to Java applet causes hang (_webViewURL not implemented)
2825 * bindings/jni/jni_objc.mm:
2826 (KJS::Bindings::dispatchJNICall):
2827 Just pass nil as the calling URL. This will cause the Java plugin to use the URL of the page
2828 containing the applet (which is what we used to do).
2830 2006-06-27 Timothy Hatcher <timothy@apple.com>
2834 <rdar://problem/4406785> Add an export file to TOT JavaScriptCore like the Safari-2-0-branch
2836 * JavaScriptCore.exp: Added.
2837 * JavaScriptCore.xcodeproj/project.pbxproj:
2839 2006-06-25 Geoffrey Garen <ggaren@apple.com>
2843 - Added JSConstructorMake to match JSFunctionMake, along with test code.
2845 [ I checked in the ChangeLog before without the actual files. ]
2847 * API/JSObjectRef.cpp:
2848 (JSConstructorMake):
2849 * API/JSObjectRef.h:
2851 (myConstructor_callAsConstructor):
2855 * JavaScriptCore.xcodeproj/project.pbxproj: Moved testapi.c to the testapi
2856 target -- this was an oversight in my earlier check-in.
2858 2006-06-25 Timothy Hatcher <timothy@apple.com>
2862 Bug 9574: Drosera should show inline scripts within the original HTML
2863 http://bugs.webkit.org/show_bug.cgi?id=9574
2865 Pass the starting line number and error message to the debugger.
2868 (Debugger::sourceParsed):
2871 (KJS::GlobalFuncImp::callAsFunction):
2872 * kjs/function_object.cpp:
2873 (FunctionObjectImp::construct):
2874 * kjs/interpreter.cpp:
2875 (KJS::Interpreter::evaluate):
2877 2006-06-24 Alexey Proskuryakov <ap@nypop.com>
2879 Rubber-stamped by Eric.
2881 Add a -h (do not follow symlinks) option to ln in derived sources build script (without it,
2882 a symlink was created inside the source directory on second build).
2884 * JavaScriptCore.xcodeproj/project.pbxproj:
2886 2006-06-24 David Kilzer <ddkilzer@kilzer.net>
2888 Reviewed by Timothy.
2890 * Info.plist: Fixed copyright to include 2003-2006.
2892 2006-06-24 Alexey Proskuryakov <ap@nypop.com>
2896 - http://bugs.webkit.org/show_bug.cgi?id=9418
2897 WebKit will not build when Space exists in path
2899 * JavaScriptCore.xcodeproj/project.pbxproj: Enclose search paths in quotes; create symlinks to
2900 avoid passing paths with spaces to make.
2902 2006-06-23 Timothy Hatcher <timothy@apple.com>
2906 Adding more operator[] overloads for long and short types.
2909 (WTF::Vector::operator[]):
2911 === JavaScriptCore-521.13 ===
2913 2006-06-22 Alexey Proskuryakov <ap@nypop.com>
2917 - http://bugs.webkit.org/show_bug.cgi?id=9539
2918 Another case error preventing build
2920 * API/JSObjectRef.cpp: Changed "identifier.h" to "Identifier.h"
2922 2006-06-22 David Kilzer <ddkilzer@kilzer.net>
2926 http://bugs.webkit.org/show_bug.cgi?id=9539
2927 Another case error preventing build
2929 * API/APICast.h: Changed "UString.h" to "ustring.h".
2931 2006-06-21 Geoffrey Garen <ggaren@apple.com>
2933 Fixed release build, fixed accidental infinite recursion due to
2934 last minute global replace gone awry.
2939 (assertEqualsAsBoolean):
2940 (assertEqualsAsNumber):
2941 (assertEqualsAsUTF8String):
2942 (assertEqualsAsCharactersPtr):
2943 * JavaScriptCore.xcodeproj/project.pbxproj:
2945 2006-06-21 Geoffrey Garen <ggaren@apple.com>
2949 - First cut at C API to JavaScript. Includes a unit test, 'testapi.c',
2950 and the outline of a test app, 'minidom.c'.
2952 Includes one change to JSC internals: Rename propList to getPropertyList and have it
2953 take its target property list by reference so that subclasses can
2954 add properties to the list before calling through to their superclasses.
2956 Also, I just ran prepare-ChangeLog in about 10 seconds, and I would like
2957 to give a shout-out to that.
2959 * API/APICast.h: Added.
2962 * API/JSBase.h: Added.
2963 * API/JSCallbackObject.cpp: Added.
2965 (KJS::JSCallbackObject::JSCallbackObject):
2966 (KJS::JSCallbackObject::~JSCallbackObject):
2967 (KJS::JSCallbackObject::className):
2968 (KJS::JSCallbackObject::getOwnPropertySlot):
2969 (KJS::JSCallbackObject::put):
2970 (KJS::JSCallbackObject::deleteProperty):
2971 (KJS::JSCallbackObject::implementsConstruct):
2972 (KJS::JSCallbackObject::construct):
2973 (KJS::JSCallbackObject::implementsCall):
2974 (KJS::JSCallbackObject::callAsFunction):
2975 (KJS::JSCallbackObject::getPropertyList):
2976 (KJS::JSCallbackObject::toBoolean):
2977 (KJS::JSCallbackObject::toNumber):
2978 (KJS::JSCallbackObject::toString):
2979 (KJS::JSCallbackObject::setPrivate):
2980 (KJS::JSCallbackObject::getPrivate):
2981 (KJS::JSCallbackObject::cachedValueGetter):
2982 (KJS::JSCallbackObject::callbackGetter):
2983 * API/JSCallbackObject.h: Added.
2984 (KJS::JSCallbackObject::classInfo):
2985 * API/JSCharBufferRef.cpp: Added.
2987 (JSCharBufferCreate):
2988 (JSCharBufferCreateUTF8):
2989 (JSCharBufferRetain):
2990 (JSCharBufferRelease):
2991 (JSValueCopyStringValue):
2992 (JSCharBufferGetLength):
2993 (JSCharBufferGetCharactersPtr):
2994 (JSCharBufferGetCharacters):
2995 (JSCharBufferGetMaxLengthUTF8):
2996 (JSCharBufferGetCharactersUTF8):
2997 (JSCharBufferIsEqual):
2998 (JSCharBufferIsEqualUTF8):
2999 (JSCharBufferCreateWithCFString):
3000 (CFStringCreateWithJSCharBuffer):
3001 * API/JSCharBufferRef.h: Added.
3002 * API/JSContextRef.cpp: Added.
3005 (JSContextGetGlobalObject):
3008 (JSContextHasException):
3009 (JSContextGetException):
3010 (JSContextClearException):
3011 (JSContextSetException):
3012 * API/JSContextRef.h: Added.
3013 * API/JSObjectRef.cpp: Added.
3017 (JSObjectGetDescription):
3018 (JSObjectGetPrototype):
3019 (JSObjectSetPrototype):
3020 (JSObjectHasProperty):
3021 (JSObjectGetProperty):
3022 (JSObjectSetProperty):
3023 (JSObjectDeleteProperty):
3024 (JSObjectGetPrivate):
3025 (JSObjectSetPrivate):
3026 (JSObjectIsFunction):
3027 (JSObjectCallAsFunction):
3028 (JSObjectIsConstructor):
3029 (JSObjectCallAsConstructor):
3030 (__JSPropertyListEnumerator::__JSPropertyListEnumerator):
3031 (JSObjectCreatePropertyEnumerator):
3032 (JSPropertyEnumeratorGetNext):
3033 (JSPropertyEnumeratorRetain):
3034 (JSPropertyEnumeratorRelease):
3035 (JSPropertyListAdd):
3036 * API/JSObjectRef.h: Added.
3037 * API/JSValueRef.cpp: Added.
3039 (JSValueIsUndefined):
3046 (JSValueIsStrictEqual):
3056 * API/JSValueRef.h: Added.
3057 * API/JavaScriptCore.h: Added.
3058 * API/minidom.c: Added.
3060 * API/minidom.html: Added.
3061 * API/minidom.js: Added.
3062 * API/testapi.c: Added.
3063 (assertEqualsAsBoolean):
3064 (assertEqualsAsNumber):
3065 (assertEqualsAsUTF8String):
3066 (assertEqualsAsCharactersPtr):
3067 (assertEqualsAsCharacters):
3068 (MyObject_initialize):
3069 (MyObject_copyDescription):
3070 (MyObject_hasProperty):
3071 (MyObject_getProperty):
3072 (MyObject_setProperty):
3073 (MyObject_deleteProperty):
3074 (MyObject_getPropertyList):
3075 (MyObject_callAsFunction):
3076 (MyObject_callAsConstructor):
3077 (MyObject_convertToType):
3078 (MyObject_finalize):
3079 (print_callAsFunction):
3081 (createStringWithContentsOfFile):
3082 * API/testapi.js: Added.
3084 * JavaScriptCore.xcodeproj/project.pbxproj:
3085 * bindings/npruntime_impl.h:
3086 * kjs/array_instance.h:
3087 * kjs/array_object.cpp:
3088 (ArrayInstance::getPropertyList):
3089 * kjs/interpreter.cpp:
3090 (KJS::Interpreter::evaluate):
3092 (ForInNode::execute):
3094 (KJS::JSObject::put):
3095 (KJS::JSObject::canPut):
3096 (KJS::JSObject::deleteProperty):
3097 (KJS::JSObject::propertyIsEnumerable):
3098 (KJS::JSObject::getPropertyAttributes):
3099 (KJS::JSObject::getPropertyList):
3101 * kjs/property_map.cpp:
3102 (KJS::PropertyMap::get):
3103 * kjs/property_map.h:
3104 * kjs/scope_chain.cpp:
3105 (KJS::ScopeChain::print):
3106 * kjs/string_object.cpp:
3107 (StringInstance::getPropertyList):
3108 * kjs/string_object.h:
3110 (KJS::UString::Rep::ref):
3112 2006-06-20 Timothy Hatcher <timothy@apple.com>
3116 Make sure we clear the exception before returning so
3117 that future calls will not fail because of an earlier
3118 exception state. Assert on entry that the WebScriptObject
3119 is working with an ExecState that dose not have an exception.
3120 Document that evaluateWebScript and callWebScriptMethod return
3121 WebUndefined when an exception is thrown.
3123 * bindings/objc/WebScriptObject.h:
3124 * bindings/objc/WebScriptObject.mm:
3125 (-[WebScriptObject callWebScriptMethod:withArguments:]):
3126 (-[WebScriptObject evaluateWebScript:]):
3127 (-[WebScriptObject setValue:forKey:]):
3128 (-[WebScriptObject valueForKey:]):
3129 (-[WebScriptObject removeWebScriptKey:]):
3130 (-[WebScriptObject webScriptValueAtIndex:]):
3131 (-[WebScriptObject setWebScriptValueAtIndex:value:]):
3133 2006-06-19 Anders Carlsson <acarlsson@apple.com>
3137 * kjs/interpreter.cpp:
3138 (KJS::TimeoutChecker::pauseTimeoutCheck):
3139 (KJS::TimeoutChecker::resumeTimeoutCheck):
3140 Fix argument order in setitimer calls.
3142 2006-06-18 Anders Carlsson <acarlsson@apple.com>
3146 * kjs/interpreter.cpp:
3147 (KJS::TimeoutChecker::pauseTimeoutCheck):
3148 Do nothing if the timeout check hasn't been started.
3150 (KJS::TimeoutChecker::resumeTimeoutCheck):
3151 Do nothing if the timeout check hasn't been started.
3152 Use the right signal handler when unblocking.
3154 (KJS::Interpreter::handleTimeout):
3155 pause/resume the timeout check around the call to
3156 shouldInterruptScript().
3158 2006-06-16 Ben Goodger <beng@google.com>
3162 http://bugs.webkit.org/show_bug.cgi?id=9491
3163 Windows build breaks in interpreter.cpp
3165 * kjs/interpreter.cpp
3166 (KJS::TimeoutChecker::pauseTimeoutCheck):
3167 (KJS::TimeoutChecker::resumeTimeoutCheck):
3168 Make sure to only assert equality with s_executingInterpreter when it
3169 is being used (i.e. when HAVE(SYS_TIME_H) == true)
3171 2006-06-17 David Kilzer <ddkilzer@kilzer.net>
3175 http://bugs.webkit.org/show_bug.cgi?id=9477
3176 REGRESSION: fast/dom/replaceChild.html crashes on WebKit ToT in debug build
3179 (KJS::FunctionImp::callAsFunction): Refetch the debugger after executing the function
3180 in case the WebFrame it was running in has since been destroyed.
3182 2006-06-17 David Kilzer <ddkilzer@kilzer.net>
3186 http://bugs.webkit.org/show_bug.cgi?id=9476
3187 REGRESSION: Reproducible crash after closing window after viewing
3188 css2.1/t0803-c5501-imrgn-t-00-b-ag.html
3191 (Debugger::detach): Call setDebugger(0) for all interpreters removed from
3192 the 'attached to a debugger' list.
3194 2006-06-17 Anders Carlsson <acarlsson@apple.com>
3196 Reviewed by Maciej and Geoff.
3198 http://bugs.webkit.org/show_bug.cgi?id=7080
3199 Provide some way to stop a JavaScript infinite loop
3203 Add Interrupted completion type.
3206 (KJS::FunctionImp::callAsFunction):
3207 (KJS::GlobalFuncImp::callAsFunction):
3208 Only set the exception on the new ExecState if the current one has had one.
3210 * kjs/interpreter.cpp:
3211 (KJS::TimeoutChecker::startTimeoutCheck):
3212 (KJS::TimeoutChecker::stopTimeoutCheck):
3213 (KJS::TimeoutChecker::alarmHandler):
3214 (KJS::TimeoutChecker::pauseTimeoutCheck):
3215 (KJS::TimeoutChecker::resumeTimeoutCheck):
3216 New TimeoutChecker class which handles setting Interpreter::m_timedOut flag after a given
3217 period of time. This currently only works on Unix platforms where setitimer and signals are used.
3219 (KJS::Interpreter::Interpreter):
3220 Initialize new member variables.
3222 (KJS::Interpreter::~Interpreter):
3223 Destroy the timeout checker.
3225 (KJS::Interpreter::startTimeoutCheck):
3226 (KJS::Interpreter::stopTimeoutCheck):
3227 (KJS::Interpreter::pauseTimeoutCheck):
3228 (KJS::Interpreter::resumeTimeoutCheck):
3229 Call the timeout checker.
3231 (KJS::Interpreter::handleTimeout):
3232 Called on timeout. Resets the m_timedOut flag and calls shouldInterruptScript.
3234 * kjs/interpreter.h:
3235 (KJS::Interpreter::setTimeoutTime):
3236 New function for setting the timeout time.
3238 (KJS::Interpreter::shouldInterruptScript):
3239 New function. The idea is that this should be overridden by subclasses in order to for example
3240 pop up a dialog asking the user if the script should be interrupted.
3242 (KJS::Interpreter::checkTimeout):
3243 New function which checks the m_timedOut flag and calls handleTimeout if it's set.
3246 (DoWhileNode::execute):
3247 (WhileNode::execute):
3249 Call Interpreter::checkTimeout after each iteration of the loop.
3251 2006-06-15 Timothy Hatcher <timothy@apple.com>
3253 Reviewed by Geoff and Darin.
3255 Prefer the DWARF debugging symbols format for use in Xcode 2.3.
3257 * JavaScriptCore.xcodeproj/project.pbxproj:
3259 2006-06-14 Geoffrey Garen <ggaren@apple.com>
3263 - fixed http://bugs.webkit.org/show_bug.cgi?id=9438
3264 Someone broke ToT: cannot build
3266 * JavaScriptCore.xcodeproj/project.pbxproj:
3267 * bindings/runtime_root.h: Changed "Interpreter.h" to "interpreter.h"
3269 2006-06-12 Geoffrey Garen <ggaren@apple.com>
3273 * bindings/objc/WebScriptObject.mm:
3274 (+[WebScriptObject throwException:]): Restore assignment I accidentally
3275 deleted in previous commit
3277 2006-06-12 Geoffrey Garen <ggaren@apple.com>
3279 Reviewed by TimO, Maciej.
3281 - Merged InterpreterImp code into Interpreter, which implements
3282 all interpreter functionality now. This is part of my continuing quest
3283 to create an external notion of JS "execution context" that is unified and simple --
3284 something to replace the mix of Context, ContextImp, ExecState, Interpreter,
3285 InterpreterImp, and JSRun.
3287 All tests pass. Leaks test has not regressed from its baseline ~207 leaks
3288 with ~3460 leaked nodes.
3290 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3291 * JavaScriptCore.xcodeproj/project.pbxproj:
3292 * bindings/NP_jsobject.cpp:
3293 * bindings/objc/WebScriptObject.mm:
3294 (+[WebScriptObject throwException:]):
3295 * bindings/runtime_root.cpp:
3296 * bindings/runtime_root.h:
3298 (KJS::Context::Context):
3299 * kjs/ExecState.cpp: Added.
3300 (KJS::ExecState::lexicalInterpreter):
3301 * kjs/ExecState.h: Added.
3302 (KJS::ExecState::dynamicInterpreter):
3303 * kjs/SavedBuiltins.h: Added.
3304 * kjs/bool_object.cpp:
3305 (BooleanPrototype::BooleanPrototype):
3306 * kjs/collector.cpp:
3307 (KJS::Collector::collect):
3308 (KJS::Collector::numInterpreters):
3314 (KJS::FunctionImp::callAsFunction):
3315 (KJS::GlobalFuncImp::callAsFunction):
3316 * kjs/function_object.cpp:
3317 (FunctionObjectImp::construct):
3320 * kjs/interpreter.cpp:
3321 (KJS::interpreterMap):
3322 (KJS::Interpreter::Interpreter):
3323 (KJS::Interpreter::init):
3324 (KJS::Interpreter::~Interpreter):
3325 (KJS::Interpreter::globalObject):
3326 (KJS::Interpreter::initGlobalObject):
3327 (KJS::Interpreter::globalExec):
3328 (KJS::Interpreter::checkSyntax):
3329 (KJS::Interpreter::evaluate):
3330 (KJS::Interpreter::builtinObject):
3331 (KJS::Interpreter::builtinFunction):
3332 (KJS::Interpreter::builtinArray):
3333 (KJS::Interpreter::builtinBoolean):
3334 (KJS::Interpreter::builtinString):
3335 (KJS::Interpreter::builtinNumber):
3336 (KJS::Interpreter::builtinDate):
3337 (KJS::Interpreter::builtinRegExp):
3338 (KJS::Interpreter::builtinError):
3339 (KJS::Interpreter::builtinObjectPrototype):
3340 (KJS::Interpreter::builtinFunctionPrototype):
3341 (KJS::Interpreter::builtinArrayPrototype):
3342 (KJS::Interpreter::builtinBooleanPrototype):
3343 (KJS::Interpreter::builtinStringPrototype):
3344 (KJS::Interpreter::builtinNumberPrototype):
3345 (KJS::Interpreter::builtinDatePrototype):
3346 (KJS::Interpreter::builtinRegExpPrototype):
3347 (KJS::Interpreter::builtinErrorPrototype):
3348 (KJS::Interpreter::builtinEvalError):
3349 (KJS::Interpreter::builtinRangeError):
3350 (KJS::Interpreter::builtinReferenceError):
3351 (KJS::Interpreter::builtinSyntaxError):
3352 (KJS::Interpreter::builtinTypeError):
3353 (KJS::Interpreter::builtinURIError):
3354 (KJS::Interpreter::builtinEvalErrorPrototype):
3355 (KJS::Interpreter::builtinRangeErrorPrototype):
3356 (KJS::Interpreter::builtinReferenceErrorPrototype):
3357 (KJS::Interpreter::builtinSyntaxErrorPrototype):
3358 (KJS::Interpreter::builtinTypeErrorPrototype):
3359 (KJS::Interpreter::builtinURIErrorPrototype):
3360 (KJS::Interpreter::mark):
3361 (KJS::Interpreter::interpreterWithGlobalObject):
3362 (KJS::Interpreter::saveBuiltins):
3363 (KJS::Interpreter::restoreBuiltins):
3364 * kjs/interpreter.h:
3365 (KJS::Interpreter::setCompatMode):
3366 (KJS::Interpreter::compatMode):
3367 (KJS::Interpreter::firstInterpreter):
3368 (KJS::Interpreter::nextInterpreter):
3369 (KJS::Interpreter::prevInterpreter):
3370 (KJS::Interpreter::debugger):
3371 (KJS::Interpreter::setDebugger):
3372 (KJS::Interpreter::setContext):
3373 (KJS::Interpreter::context):
3375 (StatementNode::hitStatement):
3376 (RegExpNode::evaluate):
3379 2006-06-12 Geoffrey Garen <ggaren@apple.com>
3383 - Have *.lut.h files #include lookup.h to eliminate surprising header
3384 include order dependency.
3386 * DerivedSources.make:
3387 * kjs/array_object.cpp:
3388 * kjs/date_object.cpp:
3389 * kjs/date_object.h:
3390 (KJS::DateProtoFunc::):
3392 * kjs/math_object.cpp:
3393 * kjs/number_object.cpp:
3394 * kjs/regexp_object.cpp:
3395 * kjs/string_object.cpp:
3397 2006-06-10 Geoffrey Garen <ggaren@apple.com>
3399 - http://bugs.webkit.org/show_bug.cgi?id=8515
3400 Linux porting compile bug
3402 Fix by Mike Emmel, Reviewed by Darin.
3404 * JavaScriptCoreSources.bkl:
3408 2006-06-09 Geoffrey Garen <ggaren@apple.com>
3410 Build fix -- I think :).
3412 * JavaScriptCore.xcodeproj/project.pbxproj:
3415 2006-06-09 Geoffrey Garen <ggaren@apple.com>
3417 Reviewed by Eric (yay!).
3419 - Removed Context wrapper for ContextImp, renamed ContextImp to Context,
3420 split Context into its own file -- Context.cpp -- renamed _var to m_var,
3421 change ' *' to '* '.
3423 * JavaScriptCore.xcodeproj/project.pbxproj:
3424 * kjs/Context.cpp: Added.
3425 (KJS::Context::Context):
3426 (KJS::Context::~Context):
3427 (KJS::Context::mark):
3429 (KJS::Context::scopeChain):
3430 (KJS::Context::variableObject):
3431 (KJS::Context::setVariableObject):
3432 (KJS::Context::thisValue):
3433 (KJS::Context::callingContext):
3434 (KJS::Context::activationObject):
3435 (KJS::Context::currentBody):
3436 (KJS::Context::function):
3437 (KJS::Context::arguments):
3438 (KJS::Context::pushScope):
3439 (KJS::Context::seenLabels):
3441 (KJS::FunctionImp::callAsFunction):
3442 (KJS::FunctionImp::processParameters):
3443 (KJS::FunctionImp::argumentsGetter):
3444 (KJS::GlobalFuncImp::callAsFunction):
3446 (KJS::InterpreterImp::evaluate):
3448 (KJS::InterpreterImp::setContext):
3449 (KJS::InterpreterImp::context):
3450 * kjs/interpreter.cpp:
3451 * kjs/interpreter.h:
3452 (KJS::ExecState::context):
3453 (KJS::ExecState::ExecState):
3457 (ThisNode::evaluate):
3458 (ResolveNode::evaluate):
3459 (FunctionCallResolveNode::evaluate):
3460 (PostfixResolveNode::evaluate):
3461 (DeleteResolveNode::evaluate):
3462 (TypeOfResolveNode::evaluate):
3463 (PrefixResolveNode::evaluate):
3464 (AssignResolveNode::evaluate):
3465 (VarDeclNode::evaluate):
3466 (VarDeclNode::processVarDecls):
3467 (DoWhileNode::execute):
3468 (WhileNode::execute):
3470 (ForInNode::execute):
3471 (ContinueNode::execute):
3472 (BreakNode::execute):
3473 (ReturnNode::execute):
3474 (WithNode::execute):
3475 (SwitchNode::execute):
3476 (LabelNode::execute):
3478 (FuncDeclNode::processFuncDecl):
3479 (FuncExprNode::evaluate):
3481 2006-06-07 Geoffrey Garen <ggaren@apple.com>
3483 Removed API directory I prematurely/accidentally added.
3487 2006-06-05 Mitz Pettel <opendarwin.org@mitzpettel.com>
3489 Reviewed and landed by Geoff.
3491 - fix a regression in ecma_3/String/regress-104375.js
3493 * kjs/string_object.cpp:
3494 (substituteBackreferences): If a 2-digit back reference is out of range,
3495 parse it as a 1-digit reference (followed by the other digit). This matches
3498 2006-06-05 Geoffrey Garen <ggaren@apple.com>
3501 Darin already reviewed this change on the branch. See <rdar://problem/4317701>.
3503 - Fixed <rdar://problem/4291345> PCRE overflow in Safari JavaScriptCore
3505 No test case because there's no behavior change.
3507 * pcre/pcre_compile.c:
3508 (read_repeat_counts): Check for integer overflow / out of bounds
3510 2006-06-05 Geoffrey Garen <ggaren@apple.com>
3514 - Changed CString length from int to size_t. We sould probably do this
3515 for UString, too. (Darin, if you're reading this: Maciej said so.)
3520 (KJS::CString::CString):
3523 (KJS::CString::size):
3525 2006-06-04 Geoffrey Garen <ggaren@apple.com>
3529 - http://bugs.webkit.org/show_bug.cgi?id=9304
3530 Minor cleanup in JavaScriptCore
3532 * kjs/value.h: Removed redundant declarations
3534 2006-06-04 Darin Adler <darin@apple.com>
3538 - changed deleteAllValues so it can work on "const" collections
3539 Deleting the values affects the values, not the pointers in the
3540 collection, so it's legitimate to do it to a const collection,
3541 and a case of that actually came up in the XPath code.
3544 (WTF::deleteAllPairSeconds): Use const iterators.
3545 (WTF::deleteAllValues): Take const HashMap reference as a parameter.
3547 (WTF::deleteAllValues): Take const HashSet reference as a parameter,
3548 and use const iterators.
3550 (WTF::deleteAllValues): Take const Vector reference as a parameter.
3552 - added more functions that are present in <math.h> on some platforms,
3553 but not on others; moved here from various files in WebCore
3564 2006-06-02 Mitz Pettel <opendarwin.org@mitzpettel.com>