1 2006-09-11 Brady Eidson <beidson@apple.com>
3 Build fix - I think Tim's last checkin wasn't tested on Tiger, possibly. I simply
4 commented out the undefined constants until he can have a chance to make the right call
6 * bindings/objc/objc_utility.mm:
7 (KJS::Bindings::objcValueTypeForType): Commented out undefined symbols
9 2006-09-11 Timothy Hatcher <timothy@apple.com>
11 Reviewed by Tim O. and Darin.
13 Add support for more method signatures affecting ObjC methods called from JavaScript:
14 - Added unsigned types and long long.
15 - Allow methods that use const, oneway, bycopy and byref type modifiers.
17 * bindings/objc/objc_instance.mm:
18 (ObjcInstance::invokeMethod):
19 * bindings/objc/objc_utility.h:
21 * bindings/objc/objc_utility.mm:
22 (KJS::Bindings::convertValueToObjcValue):
23 (KJS::Bindings::convertObjcValueToValue):
24 (KJS::Bindings::objcValueTypeForType):
26 2006-09-05 Timothy Hatcher <timothy@apple.com>
30 <rdar://problem/4715840> SEL is not char*
32 * bindings/objc/objc_class.mm:
33 (KJS::Bindings::ObjcClass::methodsNamed): use sel_getName instead of a char* cast.
34 * bindings/objc/objc_runtime.mm:
35 (ObjcFallbackObjectImp::callAsFunction): ditto
37 2006-09-03 Alexey Proskuryakov <ap@nypop.com>
41 http://bugzilla.opendarwin.org/show_bug.cgi?id=10693
42 Convert JavaScript arrays to AppleScript lists
44 * JavaScriptCore.exp: Export ArrayInstance::info and ArrayInstance::getItem().
45 * kjs/array_instance.h:
46 * kjs/array_object.cpp:
47 (ArrayInstance::getItem): Added a method to access array items from C++.
49 2006-09-02 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
53 Bug 10454: Unix bakefile fixes
54 http://bugzilla.opendarwin.org/show_bug.cgi?id=10454
56 * JavaScriptCoreSources.bkl:
58 2006-09-01 Nikolas Zimmermann <zimmermann@kde.org>
60 Reviewed by hyatt. Landed by eseidel.
64 * pcre/CMakeLists.txt: Add wtf/ include.
66 2006-09-01 Nikolas Zimmermann <zimmermann@kde.org>
68 Reviewed and landed by ap.
70 Fix build on Linux (C89 without gcc extensions enabled).
72 * pcre/pcre_internal.h: Use C style comments.
73 * wtf/Assertions.h: Use C style comments.
74 * wtf/Platform.h: Use C style comments.
76 2006-09-01 Steve Falkenburg <sfalken@apple.com>
80 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
81 * JavaScriptCore.vcproj/dftables/dftables.vcproj:
83 2006-08-31 Anders Carlsson <acarlsson@apple.com>
87 Add new portability functions to MathExtras.h and add StringExtras.h which is for
88 string portability functions.
90 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
91 * bindings/c/c_instance.cpp:
92 * kjs/date_object.cpp:
96 * wtf/StringExtras.h: Added.
100 2006-08-31 Anders Carlsson <acarlsson@apple.com>
106 * JavaScriptCore.vcproj/dftables/dftables.vcproj:
107 * pcre/pcre_internal.h:
109 2006-08-31 Timothy Hatcher <timothy@apple.com>
113 Band-aid fix for PCRE to compile for ppc64 and x86_64 now that
114 we use -Wshorten-64-to-32. Adds an INT_CAST macro that ASSERTs
115 the value <= INT_MAX.
117 I filed <rdar://problem/4712064> to track the need to verify
118 PCRE's 64-bit compliance.
120 * pcre/pcre_compile.c:
129 (pcre_get_substring_list):
130 * pcre/pcre_internal.h:
131 * pcre/pcre_tables.c:
132 * pcre/pcre_try_flipped.c:
135 2006-08-30 Darin Adler <darin@apple.com>
137 Reviewed by Tim Hatcher.
139 - add WTF::getPtr, a function template that makes it possible to write
140 generic code that gets a raw pointer out of any of our pointer types
142 * JavaScriptCore.xcodeproj/project.pbxproj:
143 * wtf/GetPtr.h: Added.
144 * wtf/ListRefPtr.h: (WTF::getPtr): Added.
145 * wtf/OwnArrayPtr.h: (WTF::getPtr): Added.
146 * wtf/OwnPtr.h: (WTF::getPtr): Added.
147 * wtf/PassRefPtr.h: (WTF::getPtr): Added.
148 * wtf/RefPtr.h: (WTF::getPtr): Added.
150 2006-08-29 waylonis <waylonis@google.com>
152 Reviewed, tweaked by ggaren.
154 - Added storage and accessor functions for ExecState as a fix for
155 http://bugzilla.opendarwin.org/show_bug.cgi?id=10114
158 (KJS::ExecState::ExecState):
161 (KJS::Context::setExecState):
162 (KJS::Context::execState):
164 2006-08-30 Nikolas Zimmermann <zimmermann@kde.org>
168 Commit KDE related tweaks, to be able to
169 differentiate between a Qt-only or a KDE build.
171 * CMakeLists.txt: Install wtf-unity library.
172 * wtf/Platform.h: Add define for the KDE platform.
174 2006-08-28 Darin Adler <darin@apple.com>
178 * kjs/list.h: Use explicit in constructor (as appropriate).
180 2006-08-24 Nikolas Zimmermann <zimmermann@kde.org>
182 Reviewed, tweaked and landed by ap
184 http://bugzilla.opendarwin.org/show_bug.cgi?id=10467
185 WebKit should have Qt platform support (Part II)
187 * CMakeLists.txt: Adjust to Anders' build fixes.
188 * wtf/Platform.h: Fix define for the Qt platform (we don't use/need Cairo.)
190 2006-08-23 David Hyatt <hyatt@apple.com>
192 Fix Platform.h to include #defines for graphics features.
196 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
199 2006-08-23 Anders Carlsson <acarlsson@apple.com>
203 Make the bindings compile without CoreFoundation.
205 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
206 * bindings/c/c_instance.cpp:
207 * bindings/c/c_utility.cpp:
208 (KJS::Bindings::convertUTF8ToUTF16):
210 * bindings/runtime.cpp:
211 (KJS::Bindings::Instance::createBindingForLanguageInstance):
212 (KJS::Bindings::Instance::createLanguageInstanceForValue):
213 * bindings/runtime_root.cpp:
214 * bindings/runtime_root.h:
215 * kjs/interpreter.cpp:
216 (KJS::Interpreter::createLanguageInstanceForValue):
219 2006-08-22 Anders Carlsson <acarlsson@apple.com>
223 Move the npruntime code over to using HashMap and the runtime_root code over to using
224 HashMap and HashCountedSet.
226 * bindings/NP_jsobject.cpp:
227 * bindings/c/c_utility.cpp:
228 (KJS::Bindings::identifierFromNPIdentifier):
229 * bindings/c/c_utility.h:
230 * bindings/jni/jni_jsobject.cpp:
231 (JavaJSObject::invoke):
232 * bindings/npruntime.cpp:
233 (getStringIdentifierMap):
234 (getIntIdentifierMap):
235 (_NPN_GetStringIdentifier):
236 (_NPN_GetIntIdentifier):
237 * bindings/runtime_root.cpp:
238 (getReferencesByRootMap):
240 (KJS::Bindings::findReferenceSet):
241 (KJS::Bindings::rootForImp):
242 (KJS::Bindings::rootForInterpreter):
243 (KJS::Bindings::addNativeReference):
244 (KJS::Bindings::removeNativeReference):
245 (RootObject::removeAllNativeReferences):
246 * bindings/runtime_root.h:
248 2006-08-22 Anders Carlsson <acarlsson@apple.com>
252 Switch over the NPAPI and Java bindings to using HashMaps instead of dictionaries.
254 * JavaScriptCore.xcodeproj/project.pbxproj:
255 * bindings/c/c_class.cpp:
256 (KJS::Bindings::CClass::CClass):
257 (KJS::Bindings::CClass::~CClass):
258 (KJS::Bindings::CClass::classForIsA):
259 (KJS::Bindings::CClass::methodsNamed):
260 (KJS::Bindings::CClass::fieldNamed):
261 * bindings/c/c_class.h:
262 * bindings/jni/jni_class.cpp:
263 (JavaClass::JavaClass):
264 (JavaClass::~JavaClass):
265 (JavaClass::methodsNamed):
266 (JavaClass::fieldNamed):
267 * bindings/jni/jni_class.h:
268 * bindings/objc/objc_class.h:
269 * bindings/objc/objc_class.mm:
270 (KJS::Bindings::deleteMethod):
271 (KJS::Bindings::deleteField):
273 (KJS::Bindings::ObjcClass::methodsNamed):
274 (KJS::Bindings::ObjcClass::fieldNamed):
275 * bindings/runtime.cpp:
276 * bindings/runtime.h:
277 * bindings/runtime_object.cpp:
278 (RuntimeObjectImp::fieldGetter):
279 (RuntimeObjectImp::getOwnPropertySlot):
280 (RuntimeObjectImp::put):
281 (RuntimeObjectImp::canPut):
283 2006-08-21 Vladimir Olexa <vladimir.olexa@gmail.com>
287 http://bugzilla.opendarwin.org/show_bug.cgi?id=6252
288 JavaScript 1.6 Array.lastIndexOf
290 Test: fast/js/array-lastIndexOf.html
292 * kjs/array_object.cpp:
293 (ArrayProtoFunc::callAsFunction): Added a LastIndexOf case.
294 * kjs/array_object.h:
295 (KJS::ArrayProtoFunc::): Added LastIndexOf to enum.
296 * tests/mozilla/expected.html: Two more tests now pass.
298 2006-08-20 Nikolas Zimmermann <zimmermann@kde.org>
300 Reviewed by Maciej. Landed by rwlbuis.
302 Fixes parts of: http://bugzilla.opendarwin.org/show_bug.cgi?id=10463
303 WebKit should have Qt platform support
305 Removing obsolete QConstString/QString constructors in kjs code.
310 2006-08-17 Nikolas Zimmermann <zimmermann@kde.org>
312 Reviewed by Maciej. Landed by rwlbuis.
314 Fixes: http://bugzilla.opendarwin.org/show_bug.cgi?id=10463
315 WTF Changes needed for Qt platform code.
318 * wtf/unicode/UnicodeDecomposition.h: Added.
320 * wtf/unicode/UnicodeDirection.h: Added.
322 * wtf/unicode/qt4/UnicodeQt4.cpp: Added.
323 (WTF::Unicode::direction):
324 (WTF::Unicode::category):
325 (WTF::Unicode::decomposition):
326 * wtf/unicode/qt4/UnicodeQt4.h:
327 (WTF::Unicode::toLower):
328 (WTF::Unicode::toUpper):
329 (WTF::Unicode::isPrintableChar):
330 (WTF::Unicode::isSpace):
331 (WTF::Unicode::isPunct):
332 (WTF::Unicode::isDigit):
333 (WTF::Unicode::mirroredChar):
334 (WTF::Unicode::compare):
336 2006-08-17 Nikolas Zimmermann <zimmermann@kde.org>
338 Reviewed by Eric. Landed by rwlbuis.
340 Fixes: http://bugzilla.opendarwin.org/show_bug.cgi?id=10464
341 Offer a cmake build system for Qt platform.
343 * CMakeLists.txt: Added.
344 * pcre/CMakeLists.txt: Added.
346 2006-08-17 Anders Carlsson <acarlsson@apple.com>
353 2006-08-15 Steve Falkenburg <sfalken@apple.com>
359 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
362 2006-08-15 Mark Rowe <opendarwin.org@bdash.net.nz>
366 Build fix: DWARF and -gfull are incompatible with symbol separation.
368 * JavaScriptCore.xcodeproj/project.pbxproj:
370 2006-08-15 Mark Rowe <opendarwin.org@bdash.net.nz>
374 http://bugzilla.opendarwin.org/show_bug.cgi?id=10394
375 Bug 10394: WebKit Release and Production configurations should enable dead code stripping
377 * JavaScriptCore.xcodeproj/project.pbxproj:
379 2006-08-15 Mark Rowe <opendarwin.org@bdash.net.nz>
383 http://bugzilla.opendarwin.org/show_bug.cgi?id=10384
384 Bug 10384: Switch to DWARF for Release configuration
386 * JavaScriptCore.xcodeproj/project.pbxproj:
388 2006-08-13 Maks Orlovich <maksim@kde.org>
390 Reviewed (and tweaked a little) by Maciej.
392 - shrank the size of JSObject by 8 bytes and made the corresponding reduction to the cell size, resulting
393 in a 1.2% speed improvement on JS iBench (and probably overall memory savings).
395 This was done by removing _scope and _internalValue data members
396 from JSObject and moving them only to the subclasses that actually
400 (KJS::JSObject::mark): No need to mark scope or internal value here.
402 (KJS::JSObject::JSObject): Don't initialize them.
403 * kjs/JSWrapperObject.cpp: Added. New base class for object types that
404 wrap primitive values (Number, String, Boolean, Date).
405 (KJS::JSWrapperObject::mark):
406 * kjs/JSWrapperObject.h: Added.
407 (KJS::JSWrapperObject::JSWrapperObject):
408 (KJS::JSWrapperObject::internalValue):
409 (KJS::JSWrapperObject::setInternalValue):
410 * kjs/array_object.cpp:
411 (ArrayPrototype::ArrayPrototype): Don't set useless internal value.
412 * kjs/bool_object.cpp:
413 (BooleanInstance::BooleanInstance): Inherit from JSWrapperObject.
414 (BooleanProtoFunc::callAsFunction): Fixed to account for fact that not all
415 JSObjects have an internal value.
416 (BooleanObjectImp::construct): ditto.
418 * kjs/collector.cpp: Lowered cell size to 48.
419 (KJS::Collector::allocate): meaningless whitespace change
420 * kjs/date_object.cpp:
421 (KJS::DateInstance::DateInstance): Inherit from JSWrapperObject.
422 (KJS::DateProtoFunc::callAsFunction): adjusted for move of internalValue
423 (KJS::DateObjectImp::construct): ditto
425 * kjs/error_object.cpp:
426 (ErrorPrototype::ErrorPrototype): don't set internal value
427 * kjs/function.cpp: move _scope and related handling here
428 (KJS::FunctionImp::mark): mark scope
430 (KJS::FunctionImp::scope): moved here from JSObject
431 (KJS::FunctionImp::setScope): ditto
432 * kjs/number_object.cpp:
433 (NumberInstance::NumberInstance): inherit from JSWrapperObject
434 (NumberProtoFunc::callAsFunction): adjusted
435 (NumberObjectImp::construct): adjusted
436 * kjs/number_object.h: shring RegExp-related objects a little
437 * kjs/regexp_object.cpp:
438 (RegExpPrototype::RegExpPrototype): Adjust for size tweaks
439 (RegExpObjectImp::RegExpObjectImp): ditto
440 * kjs/regexp_object.h:
441 * kjs/string_object.cpp:
442 (StringInstance::StringInstance): inherit from JSWrapperObject
443 (StringProtoFunc::callAsFunction): adjusted
444 * kjs/string_object.h:
445 * JavaScriptCore.exp: Exported new methods as needed.
446 * JavaScriptCore.xcodeproj/project.pbxproj: Added new files to build.
448 2006-08-04 Brady Eidson <beidson@apple.com>
450 Reviewed by Geoff's rubber stamp
452 Fix a build break on Intel hardware causes by adapting stricter
453 compiler warnings (-Wshorten-64-to-32)
456 (assertEqualsAsNumber): manually cast some doubles to floats
459 2006-08-04 Sam Weinig <sam.weinig@gmail.com>
463 - patch for http://bugzilla.opendarwin.org/show_bug.cgi?id=10192
464 Make WebCore (and friends) compile with -Wshorten-64-to-32
466 * Adds -Wshorten-64-to-32 flag to Xcode project.
467 * Adds explicit casts where OK.
471 (JSNodeList_getProperty):
472 * JavaScriptCore.xcodeproj/project.pbxproj:
474 2006-08-04 Adam Roben <aroben@apple.com>
478 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Convert
481 2006-08-03 Sam Weinig <sam.weinig@gmail.com>
485 - patch for http://bugzilla.opendarwin.org/show_bug.cgi?id=10176
486 Make WebCore compile with -Wundef
488 * Adds -Wundef flag to Xcode project
489 * Converts #ifs to #ifdef and #ifndefs where needed.
490 * Added #define YYMAXDEPTH 10000 in kjs/grammar.y
491 to fix a warning from within Bison.
493 * JavaScriptCore.xcodeproj/project.pbxproj:
494 * bindings/jni/jni_jsobject.cpp:
495 (JavaJSObject::getSlot):
496 (JavaJSObject::setSlot):
498 * bindings/objc/objc_class.mm:
499 (KJS::Bindings::ObjcClass::methodsNamed):
500 (KJS::Bindings::ObjcClass::fieldNamed):
501 * bindings/objc/objc_instance.mm:
502 (ObjcInstance::invokeMethod):
503 * bindings/objc/objc_runtime.mm:
504 (ObjcMethod::getMethodSignature):
510 2006-08-03 Anders Carlsson <acarlsson@apple.com>
512 Reviewed by John Sullivan.
516 Return *this in operator=
518 2006-08-03 Adam Roben <aroben@apple.com>
522 - Fixed Windows build
524 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
525 * wtf/MathExtras.h: Implement inline versions of these functions
529 2006-08-02 Adam Roben <aroben@apple.com>
535 * kjs/date_object.cpp:
538 2006-07-29 Darin Adler <darin@apple.com>
540 - Removed tabs from these source files that still had them.
541 We don't use them; that way source files look fine in editors
542 that have tabs set to 8 spaces or to 4 spaces.
543 - Removed allow-tabs Subversion property from the files too.
545 * bindings/NP_jsobject.cpp:
546 * bindings/c/c_utility.cpp:
547 * bindings/jni/jni_runtime.cpp:
548 * bindings/jni/jni_utility.cpp:
549 * bindings/objc/objc_utility.mm:
550 * bindings/runtime.cpp:
551 * bindings/runtime_method.cpp:
552 * bindings/testbindings.cpp:
553 * bindings/testbindings.mm:
554 * kjs/date_object.cpp:
559 * kjs/string_object.cpp:
562 2006-07-29 Darin Adler <darin@apple.com>
564 * tests/mozilla/expected.html: Update test results now that regress-185165.js
565 is succeeding. I suspect Anders fix for bug 4620655 is the reason.
567 2006-07-29 Sam Weinig <sam.weinig@gmail.com>
571 - patch for http://bugzilla.opendarwin.org/show_bug.cgi?id=10080
572 Adopt pedantic changes from the Unity project to improve
573 cross-compiler compatibility
576 * Removing trailing semicolon from namespace braces.
577 * Removing trailing comma from last enum declaration.
578 * Updating to match style guidelines.
579 * Adding missing newline to the end of the file.
580 * Turning on gcc warning for missing newline at the end of a source file
581 (GCC_WARN_ABOUT_MISSING_NEWLINE in Xcode, -Wnewline in gcc).
582 * Alphabetical sorting of Xcode source list files.
583 * Replace use of non-portable variable-size array with Vector.
584 * Use C-style comments instead of C++ comments in files that might
585 be included by either C or C++ files.
587 * API/JSCallbackConstructor.cpp:
588 (KJS::JSCallbackConstructor::construct):
589 * API/JSCallbackFunction.cpp:
590 (KJS::JSCallbackFunction::callAsFunction):
591 * API/JSCallbackObject.cpp:
592 (KJS::JSCallbackObject::construct):
593 (KJS::JSCallbackObject::callAsFunction):
594 * JavaScriptCore.xcodeproj/project.pbxproj:
595 * JavaScriptCorePrefix.h:
596 * bindings/jni/jni_class.cpp:
597 (JavaClass::fieldNamed):
598 * bindings/jni/jni_class.h:
599 * bindings/jni/jni_instance.cpp:
600 (JavaInstance::JavaInstance):
601 (JavaInstance::valueOf):
602 * bindings/jni/jni_objc.mm:
603 (KJS::Bindings::dispatchJNICall):
604 * bindings/jni/jni_runtime.cpp:
605 (JavaParameter::JavaParameter):
606 (JavaArray::JavaArray):
607 * bindings/jni/jni_runtime.h:
608 * bindings/jni/jni_utility.h:
609 * bindings/objc/objc_instance.h:
610 * bindings/runtime_array.h:
616 2006-07-29 Mike Emmel <mike.emmel@gmail.com>
620 - fixes for Linux build
622 * JavaScriptCoreSources.bkl: Added new files to build, kjs/PropertyNameArray.cpp
623 and kjs/testkjs.cpp, and removed old files.
625 2006-07-24 Dan Waylonis <waylonis@google.com>
627 Reviewed and tweaked a bit by Darin.
629 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9902
630 jsNull and NSNull not properly converted between JS and ObjC
632 * bindings/objc/objc_utility.mm: (KJS::Bindings::convertObjcValueToValue):
633 Added case for converting NSNull to jsNull.
635 2006-07-24 Rob Buis <buis@kde.org>
639 http://bugzilla.opendarwin.org/show_bug.cgi?id=4258
640 Date().toString() only includes GMT offset, not timezone string
642 Use the info in tm_zone to append timezone abbreviation
643 to Date().toString().
645 * kjs/date_object.cpp:
648 2006-07-24 Rob Buis <buis@kde.org>
652 http://bugzilla.opendarwin.org/show_bug.cgi?id=5257
653 setYear() does not match FireFox/IE behavior
655 Make sure the right values end up in tm_year.
657 * kjs/date_object.cpp:
660 2006-07-23 Mark Rowe <opendarwin.org@bdash.net.nz>
664 Bug 9686: [Drosera] Need the ability to break into Drosera on Javascript exceptions
665 http://bugzilla.opendarwin.org/show_bug.cgi?id=9686
667 JavaScriptCore portion of the fix.
669 * JavaScriptCore.exp: Update symbol for change in argument type.
671 (Debugger::detach): Clear map of recent exceptions.
672 (Debugger::hasHandledException): Track the most recent exception
673 thrown by an interpreter.
674 (Debugger::exception): Change exception argument to a JSValue.
677 (Node::debugExceptionIfNeeded): Notify the debugger of an exception
678 if it hasn't seen it before.
679 (ThrowNode::execute): Notify the debugger that an exception is being thrown.
682 2006-07-23 Geoffrey Garen <ggaren@apple.com>
684 Patch by Eric Albert, reviewed by Darin and me.
686 - Fixed <rdar://problem/4645931> JavaScriptCore stack-scanning code
687 crashes (Collector::markStackObjectsConservatively)
689 * bindings/jni/jni_jsobject.cpp: On 64bit systems, jint is a long, not an
691 (JavaJSObject::getSlot):
692 (JavaJSObject::setSlot):
694 (KJS::Collector::markCurrentThreadConservatively): Use a pointer instead of
695 an int as 'dummy,' because on LP64 systems, an int is not pointer-aligned,
696 and we want to scan the stack for pointers.
697 * JavaScriptCore.xcodeproj/project.pbxproj: After a tense cease-fire, the
698 XCode war has started up again!
700 === Safari-521.20 ===
702 2006-07-21 Geoffrey Garen <ggaren@apple.com>
706 <rdar://problem/4507265> REGRESSION: overlays don't work on HousingMaps.com (Google Maps-based site)
708 - Added support for strings that masquerade as undefined. Currently used
709 by WebCore to implement undetectable style.filter.
711 The name is a little long, but it's only used in one line of code, so I
712 thought clarity should win over brevity.
714 * JavaScriptCore.exp:
715 * JavaScriptCore.xcodeproj/project.pbxproj:
717 * kjs/string_object.h:
718 (KJS::StringInstanceThatMasqueradesAsUndefined::StringInstanceThatMasqueradesAsUndefined):
719 (KJS::StringInstanceThatMasqueradesAsUndefined::masqueradeAsUndefined):
720 (KJS::StringInstanceThatMasqueradesAsUndefined::toBoolean):
722 === Safari-521.19 ===
724 2006-07-20 Steve Falkenburg <sfalken@apple.com>
729 (KJS::escapeStringForPrettyPrinting):
731 2006-07-19 Anders Carlsson <acarlsson@apple.com>
735 <rdar://problem/4620655> REGRESSION(10.4.7-10.5): preview button for a blogger.com post doesn't work
737 * kjs/nodes2string.cpp:
738 (StringNode::streamTo):
739 Return the escaped string.
741 (RegExpNode::streamTo):
742 Use the correct syntax.
745 (KJS::escapeStringForPrettyPrinting):
747 Add escape function which escapes a string for pretty-printing so it can be parsed again.
749 * wtf/unicode/icu/UnicodeIcu.h:
750 (WTF::Unicode::isPrintableChar):
753 2006-07-18 Maciej Stachowiak <mjs@apple.com>
755 Reviewed by Adele Peterson.
757 <rdar://problem/4589530> REGRESSION: null character in JS string causes parse error (works in Tiger and in other browsers)
766 2006-07-18 Tim Omernick <timo@apple.com>
768 Reviewed by Tim Hatcher.
770 Removed a misleading comment; we recently added support for the NPNVPluginElementNPObject
775 === Safari-521.18 ===
777 2006-07-18 Timothy Hatcher <timothy@apple.com>
779 Made the following headers public:
788 * JavaScriptCore.xcodeproj/project.pbxproj:
790 2006-07-17 Geoffrey Garen <ggaren@apple.com>
794 - Added automatic prototype creation for classes.
796 A class stores a weak reference to a prototype, which is cleared when
797 the prototype is garbage collected, to avoid a reference cycle.
799 We now have an attributes field in JSClassDefinition, that currently is
800 used only to override automatic prototype creation when you want to manage your
801 own prototypes, but can be extended in the future for other nefarious purposes.
803 Similarly, we have JSObjectMake and JSObjectMakeWithPrototype, the latter
804 allowing you to manage your own prototypes.
806 JSObjectMakeConstructor is more interesting now, able to make a constructor
807 on your behalf if you just give it a class.
809 - Removed bogus old code from minidom.js.
811 - Tweaked the headerdocs.
813 - Added more GC testing, which caught some leaks, and tested more funny
814 edge cases in lookup, which caught a lookup bug. Removed some testing
815 we used to do with MyObject because it was redundant with the new, cool
818 While fixing the lookup bug I retracted this change:
820 "If a static setProperty callback returns 'false', to indicate that the
821 property was not set, we no longer forward the set request up the class
822 chain, because that's almost certainly not what the programmer expected."
824 Returning false when setting a static property is a little silly, but you can see
825 it being useful when shadowing a base class's static properties, and, regardless
826 of usefullness, this is the defined behavior of the setProperty callback.
828 - Plus a little ASCII art, for the kids.
830 2006-07-17 Timothy Hatcher <timothy@apple.com>
834 <rdar://problem/4634874> WebScriptObject and WebUndefined are no longer defined by WebKit
836 Moves WebScriptObject and WebUndefined up to WebCore.
837 This change does create an upwards-dependancy on WebScriptObject existing
838 in the loaded process, but this code path in JavaScriptCore does not get used
839 unless it is through WebKit/WebCore. Moving all of the binding code out of
840 JavaScriptCore might make sense in the future.
842 * JavaScriptCore.exp:
843 * JavaScriptCore.xcodeproj/project.pbxproj:
844 * bindings/objc/WebScriptObject.h: Replaced.
845 * bindings/objc/WebScriptObject.mm: Removed.
846 * bindings/objc/WebScriptObjectPrivate.h: Removed.
847 * bindings/objc/objc_class.h:
848 * bindings/objc/objc_instance.h:
849 * bindings/objc/objc_instance.mm:
850 (ObjcInstance::~ObjcInstance):
851 * bindings/objc/objc_runtime.h:
852 * bindings/objc/objc_runtime.mm:
853 (convertValueToObjcObject):
854 * bindings/objc/objc_utility.mm:
855 (KJS::Bindings::convertValueToObjcValue):
856 (KJS::Bindings::convertObjcValueToValue):
857 (KJS::Bindings::createObjcInstanceForValue):
859 2006-07-17 Darin Adler <darin@apple.com>
861 * API/JSBase.h: Fix comment formatting where things used to be lined up but
862 are now ragged. Got rid of spaces that attempted to line things up.
863 * API/JSObjectRef.h: Ditto. Also add missing periods for a couple of comments.
865 2006-07-17 Geoffrey Garen <ggaren@apple.com>
869 - Removed the exception parameter from the initialize callback and, by extension,
870 JSObjectMake. We have never had a need for exceptions when iniitializing,
871 so the parameter seemed likely to "get in the way."
873 Also, an exception in JavaScript is thrown in response to input --
874 "invalid URL", "index not a number", etc., so it's the job of the
875 constructor function, not the initialize method, to throw.
877 If initialize *really* wants to throw, it can communicate the throw to
878 the constructor through the constructed object's private data (e.g., set
879 it to NULL, signaling to the consntructor that initialization failed.)
881 - Added JSObjectMakeWithData, which enables a constructor to set private
882 data on an object *before* it has been initialized. That way, the initialize
883 methods can properly operate on the data.
885 * API/JSNode.c: Moved ref into the initialize method, for better encapsulation,
886 now that it's possible.
887 * API/JSNodeList.c: ditto
889 (main): Do more aggressive garbage collection to test ref/deref and
891 * API/minidom.js: store childNodes in a temporary so it doesn't get re-created
892 like a thousand times. This makes debugging ref/deref easier
894 2006-07-17 Geoffrey Garen <ggaren@apple.com>
898 - Changed the initialize callback to run from least derived class (parent
899 class) to most derived class. This enables C++ style initialization,
900 and derived class overriding of member data.
902 - Added excpetion propopgation to JSObjectMake, to support initialize
903 exceptions, and generally round out our policy of making function
904 signatures as long as possible.
906 * API/JSCallbackObject.h: Use ExecState instead of ContextRef, cuz we're
909 2006-07-17 Geoffrey Garen <ggaren@apple.com>
913 - Changed JSObjectMakeConstructor to JSObjectMakeConstructorWithCallback,
914 to match JSObjectMakeFunctionWithCallback.
916 - Added prototype parameter, so the generated constructor
917 automatically works with hasInstance / instanceof
919 - Moved hasInstance implementation from InternalFunctionImp to JSObject
920 so that subclasses can inherit it without inheriting function-related baggage.
921 More refactoring here would be good, but this seems like a good short-term
924 (KJS::JSCallbackFunction::implementsHasInstance): override and return false,
925 because callback functions aren't constructors.
927 2006-07-17 Maciej Stachowiak <mjs@apple.com>
931 - add a JSContextRef parameter to all JSValueRef, JSObjectRef, and JSContextRef operations;
932 except JSObject{Get,Set}PrivateData which can be assumed to be simple pure accessors.
934 Also renamed the parameter "context" to "ctx" because it makes the code read better with this pervasive
935 but usually uninteresting parameter.
939 (JSCheckScriptSyntax):
942 * API/JSCallbackObject.cpp:
943 (KJS::JSCallbackObject::JSCallbackObject):
944 (KJS::JSCallbackObject::init):
945 (KJS::JSCallbackObject::getOwnPropertySlot):
946 (KJS::JSCallbackObject::put):
947 (KJS::JSCallbackObject::deleteProperty):
948 (KJS::JSCallbackObject::toNumber):
949 (KJS::JSCallbackObject::toString):
950 * API/JSContextRef.cpp:
951 (JSGlobalContextCreate):
952 (JSGlobalContextRetain):
953 (JSGlobalContextRelease):
954 (JSContextGetGlobalObject):
955 * API/JSContextRef.h:
957 (JSNodePrototype_appendChild):
958 (JSNodePrototype_removeChild):
959 (JSNodePrototype_replaceChild):
960 (JSNode_getNodeType):
961 (JSNode_getFirstChild):
964 (JSNodeListPrototype_item):
966 (JSNodeList_getProperty):
967 (JSNodeList_prototype):
968 * API/JSObjectRef.cpp:
970 (JSObjectMakeFunctionWithCallback):
971 (JSObjectMakeConstructor):
972 (JSObjectMakeFunction):
973 (JSObjectGetPrototype):
974 (JSObjectSetPrototype):
975 (JSObjectHasProperty):
976 (JSObjectGetProperty):
977 (JSObjectSetProperty):
978 (JSObjectGetPropertyAtIndex):
979 (JSObjectSetPropertyAtIndex):
980 (JSObjectDeleteProperty):
981 (JSObjectIsFunction):
982 (JSObjectCallAsFunction):
983 (JSObjectIsConstructor):
984 (JSObjectCallAsConstructor):
985 (JSObjectCopyPropertyNames):
987 * API/JSStringRef.cpp:
988 * API/JSValueRef.cpp:
990 (JSValueIsUndefined):
996 (JSValueIsObjectOfClass):
998 (JSValueIsStrictEqual):
999 (JSValueIsInstanceOfConstructor):
1000 (JSValueMakeUndefined):
1002 (JSValueMakeBoolean):
1003 (JSValueMakeNumber):
1004 (JSValueMakeString):
1007 (JSValueToStringCopy):
1015 (MyObject_getProperty):
1016 (MyObject_deleteProperty):
1017 (MyObject_callAsFunction):
1018 (MyObject_callAsConstructor):
1019 (MyObject_convertToType):
1020 (print_callAsFunction):
1023 2006-07-16 Geoffrey Garen <ggaren@apple.com>
1025 Approved by Maciej, RS by Beth.
1027 JSObjectMakeFunction -> JSObjectMakeFunctionWithCallback
1028 JSObjectMakeFunctionWithBody -> JSObjectMakeFunction
1030 because the latter is more common, and more fundamental, than the former.
1035 * API/JSCallbackObject.cpp:
1036 (KJS::JSCallbackObject::getOwnPropertySlot):
1037 (KJS::JSCallbackObject::put):
1038 (KJS::JSCallbackObject::deleteProperty):
1039 (KJS::JSCallbackObject::getPropertyNames):
1040 (KJS::JSCallbackObject::staticValueGetter):
1041 (KJS::JSCallbackObject::staticFunctionGetter):
1042 * API/JSClassRef.cpp:
1043 (OpaqueJSClass::OpaqueJSClass):
1044 (OpaqueJSClass::~OpaqueJSClass):
1046 * API/JSObjectRef.cpp:
1048 (JSObjectMakeFunctionWithCallback):
1049 (JSObjectMakeFunction):
1050 (OpaqueJSPropertyNameArray::OpaqueJSPropertyNameArray):
1051 (JSObjectCopyPropertyNames):
1052 * API/JSObjectRef.h:
1058 * JavaScriptCore.exp:
1060 2006-07-16 Geoffrey Garen <ggaren@apple.com>
1064 Replace __JS with OpaqueJS because the former, while used by CF, is
1065 a prefix that's triply-reserved by the compiler. (_* is reserved in global
1066 names, _[A-Z] is reserved in all names, and __ is reserved in all names
1069 Opaque is an alternative used by other Mac OS X framewokrs.
1074 * API/JSCallbackObject.cpp:
1075 (KJS::JSCallbackObject::getOwnPropertySlot):
1076 (KJS::JSCallbackObject::put):
1077 (KJS::JSCallbackObject::deleteProperty):
1078 (KJS::JSCallbackObject::getPropertyNames):
1079 (KJS::JSCallbackObject::staticValueGetter):
1080 (KJS::JSCallbackObject::staticFunctionGetter):
1081 * API/JSClassRef.cpp:
1082 (OpaqueJSClass::OpaqueJSClass):
1083 (OpaqueJSClass::~OpaqueJSClass):
1085 * API/JSObjectRef.cpp:
1087 (OpaqueJSPropertyNameArray::OpaqueJSPropertyNameArray):
1088 (JSObjectCopyPropertyNames):
1090 2006-07-16 Darin Adler <darin@apple.com>
1092 - try to fix Windows build
1094 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1095 Added some recently added files, removed some recently removed.
1097 2006-07-16 Geoffrey Garen <ggaren@apple.com>
1101 - Change getProperty* to return undefined, rather than NULL, for missing
1102 properties, since that's what the spec says. Also added exception out
1103 parameters to the *Index functions, because they can call through to the
1104 regular functions, which can throw for custom objects.
1106 * API/JSObjectRef.cpp:
1107 (JSObjectGetProperty):
1108 (JSObjectGetPropertyAtIndex):
1109 (JSObjectSetPropertyAtIndex):
1110 * API/JSObjectRef.h:
1114 2006-07-16 Geoffrey Garen <ggaren@apple.com>
1118 - Properly document and handle NULL callbacks for static properties. We
1119 throw an exception in any case other than a ReadOnly property with a NULL
1120 setProperty callback, because a NULL callback almost certainly indicates
1121 a programming error. Also throw an exception if hasProperty returns true
1122 for a property that getProperty can't get.
1124 - If a static setProperty callback returns 'false', to indicate that the
1125 property was not set, we no longer forward the set request up the class
1126 chain, because that's almost certainly not what the programmer expected.
1128 * API/JSCallbackObject.cpp:
1129 (KJS::JSCallbackObject::getOwnPropertySlot):
1130 (KJS::JSCallbackObject::put):
1131 (KJS::JSCallbackObject::staticValueGetter):
1132 (KJS::JSCallbackObject::staticFunctionGetter):
1133 (KJS::JSCallbackObject::callbackGetter):
1134 * API/JSObjectRef.h:
1137 (MyObject_hasProperty):
1140 2006-07-16 Geoffrey Garen <ggaren@apple.com>
1144 - Added names to functions.
1146 - Removed GetPrivate/SetPrivate from callbackFunctions and callbackConstructors.
1147 The private data idiom is that a JS object stores its native implementation
1148 as private data. For functions and constructors, the native implementation is nothing
1149 more than the callback they already store, so supporting private data, too,
1150 confuses the idiom. If you *really* want, you can still create a custom
1151 function with private data.
1153 * API/JSCallbackConstructor.cpp:
1154 * API/JSCallbackConstructor.h:
1155 * API/JSCallbackFunction.cpp:
1156 (KJS::JSCallbackFunction::JSCallbackFunction):
1157 * API/JSCallbackFunction.h:
1158 * API/JSCallbackObject.cpp:
1159 (KJS::JSCallbackObject::staticFunctionGetter):
1160 * API/JSObjectRef.cpp:
1161 (JSObjectMakeFunction):
1162 (JSObjectMakeFunctionWithBody):
1163 (JSObjectGetPrivate):
1164 (JSObjectSetPrivate):
1165 * API/JSObjectRef.h:
1171 2006-07-15 Maciej Stachowiak <mjs@apple.com>
1175 - switch property lists to be vector+set of Identifiers instead of list of References
1177 This has the following benefits:
1179 - no duplicates in property lists
1180 - simplifies API calls
1181 - probably more efficient, since linked list is gone
1182 - entirely removed Reference, ReferenceList and ProtectedReference types from the API
1184 * kjs/PropertyNameArray.cpp: Added.
1185 (KJS::PropertyNameArray::add): Check set, if not already there, add to
1187 * kjs/PropertyNameArray.h: Added.
1188 (KJS::PropertyNameArray::PropertyNameArray): Newly added type, combines
1189 a set and a vector to make a unique but ordered list of identifiers.
1190 (KJS::PropertyNameArray::begin): ditto
1191 (KJS::PropertyNameArray::end): ditto
1192 (KJS::PropertyNameArray::size): ditto
1193 (KJS::PropertyNameArray::operator[]): ditto
1194 * kjs/array_instance.h:
1195 * kjs/array_object.cpp:
1196 (ArrayInstance::getPropertyNames): renamed from getPropertyList, updated
1197 for PropertyNameArray
1198 (ArrayInstance::setLength): updated for PropertyNameArray
1199 (ArrayInstance::pushUndefinedObjectsToEnd): ditto
1201 (ForInNode::execute): updated for PropertyNameArray
1204 (KJS::JSObject::getPropertyNames): renamed from getPropertyList, updated
1205 for PropertyNameArray
1207 * kjs/property_map.cpp:
1208 (KJS::PropertyMap::getEnumerablePropertyNames): updated for PropertyNameArray
1209 (KJS::PropertyMap::getSparseArrayPropertyNames): ditto
1210 * kjs/property_map.h:
1211 * kjs/protected_reference.h: Removed.
1212 * kjs/reference.cpp: Removed.
1213 * kjs/reference.h: Removed.
1214 * kjs/reference_list.cpp: Removed.
1215 * kjs/reference_list.h: Removed.
1216 * kjs/scope_chain.cpp:
1217 (KJS::ScopeChain::print): Use PropertyNamesArray instead of ReferenceList.
1218 * kjs/string_object.cpp:
1219 (StringInstance::getPropertyNames): Updated for new approach.
1220 * kjs/string_object.h:
1223 (toJS): Added overload for PropertyNameAccumulatorRef / PropertyNameArray*
1226 * API/JSCallbackObject.cpp:
1227 (KJS::JSCallbackObject::getPropertyNames): Fixed for new API.
1228 * API/JSCallbackObject.h:
1229 * API/JSObjectRef.cpp:
1230 (__JSPropertyNameArray::__JSPropertyNameArray): Type used for a publicly vended
1231 JSPropertyNameArrayRef.
1232 (JSObjectCopyPropertyNames): New API call - renamed / refactored from
1233 JSObjectCreatePropertyList
1234 (JSPropertyNameArrayRetain): new retain call for JSPropertyNameArray.
1235 (JSPropertyNameArrayRelease): new release call for - " -.
1236 (JSPropertyNameArrayGetCount): Instead of having to use a stateful enumerator you
1237 can now get the count and items in any order.
1238 (JSPropertyNameArrayGetNameAtIndex): See above.
1239 (JSPropertyNameAccumulatorAddName): What you add properties to is now an opaque
1241 * API/JSObjectRef.h: Prototyped new functions, removed old ones
1242 * JavaScriptCore.exp: Updated exported symbols.
1243 * JavaScriptCore.xcodeproj/project.pbxproj: Added new files, removed old.
1245 (MyObject_getPropertyNames): Renamed / fixed callback to fit new paradigm.
1246 (main): Updated for new API.
1248 2006-07-15 Darin Adler <darin@apple.com>
1250 - oops, missed a few more arrays that had to be const
1253 (JSNodePrototype_appendChild): Added const.
1254 (JSNodePrototype_removeChild): Ditto.
1255 (JSNodePrototype_replaceChild): Ditto.
1256 (JSNode_construct): Ditto.
1258 (JSNodeListPrototype_item): Ditto.
1259 * API/JSObjectRef.cpp:
1260 (JSObjectMakeFunctionWithBody): Ditto.
1261 (JSObjectCallAsFunction): Ditto.
1262 (JSObjectCallAsConstructor): Ditto.
1266 (MyObject_callAsFunction): Ditto.
1267 (MyObject_callAsConstructor): Ditto.
1268 (print_callAsFunction): Ditto.
1269 (myConstructor_callAsConstructor): Ditto.
1271 2006-07-15 Darin Adler <darin@apple.com>
1275 * API/JSNode.h: Made an array parameter const.
1276 * API/JSObjectRef.h: Made array parameters const. Fixed a comment.
1278 2006-07-15 Geoffrey Garen <ggaren@apple.com>
1282 - JSObjectMakeFunctionWithBody includes a function name and named parameters now.
1284 * API/JSObjectRef.cpp:
1285 (JSObjectMakeFunctionWithBody):
1286 * API/JSObjectRef.h:
1288 (assertEqualsAsUTF8String): More informative failure reporting.
1289 (main): Test more function cases.
1291 2006-07-15 Geoffrey Garen <ggaren@apple.com>
1295 - Moved the arguments passed to JSClassCreate into a single structure,
1296 called JSClassDefinition. This will enable easier structure
1297 migration/versioning in the future, if necessary.
1299 - Added support for class names.
1301 - kJSClassDefinitionNull replaces kJSObjectCallbacksNone.
1303 - JSClass is becoming a fairly complex struct, so I migrated all of its
1304 implementation other than reference counting to the sruct.
1306 - Also moved JSClass* functions in the API to JSObjectRef.cpp, since they're
1307 declared in JSObjectRef.h
1309 - Also added some more informative explanation to the class structure doc.
1311 2006-07-15 Darin Adler <darin@apple.com>
1315 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8395
1316 <rdar://problem/4613467>
1317 REGRESSION: RegEx seems broken for hex escaped non breaking space
1319 Test: fast/js/regexp-extended-characters-more.html
1322 (match): Got rid of utf16Length local variable to guarantee there's no
1323 extra stack usage in recursive calls. Fixed two places in the PCRE_UTF16
1324 code that were using the length variable, which is the UTF-8 length of
1325 a character in the pattern, to move in the UTF-16 subject string. Instead
1326 they hardcode lengths of 1 and 2 since the code already handles BMP
1327 characters and surrogate pairs separately. Also fixed some DPRINTF so
1328 I could compile with DEBUG on.
1329 (pcre_exec): Changed a place that was checking for multibyte characters
1330 in the subject string to use ISMIDCHAR. Instead it was using hardcoded
1331 logic that was right for UTF-8 but wrong for UTF-16.
1333 * pcre/pcre_compile.c: (pcre_compile2): Fixed a DPRINTF so I could compile
1336 2006-07-14 Geoffrey Garen <ggaren@apple.com>
1340 Global replace in the API of argc/argv with argumentCount/arguments.
1342 2006-07-14 Geoffrey Garen <ggaren@apple.com>
1346 - Finalized exception handling in the API.
1348 setProperty can throw because it throws for built-in arrays. getProperty
1349 and deleteProperty can throw because setProperty can throw and we want
1350 to be consistent, and also because they seem like "actions." callAsFunction,
1351 callAsConstructor, and hasInstance can throw, because they caan throw for
1354 toBoolean can't throw because it's defined that way in the spec.
1356 - Documented that toBoolean and toObject can't be overridden by custom
1357 objects because they're defined that way in the spec.
1359 === Safari-521.17 ===
1361 2006-07-14 Geoffrey Garen <ggaren@apple.com>
1365 - Implemented ref-counting of JSContexts by splitting into two datatypes:
1366 JSGlobalContext, which you can create/retain/release, and JSContext, which
1369 Internally, you retain a JSGlobalContext/ExecState by retaining its
1370 interpreter, which, in the case of a global ExecState, owns it.
1372 - Also made ~Interpreter() protected to catch places where Interpreter
1373 is manually deleted. (Can't make it private because some crazy fool
1374 decided it would be a good idea to subclass Interpreter in other frameworks.
1378 (toJS): Added cast for new JSGlobalContext
1379 * API/JSStringRef.h: Changed vague "you must" language to more specific
1380 (but, ultimately, equally vague) "behavior is undefined if you don't"
1382 (KJS::Interpreter::Interpreter): Factored more common initialization into
1384 * kjs/interpreter.h:
1385 (KJS::Interpreter::ref): new
1386 (KJS::Interpreter::deref): new
1387 (KJS::Interpreter::refCount): new
1389 (doIt): Ref-count the interpreter.
1391 2006-07-14 Maciej Stachowiak <mjs@apple.com>
1395 - removed bool return value from JSObjectSetProperty, since it is inefficient and
1396 also doesn't work quite right
1397 - added JSObjectGetPropertyAtIndex and JSObjectSetPropertyAtIndex
1399 * API/JSObjectRef.cpp:
1400 (JSObjectSetProperty): Removed return value and canPut stuff.
1401 (JSObjectGetPropertyAtIndex): Added.
1402 (JSObjectSetPropertyAtIndex): Added.
1403 * API/JSObjectRef.h: Prototyped and documented new functions.
1405 2006-07-14 Geoffrey Garen <ggaren@apple.com>
1409 Moved JSCheckScriptSyntax, JSEvaluateScript, and JSGarbageCollect into
1410 JSBase.h/.cpp. They don't belong in the value-specific or context-specific
1411 files because they're not part of the value or context implementations.
1414 * API/JSContextRef.cpp:
1415 (JSContextGetGlobalObject):
1416 * API/JSContextRef.h:
1417 * API/JSValueRef.cpp:
1420 * JavaScriptCore.xcodeproj/project.pbxproj:
1422 2006-07-13 Timothy Hatcher <timothy@apple.com>
1426 Moved JavaScriptCore to be a public framework.
1428 * JavaScriptCore.xcodeproj/project.pbxproj:
1430 2006-07-13 Mark Rowe <opendarwin.org@bdash.net.nz>
1432 Reviewed by Geoffrey.
1434 http://bugzilla.opendarwin.org/show_bug.cgi?id=9742
1435 Bug 9742: REGRESSION: WebKit hangs when loading <http://www.vtbook.com>
1438 (KJS::JSValue::getUInt32): Only types tagged as numeric can be converted to UInt32.
1440 2006-07-13 Geoffrey Garen <ggaren@apple.com>
1444 - Renamed JSEvaluate -> JSEvaluateScript, JSCheckSyntax -> JSCheckScriptSyntax
1445 - Added exception out parameters to JSValueTo* and JSValueIsEqual because
1447 - Removed JSObjectGetDescription because it's useless and vague, and
1448 JSValueToString/JSValueIsObjectOfClass do a better job, anyway
1449 - Clarified comments about "IsFunction/Constructor" to indicate that they
1450 are true of all functions/constructors, not just those created by JSObjectMake*
1452 2006-07-12 Geoffrey Garen <ggaren@apple.com>
1456 Finished previously approved JSInternalString -> JSString conversion
1457 by renaming the files.
1459 * API/JSCallbackObject.cpp:
1460 * API/JSInternalStringRef.cpp: Removed.
1461 * API/JSInternalStringRef.h: Removed.
1462 * API/JSStringRef.cpp: Added.
1463 * API/JSStringRef.h: Added.
1464 * API/JavaScriptCore.h:
1465 * JavaScriptCore.xcodeproj/project.pbxproj:
1467 2006-07-12 Geoffrey Garen <ggaren@apple.com>
1471 - Removed context and exception parameters from JSObjectGetPropertyEnumerator,
1472 removing the spurious use of ExecState inside JavaScriptCore that made
1473 us think this was necessary in the first place.
1475 (StringInstance::getPropertyList): Use getString instead of toString because
1476 we know we're dealing with a string -- we put it there in the first place.
1477 While we're at it, store the string's size instead of retrieving it each time
1478 through the loop, to avoid the unnecessary killing of puppies.
1479 * kjs/string_object.h:
1481 2006-07-12 Maciej Stachowiak <mjs@apple.com>
1485 - add handling of hasInstance callback for API objects
1487 * API/JSCallbackObject.cpp:
1488 (KJS::JSCallbackObject::implementsHasInstance): Check if callback is present.
1489 (KJS::JSCallbackObject::hasInstance): Invoke appropriate callback.
1490 * API/JSCallbackObject.h:
1491 * API/JSClassRef.cpp:
1492 * API/JSObjectRef.h:
1494 (MyObject_hasInstance): Test case; should match what construct would do.
1497 2006-07-11 Geoffrey Garen <ggaren@apple.com>
1501 - Implemented a vast number of renames and comment clarifications
1502 suggested during API review.
1504 JSInternalString -> JSString
1505 JS*Make -> JSValueMake*, JSObjectMake*
1506 JSTypeCode -> JSType
1507 JSValueIsInstanceOf -> JSValueIsInstanceOfConstructor (reads strangely well in client code)
1508 JSGC*Protect -> JSValue*Protect
1509 JS*Callback -> JSObject*Callback
1510 JSGetPropertyListCallback -> JSObjectAddPropertiesToListCallback
1511 JSPropertyEnumeratorGetNext -> JSPropertyEnumeratorGetNextName
1513 JSStringCreateWithUTF8CString, JSStringGetUTF8CString,
1514 JSStringGetMaximumUTF8CStringSize JSStringIsEqualToUTF8CString,
1515 JSStringCreateWithCFString, JSStringCopyCFString, JSStringCreateWithCharacters.
1517 - Changed functions taking a JSValue out arg and returning a bool indicating
1518 whether it was set to simply return a JSValue or NULL.
1520 - Removed JSStringGetCharacters because it's more documentation than code,
1521 and it's just a glorified memcpy built on existing API functionality.
1523 - Moved standard library includes into the headers that actually require them.
1525 - Standardized use of the phrase "Create Rule."
1527 - Removed JSLock from make functions that don't allocate.
1529 - Added exception handling to JSValueToBoolean, since we now allow
1530 callback objects to throw exceptions upon converting to boolean.
1532 - Renamed JSGCCollect to JSGarbageCollect.
1534 2006-07-10 Geoffrey Garen <ggaren@apple.com>
1538 - Changed public header includes to the <JavaScriptCore/ style.
1539 - Changed instances of 'buffer' to 'string' since we decided on
1540 JSInternalString instead of JSStringBuffer.
1542 * API/JSContextRef.h:
1543 * API/JSInternalStringRef.cpp:
1545 (JSInternalStringRetain):
1546 (JSInternalStringRelease):
1547 (JSValueCopyStringValue):
1548 (JSInternalStringGetLength):
1549 (JSInternalStringGetCharactersPtr):
1550 (JSInternalStringGetCharacters):
1551 (JSInternalStringGetMaxLengthUTF8):
1552 (JSInternalStringGetCharactersUTF8):
1553 (CFStringCreateWithJSInternalString):
1554 * API/JSInternalStringRef.h:
1556 (JSNodePrototype_appendChild):
1557 (JSNode_getNodeType):
1558 * API/JSObjectRef.cpp:
1559 (JSObjectCallAsConstructor):
1561 * API/JavaScriptCore.h:
1566 (MyObject_getPropertyList):
1567 (myConstructor_callAsConstructor):
1568 (main): I noticed that we were prematurely releasing some string buffers,
1569 so I moved their release calls to the end of main(). I got rid of 'Buf' in *Buf
1570 (sometimes changing to 'IString', when necessary to differentiate a variable)
1571 to match the buffer->string change.
1573 === Safari-521.16 ===
1575 2006-07-10 Darin Adler <darin@apple.com>
1577 * kjs/value.cpp: (KJS::JSValue::toInt32Inline): Added inline keyword one more place.
1580 2006-07-10 Darin Adler <darin@apple.com>
1582 - fix the release build
1586 (KJS::JSValue::toInt32Inline): Move the code here to an inline.
1587 (KJS::JSValue::toInt32): Call the inline from both overloaded toInt32 functions.
1589 2006-07-10 David Kilzer <ddkilzer@kilzer.net>
1593 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9179
1594 Implement select.options.add() method
1596 * JavaScriptCore.exp: Added overloaded KJS::JSValue::toInt32() method.
1597 * JavaScriptCore.xcodeproj/project.pbxproj: Altered attributes metadata for
1598 kjs/value.h to make it available as a forwarded header.
1600 (KJS::lookupPut): Extracted a lookupPut() method from the existing lookupPut() method.
1601 The new method returns a boolean value if no entry is found in the lookup table.
1603 (KJS::JSValue::toInt32): Overloaded toInt32() method with boolean "Ok" argument.
1604 * kjs/value.h: Ditto.
1606 2006-07-10 Geoffrey Garen <ggaren@apple.com>
1608 No review necessary. Removed bogus file I accidentally checked in before.
1610 * API/JSInternalSringRef.h: Removed.
1612 2006-07-10 Geoffrey Garen <ggaren@apple.com>
1616 Added exception out parameter to API object callbacks, removed semi-bogus
1617 JSContext(.*)Exception functions.
1619 To make these calls syntactically simple, I added an exceptionSlot()
1620 method to the ExecState class, which provides a JSValue** slot in which to
1621 store a JSValue* exception.
1625 * API/JSCallbackConstructor.cpp:
1626 (KJS::JSCallbackConstructor::construct):
1627 * API/JSCallbackFunction.cpp:
1628 (KJS::JSCallbackFunction::callAsFunction):
1629 * API/JSCallbackObject.cpp:
1630 (KJS::JSCallbackObject::init):
1631 (KJS::JSCallbackObject::getOwnPropertySlot):
1632 (KJS::JSCallbackObject::put):
1633 (KJS::JSCallbackObject::deleteProperty):
1634 (KJS::JSCallbackObject::construct):
1635 (KJS::JSCallbackObject::callAsFunction):
1636 (KJS::JSCallbackObject::getPropertyList):
1637 (KJS::JSCallbackObject::toBoolean):
1638 (KJS::JSCallbackObject::toNumber):
1639 (KJS::JSCallbackObject::toString):
1640 (KJS::JSCallbackObject::staticValueGetter):
1641 (KJS::JSCallbackObject::callbackGetter):
1642 * API/JSContextRef.cpp:
1644 * API/JSContextRef.h:
1646 (JSNodePrototype_appendChild):
1647 (JSNodePrototype_removeChild):
1648 (JSNodePrototype_replaceChild):
1649 (JSNode_getNodeType):
1650 (JSNode_getChildNodes):
1651 (JSNode_getFirstChild):
1655 (JSNodeListPrototype_item):
1656 (JSNodeList_length):
1657 (JSNodeList_getProperty):
1658 * API/JSObjectRef.h:
1662 (MyObject_initialize):
1663 (MyObject_hasProperty):
1664 (MyObject_getProperty):
1665 (MyObject_setProperty):
1666 (MyObject_deleteProperty):
1667 (MyObject_getPropertyList):
1668 (MyObject_callAsFunction):
1669 (MyObject_callAsConstructor):
1670 (MyObject_convertToType):
1671 (print_callAsFunction):
1672 (myConstructor_callAsConstructor):
1674 * JavaScriptCore.exp:
1676 (KJS::ExecState::exceptionHandle):
1678 2006-07-10 Geoffrey Garen <ggaren@apple.com>
1682 Improved type safety by implementing opaque JSValue/JSObject typing through
1683 abuse of 'const', not void*. Also fixed an alarming number of bugs
1684 exposed by this new type safety.
1686 I made one design change in JavaScriptCore, which is that the JSObject
1687 constructor should take a JSValue* as its prototype argument, not a JSObject*,
1688 since we allow the prototype to be any JSValue*, including jsNull(), for
1694 * API/JSCallbackConstructor.cpp:
1695 (KJS::JSCallbackConstructor::construct):
1696 * API/JSCallbackFunction.cpp:
1697 (KJS::JSCallbackFunction::callAsFunction):
1698 * API/JSCallbackObject.cpp:
1699 (KJS::JSCallbackObject::JSCallbackObject):
1700 (KJS::JSCallbackObject::getOwnPropertySlot):
1701 (KJS::JSCallbackObject::put):
1702 (KJS::JSCallbackObject::construct):
1703 (KJS::JSCallbackObject::callAsFunction):
1704 (KJS::JSCallbackObject::staticFunctionGetter):
1705 * API/JSCallbackObject.h:
1706 * API/JSContextRef.cpp:
1709 (JSNodePrototype_appendChild):
1710 (JSNodePrototype_removeChild):
1711 (JSNodePrototype_replaceChild):
1712 * API/JSObjectRef.cpp:
1714 (JSFunctionMakeWithBody):
1715 (JSObjectGetProperty):
1716 (JSObjectCallAsFunction):
1717 (JSObjectCallAsConstructor):
1718 * API/JSObjectRef.h:
1723 (KJS::JSObject::JSObject):
1725 2006-07-10 Geoffrey Garen <ggaren@apple.com>
1727 Approved by Maciej, Darin.
1729 Renamed JSStringBufferRef to JSInternalStringRef. "Internal string" means the
1730 JavaScript engine's internal string representation, which is the most
1731 low-level and efficient representation to use when interfacing with JavaScript.
1737 * API/JSCallbackObject.cpp:
1738 (KJS::JSCallbackObject::getOwnPropertySlot):
1739 (KJS::JSCallbackObject::put):
1740 (KJS::JSCallbackObject::deleteProperty):
1741 (KJS::JSCallbackObject::staticValueGetter):
1742 (KJS::JSCallbackObject::callbackGetter):
1743 * API/JSContextRef.cpp:
1746 * API/JSContextRef.h:
1747 * API/JSInternalStringRef.cpp: Added.
1749 (JSInternalStringCreate):
1750 (JSInternalStringCreateUTF8):
1751 (JSInternalStringRetain):
1752 (JSInternalStringRelease):
1753 (JSValueCopyStringValue):
1754 (JSInternalStringGetLength):
1755 (JSInternalStringGetCharactersPtr):
1756 (JSInternalStringGetCharacters):
1757 (JSInternalStringGetMaxLengthUTF8):
1758 (JSInternalStringGetCharactersUTF8):
1759 (JSInternalStringIsEqual):
1760 (JSInternalStringIsEqualUTF8):
1761 (JSInternalStringCreateCF):
1762 (CFStringCreateWithJSInternalString):
1763 * API/JSInternalStringRef.h: Added.
1765 (JSNodePrototype_appendChild):
1766 (JSNode_getNodeType):
1767 (JSNode_getChildNodes):
1768 (JSNode_getFirstChild):
1770 (JSNodeList_length):
1771 (JSNodeList_getProperty):
1772 * API/JSObjectRef.cpp:
1773 (JSFunctionMakeWithBody):
1774 (JSObjectGetDescription):
1775 (JSObjectHasProperty):
1776 (JSObjectGetProperty):
1777 (JSObjectSetProperty):
1778 (JSObjectDeleteProperty):
1779 (JSPropertyEnumeratorGetNext):
1780 (JSPropertyListAdd):
1781 * API/JSObjectRef.h:
1782 * API/JSStringBufferRef.cpp: Removed.
1783 * API/JSStringBufferRef.h: Removed.
1785 * API/JavaScriptCore.h:
1790 (assertEqualsAsUTF8String):
1791 (assertEqualsAsCharactersPtr):
1792 (assertEqualsAsCharacters):
1793 (MyObject_hasProperty):
1794 (MyObject_getProperty):
1795 (MyObject_setProperty):
1796 (MyObject_deleteProperty):
1797 (MyObject_getPropertyList):
1798 (print_callAsFunction):
1799 (myConstructor_callAsConstructor):
1801 * JavaScriptCore.exp:
1802 * JavaScriptCore.xcodeproj/project.pbxproj:
1804 2006-07-08 Tim Omernick <timo@apple.com>
1808 Added an OpenGL drawing model to the Netscape Plug-in API.
1812 2006-07-08 Timothy Hatcher <timothy@apple.com>
1816 Moved KJS_GetCreatedJavaVMs to jni_utility.cpp.
1817 Switched KJS_GetCreatedJavaVMs over to use dlopen and dlsym
1818 now that NSAddImage, NSLookupSymbolInImage and NSAddressOfSymbol
1819 are deprecated in Leopard.
1821 * JavaScriptCore.exp:
1822 * JavaScriptCore.xcodeproj/project.pbxproj:
1823 * bindings/jni/jni_utility.cpp:
1824 (KJS::Bindings::KJS_GetCreatedJavaVMs):
1825 * bindings/softlinking.c: Removed.
1826 * bindings/softlinking.h: Removed.
1828 2006-07-08 Geoffrey Garen <ggaren@apple.com>
1832 - Make JSObjectGetProperty return a JSValue or NULL, like JSEvaluate does.
1834 * API/JSObjectRef.cpp:
1835 (JSObjectGetProperty):
1836 * API/JSObjectRef.h:
1840 2006-07-08 Geoffrey Garen <ggaren@apple.com>
1842 Style change -- no review necessary.
1844 Use 0 instead of NULL in API .cpp files, to match our style guidelines.
1846 * API/JSContextRef.cpp:
1848 * API/JSObjectRef.cpp:
1849 (JSFunctionMakeWithBody):
1850 (JSObjectCallAsFunction):
1851 (JSObjectCallAsConstructor):
1852 * API/JSValueRef.cpp:
1855 2006-07-08 Geoffrey Garen <ggaren@apple.com>
1859 - Added ability to pass NULL for thisObject when calling JSObjectCallAsFunction,
1860 to match JSEvaluate.
1862 * API/JSObjectRef.cpp:
1863 (JSObjectCallAsFunction):
1864 * API/JSObjectRef.h:
1868 === Safari-521.15 ===
1870 2006-07-07 Geoffrey Garen <ggaren@apple.com>
1874 - Standardized which functions take a JSContext as an argument. The rule is:
1875 if you might execute JavaScript, you take a JSContext, otherwise you don't.
1877 The FIXME in JSObjectRef.h requires refactoring some parts of Interpreter,
1878 but not API changes, so I'm putting it off until later.
1880 * API/JSCallbackObject.cpp:
1881 (KJS::JSCallbackObject::JSCallbackObject):
1882 (KJS::JSCallbackObject::init):
1883 * API/JSCallbackObject.h:
1884 * API/JSContextRef.cpp:
1886 * API/JSContextRef.h:
1887 * API/JSObjectRef.cpp:
1889 (JSPropertyEnumeratorGetNext):
1890 * API/JSObjectRef.h:
1892 (MyObject_initialize):
1894 * JavaScriptCore.exp:
1895 * kjs/array_object.cpp:
1896 (ArrayInstance::setLength):
1897 (ArrayInstance::pushUndefinedObjectsToEnd):
1899 (ForInNode::execute):
1900 * kjs/reference.cpp:
1901 (KJS::Reference::getPropertyName):
1902 (KJS::Reference::getValue):
1904 * kjs/scope_chain.cpp:
1905 (KJS::ScopeChain::print):
1907 2006-07-06 Geoffrey Garen <ggaren@apple.com>
1913 - Headerdoc finished
1916 - Added a JSContextRef argument to many functions, because you need a
1917 JSContextRef for doing virtually anything. I expect to add this argument
1918 to even more functions in a future patch.
1920 - Removed the globalObjectPrototype argument to JSContextCreate because
1921 you can't create an object until you have a context, so it's impossible
1922 to pass a prototype object to JSContextCreate. That's OK because (1) there's
1923 no reason to give the global object a prototype and (2) if you really want
1924 to, you can just use a separate call to JSObjectSetPrototype.
1926 - Removed the JSClassRef argument to JSClassCreate because it was unnecessary,
1927 and you need to be able to make the global object's class before you've
1928 created a JSContext.
1930 - Added an optional exception parameter to JSFunctionMakeWithBody because anything
1931 less would be uncivilized.
1933 - Made the return value parameter to JSObjectGetProperty optional to match
1934 all other return value parameters in the API.
1936 - Made JSObjectSetPrivate/JSObjectGetPrivate work on JSCallbackFunctions
1937 and JSCallbackConstructors. You could use an abstract base class or strategic
1938 placement of m_privateData in the class structure to implement this, but
1939 the former seemed like overkill, and the latter seemed too dangerous.
1941 - Fixed a bug where JSPropertyEnumeratorGetNext would skip the first property.
1944 - Reversed the logic of the JSChar #ifdef to avoid confusing headerdoc
1946 - Removed function names from @function declarations because headeroc
1947 can parse them automatically, and I wanted to rule out manual mismatch.
1949 - Changed Error::create to take a const UString& instead of a UString*
1950 because it was looking at me funny.
1952 - Renamed JSStringBufferCreateWithCFString to JSStringBufferCreateCF
1953 because the latter is more concise and it matches JSStringBufferCreateUTF8.
1955 * API/JSCallbackObject.cpp:
1956 (KJS::JSCallbackObject::getOwnPropertySlot):
1957 (KJS::JSCallbackObject::put):
1958 (KJS::JSCallbackObject::deleteProperty):
1959 (KJS::JSCallbackObject::getPropertyList):
1960 (KJS::JSCallbackObject::toBoolean):
1961 (KJS::JSCallbackObject::toNumber):
1962 (KJS::JSCallbackObject::toString):
1963 * API/JSClassRef.cpp:
1965 * API/JSContextRef.cpp:
1967 (JSContextSetException):
1968 * API/JSContextRef.h:
1970 (JSNodePrototype_class):
1973 (JSNodeListPrototype_class):
1975 * API/JSObjectRef.cpp:
1976 (JSObjectGetProperty):
1977 (JSObjectGetPrivate):
1978 (JSObjectSetPrivate):
1979 (JSObjectCallAsFunction):
1980 (JSObjectCallAsConstructor):
1981 (JSPropertyEnumeratorGetNext):
1982 * API/JSObjectRef.h:
1983 * API/JSStringBufferRef.cpp:
1984 (JSStringBufferCreateCF):
1985 * API/JSStringBufferRef.h:
1986 * API/JSValueRef.cpp:
1987 (JSValueIsInstanceOf):
1993 (MyObject_hasProperty):
1994 (MyObject_setProperty):
1995 (MyObject_deleteProperty):
1996 (MyObject_getPropertyList):
1997 (MyObject_convertToType):
2000 * JavaScriptCore.exp:
2002 2006-07-07 Geoffrey Garen <ggaren@apple.com>
2006 - Fixed a few crashes resulting from NULL parameters to JSClassCreate.
2008 * API/JSClassRef.cpp:
2011 * API/testapi.c: Added test for NULL parameters.
2014 2006-07-07 Geoffrey Garen <ggaren@apple.com>
2016 Reviewed by John, mocked by Darin.
2018 - Changed JSEvaluate to take a JSObjectRef instead of a JSValueRef as
2019 "this," since "this" must be an object.
2021 * API/JSContextRef.cpp:
2023 * API/JSContextRef.h:
2025 2006-07-07 Geoffrey Garen <ggaren@apple.com>
2032 * JavaScriptCore.xcodeproj/project.pbxproj:
2034 2006-07-05 Geoffrey Garen <ggaren@apple.com>
2038 Renamed JSCharBufferRef, which was universally unpopular, to JSStringBufferRef,
2039 which, hopefully, will be less unpopular.
2045 * API/JSCallbackObject.cpp:
2046 (KJS::JSCallbackObject::getOwnPropertySlot):
2047 (KJS::JSCallbackObject::put):
2048 (KJS::JSCallbackObject::deleteProperty):
2049 (KJS::JSCallbackObject::staticValueGetter):
2050 (KJS::JSCallbackObject::callbackGetter):
2051 * API/JSCharBufferRef.cpp: Removed.
2052 * API/JSCharBufferRef.h: Removed.
2053 * API/JSContextRef.cpp:
2056 * API/JSContextRef.h:
2058 (JSNodePrototype_appendChild):
2059 (JSNode_getNodeType):
2060 (JSNode_getChildNodes):
2061 (JSNode_getFirstChild):
2063 (JSNodeList_length):
2064 (JSNodeList_getProperty):
2065 * API/JSObjectRef.cpp:
2066 (JSFunctionMakeWithBody):
2067 (JSObjectGetDescription):
2068 (JSObjectHasProperty):
2069 (JSObjectGetProperty):
2070 (JSObjectSetProperty):
2071 (JSObjectDeleteProperty):
2072 (JSPropertyEnumeratorGetNext):
2073 (JSPropertyListAdd):
2074 * API/JSObjectRef.h:
2075 * API/JSStringBufferRef.cpp: Added.
2077 (JSStringBufferCreate):
2078 (JSStringBufferCreateUTF8):
2079 (JSStringBufferRetain):
2080 (JSStringBufferRelease):
2081 (JSValueCopyStringValue):
2082 (JSStringBufferGetLength):
2083 (JSStringBufferGetCharactersPtr):
2084 (JSStringBufferGetCharacters):
2085 (JSStringBufferGetMaxLengthUTF8):
2086 (JSStringBufferGetCharactersUTF8):
2087 (JSStringBufferIsEqual):
2088 (JSStringBufferIsEqualUTF8):
2089 (JSStringBufferCreateWithCFString):
2090 (CFStringCreateWithJSStringBuffer):
2091 * API/JSStringBufferRef.h: Added.
2093 * API/JavaScriptCore.h:
2098 (assertEqualsAsUTF8String):
2099 (assertEqualsAsCharactersPtr):
2100 (assertEqualsAsCharacters):
2101 (MyObject_hasProperty):
2102 (MyObject_getProperty):
2103 (MyObject_setProperty):
2104 (MyObject_deleteProperty):
2105 (MyObject_getPropertyList):
2106 (print_callAsFunction):
2107 (myConstructor_callAsConstructor):
2109 * JavaScriptCore.exp:
2110 * JavaScriptCore.xcodeproj/project.pbxproj:
2112 2006-07-05 Geoffrey Garen <ggaren@apple.com>
2116 Moved some code around for more logical file separation.
2119 * API/JSContextRef.h:
2120 * API/JSObjectRef.cpp:
2121 * API/JSValueRef.cpp:
2125 2006-07-03 Geoffrey Garen <ggaren@apple.com>
2129 Implemented JSFunctionMakeWithBody, which parses a script as a function body
2130 in the global scope, and returns the resulting anonymous function.
2132 I also removed private data from JSCallbackFunction. It never worked,
2133 since JSCallbackFunction doesn't inherit from JSCallbackObject.
2135 * API/JSCallbackConstructor.cpp: Removed.
2136 * API/JSCallbackConstructor.h: Removed.
2137 * API/JSCallbackFunction.cpp:
2138 (KJS::JSCallbackFunction::JSCallbackFunction):
2139 (KJS::JSCallbackFunction::implementsConstruct):
2140 (KJS::JSCallbackFunction::construct):
2141 (KJS::JSCallbackFunction::implementsCall):
2142 (KJS::JSCallbackFunction::callAsFunction):
2143 * API/JSCallbackFunction.h:
2144 * API/JSCallbackObject.cpp:
2145 (KJS::JSCallbackObject::staticFunctionGetter):
2146 * API/JSObjectRef.cpp:
2148 (JSFunctionMakeWithCallbacks):
2149 * API/JSObjectRef.h:
2155 * JavaScriptCore.exp: Programmatically added all symbols exported by
2156 API object files, and sorted results
2157 * JavaScriptCore.xcodeproj/project.pbxproj:
2159 2006-07-03 Geoffrey Garen <ggaren@apple.com>
2163 - Return syntax error in JSCheckSyntax through a JSValueRef* exception
2167 * API/JSContextRef.cpp:
2171 * JavaScriptCore.exp:
2172 * kjs/interpreter.cpp:
2173 (KJS::Interpreter::checkSyntax):
2174 * kjs/interpreter.h:
2176 2006-07-04 Darin Adler <darin@apple.com>
2180 * wtf/MathExtras.h: Oops. Added missing #endif.
2182 2006-07-04 Bjoern Graf <bjoern.graf@gmail.com>
2185 Tweaked a bit by Darin.
2187 - http://bugzilla.opendarwin.org/show_bug.cgi?id=9678
2188 work around MSVCRT's fmod function returning NaN for fmod(x, infinity) instead of x
2190 * wtf/MathExtras.h: Added include of <float.h>.
2191 (isinf): Fix to return false for NAN.
2192 (wtf_fmod): Added. An inline that works around the bug.
2195 * kjs/number_object.cpp:
2196 * kjs/operations.cpp:
2198 Added includes of MathExtras.h to all files using fmod.
2200 * JavaScriptCore.xcodeproj/project.pbxproj: Let Xcode 2.3 have its way with
2203 2006-07-01 Geoffrey Garen <ggaren@apple.com>
2207 - Refined value conversions in the API:
2208 - failed toNumber returns NaN
2209 - failed toObject returns NULL
2210 - failed toString returns empty string
2212 - Refined excpetion handling in the API:
2213 - failed value conversions do not throw exceptions
2214 - uncaught exceptions in JSEvaluate, JSObjectCallAsFunction, and
2215 JSObjectCallAsConstructor are returned through a JSValueRef* exception
2217 - removed JSContextHasException, because JSContextGetException does
2221 * API/JSCharBufferRef.cpp:
2222 (JSValueCopyStringValue):
2223 * API/JSContextRef.cpp:
2225 * API/JSContextRef.h:
2226 * API/JSNodeList.c: Added test code demonstrating how you would use
2227 toNumber, and why you probably don't need toUInt32, etc.
2228 (JSNodeListPrototype_item):
2229 (JSNodeList_getProperty):
2230 * API/JSObjectRef.cpp:
2232 (JSObjectCallAsFunction):
2233 (JSObjectCallAsConstructor):
2234 * API/JSObjectRef.h:
2235 * API/JSValueRef.cpp:
2241 (main): Added tests for new rules, and call to JSGCProtect to fix Intel
2243 * JavaScriptCore.exp:
2245 2006-07-03 Darin Adler <darin@apple.com>
2247 - Rolled out HashMap implementation of NPRuntime, at least temporarily.
2249 Fixes hang in the bindings section of layout tests seen on the
2252 This code was using HashMap<const char*, PrivateIdentifier*>.
2253 But that hashes based on pointer identity, not string value.
2254 The default hash for any pointer type is to hash based on the pointer.
2255 And WTF doesn't currently have a string hash for char*.
2256 We'll need to fix that before re-landing this patch.
2258 (Formatting was also incorrect -- extra spaces in parentheses.)
2260 * bindings/npruntime.cpp: Rolled out last change.
2262 2006-07-02 Justin Haygood <jhaygood@spsu.edu>
2264 Reviewed, tweaked, landed by ggaren.
2266 - Port NPRuntime from CFDictionary to HashMap.
2268 * bindings/npruntime.cpp:
2269 (getStringIdentifierDictionary):
2270 (getIntIdentifierDictionary):
2271 (_NPN_GetStringIdentifier):
2272 (_NPN_GetIntIdentifier):
2273 * bindings/npruntime.h:
2275 2006-07-01 Geoffrey Garen <ggaren@apple.com>
2279 - Fixed <rdar://problem/4611197> REGRESSION: Liveconnect with Java test
2280 fails at http://www-sor.inria.fr/~dedieu/notes/liveconnect/simple_example.html
2282 * JavaScriptCore.exp: Export symbols used by liveconnect
2284 2006-06-29 Geoffrey Garen <ggaren@apple.com>
2288 - Phase 2 in the JS API.
2290 - Added support for specifying static tables of values -- this should
2291 obviate the need for using complicated callbacks for most lookups.
2293 - API objects are now created with classes (JSClassRef) -- in order to support
2294 static values, and in order to prevent API objects from storing their
2295 data inline, and thus falling into the oversized (read: slow and prone to
2296 giving Maciej the frowny face) heap.
2298 - Added two specialized JSObject subclasses -- JSCallbackFunction and JSCallbackConstructor --
2299 to allow JSFunctionMake and JSConstructorMake to continue to work with
2300 the new class model. Another solution to this problem would be to create
2301 a custom class object for each function and constructor you make. This
2302 solution is more code but also more efficient.
2304 - Substantially beefed up the minidom example to demonstrate and test a
2305 lot of these techniques. Its output is still pretty haphazard, though.
2307 - Gave the <kjs/ preface to some includes -- I'm told this matters to
2308 building on some versions of Linux.
2310 - Implemented JSValueIsInstanceOf and JSValueIsObjectOfClass
2312 - Removed GetDescription callback. Something in the class datastructure
2313 should take care of this.
2316 * API/JSCallbackConstructor.cpp: Added.
2318 (KJS::JSCallbackConstructor::JSCallbackConstructor):
2319 (KJS::JSCallbackConstructor::implementsConstruct):
2320 (KJS::JSCallbackConstructor::construct):
2321 (KJS::JSCallbackConstructor::setPrivate):
2322 (KJS::JSCallbackConstructor::getPrivate):
2323 * API/JSCallbackConstructor.h: Added.
2324 (KJS::JSCallbackConstructor::classInfo):
2325 * API/JSCallbackFunction.cpp: Added.
2327 (KJS::JSCallbackFunction::JSCallbackFunction):
2328 (KJS::JSCallbackFunction::implementsCall):
2329 (KJS::JSCallbackFunction::callAsFunction):
2330 (KJS::JSCallbackFunction::setPrivate):
2331 (KJS::JSCallbackFunction::getPrivate):
2332 * API/JSCallbackFunction.h: Added.
2333 (KJS::JSCallbackFunction::classInfo):
2334 * API/JSCallbackObject.cpp:
2336 (KJS::JSCallbackObject::JSCallbackObject):
2337 (KJS::JSCallbackObject::init):
2338 (KJS::JSCallbackObject::~JSCallbackObject):
2339 (KJS::JSCallbackObject::className):
2340 (KJS::JSCallbackObject::getOwnPropertySlot):
2341 (KJS::JSCallbackObject::put):
2342 (KJS::JSCallbackObject::deleteProperty):
2343 (KJS::JSCallbackObject::implementsConstruct):
2344 (KJS::JSCallbackObject::construct):
2345 (KJS::JSCallbackObject::implementsCall):
2346 (KJS::JSCallbackObject::callAsFunction):
2347 (KJS::JSCallbackObject::getPropertyList):
2348 (KJS::JSCallbackObject::toBoolean):
2349 (KJS::JSCallbackObject::toNumber):
2350 (KJS::JSCallbackObject::toString):
2351 (KJS::JSCallbackObject::inherits):
2352 (KJS::JSCallbackObject::staticValueGetter):
2353 (KJS::JSCallbackObject::staticFunctionGetter):
2354 (KJS::JSCallbackObject::callbackGetter):
2355 * API/JSCallbackObject.h:
2356 * API/JSCharBufferRef.cpp:
2357 * API/JSClassRef.cpp: Added.
2361 * API/JSClassRef.h: Added.
2362 (StaticValueEntry::StaticValueEntry):
2363 (StaticFunctionEntry::StaticFunctionEntry):
2364 (__JSClass::__JSClass):
2365 * API/JSContextRef.cpp:
2368 * API/JSContextRef.h:
2369 * API/JSNode.c: Added.
2370 (JSNodePrototype_appendChild):
2371 (JSNodePrototype_removeChild):
2372 (JSNodePrototype_replaceChild):
2373 (JSNodePrototype_class):
2374 (JSNode_getNodeType):
2375 (JSNode_getChildNodes):
2376 (JSNode_getFirstChild):
2382 * API/JSNode.h: Added.
2383 * API/JSNodeList.c: Added.
2384 (JSNodeListPrototype_item):
2385 (JSNodeListPrototype_class):
2386 (JSNodeList_length):
2387 (JSNodeList_getProperty):
2388 (JSNodeList_finalize):
2390 (JSNodeList_prototype):
2392 * API/JSNodeList.h: Added.
2393 * API/JSObjectRef.cpp:
2396 (JSConstructorMake):
2397 (__JSPropertyEnumerator::__JSPropertyEnumerator):
2398 (JSObjectCreatePropertyEnumerator):
2399 (JSPropertyEnumeratorGetNext):
2400 (JSPropertyEnumeratorRetain):
2401 (JSPropertyEnumeratorRelease):
2402 * API/JSObjectRef.h:
2403 (__JSObjectCallbacks::):
2404 * API/JSValueRef.cpp:
2405 (JSValueIsObjectOfClass):
2406 (JSValueIsInstanceOf):
2408 * API/Node.c: Added.
2412 (Node_replaceChild):
2415 * API/Node.h: Added.
2416 * API/NodeList.c: Added.
2422 * API/NodeList.h: Added.
2426 (createStringWithContentsOfFile):
2429 (assertEqualsAsCharacters):
2430 (MyObject_getProperty):
2432 (myConstructor_callAsConstructor):
2435 * JavaScriptCore.xcodeproj/project.pbxproj:
2437 2006-06-26 Kevin Ollivier <kevino@theolliviers.com>
2439 Reviewed and tweaked by Darin.
2441 - Compile fixes for wx port / gcc 4.0.2
2443 * kjs/array_object.cpp:
2444 Added missing headers.
2447 gcc needs class prototypes before defining those classes as friend classes
2449 2006-06-30 Mike Emmel <mike.emmel@gmail.com>
2453 Compilation fixes for Linux/Gdk.
2455 * JavaScriptCore/kjs/interpreter.cpp: added include of signal.h
2456 * JavaScriptCore/kjs/ExecState.h: added missing class declaration
2457 * JavaScriptCore/kjs/ExecState.cpp: case wrong on include of context.h
2458 * JavaScriptCore/JavaScriptCoreSources.bkl: added Context.cpp and ExecState.cpp
2460 === Safari-521.14 ===
2462 2006-06-29 Maciej Stachowiak <mjs@apple.com>
2466 - add headerdoc comments to some of the new JS API headers
2471 2006-06-28 Timothy Hatcher <timothy@apple.com>
2473 Prefer the Stabs debugging symbols format until DWARF bugs are fixed.
2475 * JavaScriptCore.xcodeproj/project.pbxproj:
2477 2006-06-27 Timothy Hatcher <timothy@apple.com>
2481 <rdar://problem/4448350> Deprecated ObjC language API used in JavaScriptCore, WebCore, WebKit and WebBrowser
2483 Switch to the new ObjC 2 API, ifdefed the old code around OBJC_API_VERSION so it still works on Tiger.
2484 Removed the use of the old stringWithCString, switched to the new Tiger version that accepts an encoding.
2485 Lots of code style cleanup.
2487 * JavaScriptCore.xcodeproj/project.pbxproj:
2488 * bindings/objc/objc_class.h:
2489 * bindings/objc/objc_class.mm:
2490 (KJS::Bindings::ObjcClass::~ObjcClass):
2491 (KJS::Bindings::_createClassesByIsAIfNecessary):
2492 (KJS::Bindings::ObjcClass::classForIsA):
2493 (KJS::Bindings::ObjcClass::name):
2494 (KJS::Bindings::ObjcClass::methodsNamed):
2495 (KJS::Bindings::ObjcClass::fieldNamed):
2496 (KJS::Bindings::ObjcClass::fallbackObject):
2497 * bindings/objc/objc_header.h:
2498 * bindings/objc/objc_instance.h:
2499 * bindings/objc/objc_instance.mm:
2500 (ObjcInstance::ObjcInstance):
2501 (ObjcInstance::~ObjcInstance):
2502 (ObjcInstance::operator=):
2503 (ObjcInstance::begin):
2504 (ObjcInstance::end):
2505 (ObjcInstance::getClass):
2506 (ObjcInstance::invokeMethod):
2507 (ObjcInstance::invokeDefaultMethod):
2508 (ObjcInstance::setValueOfField):
2509 (ObjcInstance::supportsSetValueOfUndefinedField):
2510 (ObjcInstance::setValueOfUndefinedField):
2511 (ObjcInstance::getValueOfField):
2512 (ObjcInstance::getValueOfUndefinedField):
2513 (ObjcInstance::defaultValue):
2514 (ObjcInstance::stringValue):
2515 (ObjcInstance::numberValue):
2516 (ObjcInstance::booleanValue):
2517 (ObjcInstance::valueOf):
2518 * bindings/objc/objc_runtime.h:
2519 * bindings/objc/objc_runtime.mm:
2520 (ObjcMethod::ObjcMethod):
2522 (ObjcMethod::getMethodSignature):
2523 (ObjcMethod::setJavaScriptName):
2526 (ObjcField::valueFromInstance):
2527 (convertValueToObjcObject):
2528 (ObjcField::setValueToInstance):
2529 (ObjcArray::operator=):
2530 (ObjcArray::setValueAt):
2531 (ObjcArray::valueAt):
2532 (ObjcFallbackObjectImp::ObjcFallbackObjectImp):
2533 (ObjcFallbackObjectImp::callAsFunction):
2534 (ObjcFallbackObjectImp::defaultValue):
2536 2006-06-28 Anders Carlsson <acarlsson@apple.com>
2540 http://bugzilla.opendarwin.org/show_bug.cgi?id=8636
2541 REGRESSION: JavaScript access to Java applet causes hang (_webViewURL not implemented)
2543 * bindings/jni/jni_objc.mm:
2544 (KJS::Bindings::dispatchJNICall):
2545 Just pass nil as the calling URL. This will cause the Java plugin to use the URL of the page
2546 containing the applet (which is what we used to do).
2548 2006-06-27 Timothy Hatcher <timothy@apple.com>
2552 <rdar://problem/4406785> Add an export file to TOT JavaScriptCore like the Safari-2-0-branch
2554 * JavaScriptCore.exp: Added.
2555 * JavaScriptCore.xcodeproj/project.pbxproj:
2557 2006-06-25 Geoffrey Garen <ggaren@apple.com>
2561 - Added JSConstructorMake to match JSFunctionMake, along with test code.
2563 [ I checked in the ChangeLog before without the actual files. ]
2565 * API/JSObjectRef.cpp:
2566 (JSConstructorMake):
2567 * API/JSObjectRef.h:
2569 (myConstructor_callAsConstructor):
2573 * JavaScriptCore.xcodeproj/project.pbxproj: Moved testapi.c to the testapi
2574 target -- this was an oversight in my earlier check-in.
2576 2006-06-25 Timothy Hatcher <timothy@apple.com>
2580 Bug 9574: Drosera should show inline scripts within the original HTML
2581 http://bugzilla.opendarwin.org/show_bug.cgi?id=9574
2583 Pass the starting line number and error message to the debugger.
2586 (Debugger::sourceParsed):
2589 (KJS::GlobalFuncImp::callAsFunction):
2590 * kjs/function_object.cpp:
2591 (FunctionObjectImp::construct):
2592 * kjs/interpreter.cpp:
2593 (KJS::Interpreter::evaluate):
2595 2006-06-24 Alexey Proskuryakov <ap@nypop.com>
2597 Rubber-stamped by Eric.
2599 Add a -h (do not follow symlinks) option to ln in derived sources build script (without it,
2600 a symlink was created inside the source directory on second build).
2602 * JavaScriptCore.xcodeproj/project.pbxproj:
2604 2006-06-24 David Kilzer <ddkilzer@kilzer.net>
2606 Reviewed by Timothy.
2608 * Info.plist: Fixed copyright to include 2003-2006.
2610 2006-06-24 Alexey Proskuryakov <ap@nypop.com>
2614 - http://bugzilla.opendarwin.org/show_bug.cgi?id=9418
2615 WebKit will not build when Space exists in path
2617 * JavaScriptCore.xcodeproj/project.pbxproj: Enclose search paths in quotes; create symlinks to
2618 avoid passing paths with spaces to make.
2620 2006-06-23 Timothy Hatcher <timothy@apple.com>
2624 Adding more operator[] overloads for long and short types.
2627 (WTF::Vector::operator[]):
2629 === JavaScriptCore-521.13 ===
2631 2006-06-22 Alexey Proskuryakov <ap@nypop.com>
2635 - http://bugzilla.opendarwin.org/show_bug.cgi?id=9539
2636 Another case error preventing build
2638 * API/JSObjectRef.cpp: Changed "identifier.h" to "Identifier.h"
2640 2006-06-22 David Kilzer <ddkilzer@kilzer.net>
2644 http://bugzilla.opendarwin.org/show_bug.cgi?id=9539
2645 Another case error preventing build
2647 * API/APICast.h: Changed "UString.h" to "ustring.h".
2649 2006-06-21 Geoffrey Garen <ggaren@apple.com>
2651 Fixed release build, fixed accidental infinite recursion due to
2652 last minute global replace gone awry.
2657 (assertEqualsAsBoolean):
2658 (assertEqualsAsNumber):
2659 (assertEqualsAsUTF8String):
2660 (assertEqualsAsCharactersPtr):
2661 * JavaScriptCore.xcodeproj/project.pbxproj:
2663 2006-06-21 Geoffrey Garen <ggaren@apple.com>
2667 - First cut at C API to JavaScript. Includes a unit test, 'testapi.c',
2668 and the outline of a test app, 'minidom.c'.
2670 Includes one change to JSC internals: Rename propList to getPropertyList and have it
2671 take its target property list by reference so that subclasses can
2672 add properties to the list before calling through to their superclasses.
2674 Also, I just ran prepare-ChangeLog in about 10 seconds, and I would like
2675 to give a shout-out to that.
2677 * API/APICast.h: Added.
2680 * API/JSBase.h: Added.
2681 * API/JSCallbackObject.cpp: Added.
2683 (KJS::JSCallbackObject::JSCallbackObject):
2684 (KJS::JSCallbackObject::~JSCallbackObject):
2685 (KJS::JSCallbackObject::className):
2686 (KJS::JSCallbackObject::getOwnPropertySlot):
2687 (KJS::JSCallbackObject::put):
2688 (KJS::JSCallbackObject::deleteProperty):
2689 (KJS::JSCallbackObject::implementsConstruct):
2690 (KJS::JSCallbackObject::construct):
2691 (KJS::JSCallbackObject::implementsCall):
2692 (KJS::JSCallbackObject::callAsFunction):
2693 (KJS::JSCallbackObject::getPropertyList):
2694 (KJS::JSCallbackObject::toBoolean):
2695 (KJS::JSCallbackObject::toNumber):
2696 (KJS::JSCallbackObject::toString):
2697 (KJS::JSCallbackObject::setPrivate):
2698 (KJS::JSCallbackObject::getPrivate):
2699 (KJS::JSCallbackObject::cachedValueGetter):
2700 (KJS::JSCallbackObject::callbackGetter):
2701 * API/JSCallbackObject.h: Added.
2702 (KJS::JSCallbackObject::classInfo):
2703 * API/JSCharBufferRef.cpp: Added.
2705 (JSCharBufferCreate):
2706 (JSCharBufferCreateUTF8):
2707 (JSCharBufferRetain):
2708 (JSCharBufferRelease):
2709 (JSValueCopyStringValue):
2710 (JSCharBufferGetLength):
2711 (JSCharBufferGetCharactersPtr):
2712 (JSCharBufferGetCharacters):
2713 (JSCharBufferGetMaxLengthUTF8):
2714 (JSCharBufferGetCharactersUTF8):
2715 (JSCharBufferIsEqual):
2716 (JSCharBufferIsEqualUTF8):
2717 (JSCharBufferCreateWithCFString):
2718 (CFStringCreateWithJSCharBuffer):
2719 * API/JSCharBufferRef.h: Added.
2720 * API/JSContextRef.cpp: Added.
2723 (JSContextGetGlobalObject):
2726 (JSContextHasException):
2727 (JSContextGetException):
2728 (JSContextClearException):
2729 (JSContextSetException):
2730 * API/JSContextRef.h: Added.
2731 * API/JSObjectRef.cpp: Added.
2735 (JSObjectGetDescription):
2736 (JSObjectGetPrototype):
2737 (JSObjectSetPrototype):
2738 (JSObjectHasProperty):
2739 (JSObjectGetProperty):
2740 (JSObjectSetProperty):
2741 (JSObjectDeleteProperty):
2742 (JSObjectGetPrivate):
2743 (JSObjectSetPrivate):
2744 (JSObjectIsFunction):
2745 (JSObjectCallAsFunction):
2746 (JSObjectIsConstructor):
2747 (JSObjectCallAsConstructor):
2748 (__JSPropertyListEnumerator::__JSPropertyListEnumerator):
2749 (JSObjectCreatePropertyEnumerator):
2750 (JSPropertyEnumeratorGetNext):
2751 (JSPropertyEnumeratorRetain):
2752 (JSPropertyEnumeratorRelease):
2753 (JSPropertyListAdd):
2754 * API/JSObjectRef.h: Added.
2755 * API/JSValueRef.cpp: Added.
2757 (JSValueIsUndefined):
2764 (JSValueIsStrictEqual):
2774 * API/JSValueRef.h: Added.
2775 * API/JavaScriptCore.h: Added.
2776 * API/minidom.c: Added.
2778 * API/minidom.html: Added.
2779 * API/minidom.js: Added.
2780 * API/testapi.c: Added.
2781 (assertEqualsAsBoolean):
2782 (assertEqualsAsNumber):
2783 (assertEqualsAsUTF8String):
2784 (assertEqualsAsCharactersPtr):
2785 (assertEqualsAsCharacters):
2786 (MyObject_initialize):
2787 (MyObject_copyDescription):
2788 (MyObject_hasProperty):
2789 (MyObject_getProperty):
2790 (MyObject_setProperty):
2791 (MyObject_deleteProperty):
2792 (MyObject_getPropertyList):
2793 (MyObject_callAsFunction):
2794 (MyObject_callAsConstructor):
2795 (MyObject_convertToType):
2796 (MyObject_finalize):
2797 (print_callAsFunction):
2799 (createStringWithContentsOfFile):
2800 * API/testapi.js: Added.
2802 * JavaScriptCore.xcodeproj/project.pbxproj:
2803 * bindings/npruntime_impl.h:
2804 * kjs/array_instance.h:
2805 * kjs/array_object.cpp:
2806 (ArrayInstance::getPropertyList):
2807 * kjs/interpreter.cpp:
2808 (KJS::Interpreter::evaluate):
2810 (ForInNode::execute):
2812 (KJS::JSObject::put):
2813 (KJS::JSObject::canPut):
2814 (KJS::JSObject::deleteProperty):
2815 (KJS::JSObject::propertyIsEnumerable):
2816 (KJS::JSObject::getPropertyAttributes):
2817 (KJS::JSObject::getPropertyList):
2819 * kjs/property_map.cpp:
2820 (KJS::PropertyMap::get):
2821 * kjs/property_map.h:
2822 * kjs/scope_chain.cpp:
2823 (KJS::ScopeChain::print):
2824 * kjs/string_object.cpp:
2825 (StringInstance::getPropertyList):
2826 * kjs/string_object.h:
2828 (KJS::UString::Rep::ref):
2830 2006-06-20 Timothy Hatcher <timothy@apple.com>
2834 Make sure we clear the exception before returning so
2835 that future calls will not fail because of an earlier
2836 exception state. Assert on entry that the WebScriptObject
2837 is working with an ExecState that dose not have an exception.
2838 Document that evaluateWebScript and callWebScriptMethod return
2839 WebUndefined when an exception is thrown.
2841 * bindings/objc/WebScriptObject.h:
2842 * bindings/objc/WebScriptObject.mm:
2843 (-[WebScriptObject callWebScriptMethod:withArguments:]):
2844 (-[WebScriptObject evaluateWebScript:]):
2845 (-[WebScriptObject setValue:forKey:]):
2846 (-[WebScriptObject valueForKey:]):
2847 (-[WebScriptObject removeWebScriptKey:]):
2848 (-[WebScriptObject webScriptValueAtIndex:]):
2849 (-[WebScriptObject setWebScriptValueAtIndex:value:]):
2851 2006-06-19 Anders Carlsson <acarlsson@apple.com>
2855 * kjs/interpreter.cpp:
2856 (KJS::TimeoutChecker::pauseTimeoutCheck):
2857 (KJS::TimeoutChecker::resumeTimeoutCheck):
2858 Fix argument order in setitimer calls.
2860 2006-06-18 Anders Carlsson <acarlsson@apple.com>
2864 * kjs/interpreter.cpp:
2865 (KJS::TimeoutChecker::pauseTimeoutCheck):
2866 Do nothing if the timeout check hasn't been started.
2868 (KJS::TimeoutChecker::resumeTimeoutCheck):
2869 Do nothing if the timeout check hasn't been started.
2870 Use the right signal handler when unblocking.
2872 (KJS::Interpreter::handleTimeout):
2873 pause/resume the timeout check around the call to
2874 shouldInterruptScript().
2876 2006-06-16 Ben Goodger <beng@google.com>
2880 http://bugzilla.opendarwin.org/show_bug.cgi?id=9491
2881 Windows build breaks in interpreter.cpp
2883 * kjs/interpreter.cpp
2884 (KJS::TimeoutChecker::pauseTimeoutCheck):
2885 (KJS::TimeoutChecker::resumeTimeoutCheck):
2886 Make sure to only assert equality with s_executingInterpreter when it
2887 is being used (i.e. when HAVE(SYS_TIME_H) == true)
2889 2006-06-17 David Kilzer <ddkilzer@kilzer.net>
2893 http://bugzilla.opendarwin.org/show_bug.cgi?id=9477
2894 REGRESSION: fast/dom/replaceChild.html crashes on WebKit ToT in debug build
2897 (KJS::FunctionImp::callAsFunction): Refetch the debugger after executing the function
2898 in case the WebFrame it was running in has since been destroyed.
2900 2006-06-17 David Kilzer <ddkilzer@kilzer.net>
2904 http://bugzilla.opendarwin.org/show_bug.cgi?id=9476
2905 REGRESSION: Reproducible crash after closing window after viewing
2906 css2.1/t0803-c5501-imrgn-t-00-b-ag.html
2909 (Debugger::detach): Call setDebugger(0) for all interpreters removed from
2910 the 'attached to a debugger' list.
2912 2006-06-17 Anders Carlsson <acarlsson@apple.com>
2914 Reviewed by Maciej and Geoff.
2916 http://bugzilla.opendarwin.org/show_bug.cgi?id=7080
2917 Provide some way to stop a JavaScript infinite loop
2921 Add Interrupted completion type.
2924 (KJS::FunctionImp::callAsFunction):
2925 (KJS::GlobalFuncImp::callAsFunction):
2926 Only set the exception on the new ExecState if the current one has had one.
2928 * kjs/interpreter.cpp:
2929 (KJS::TimeoutChecker::startTimeoutCheck):
2930 (KJS::TimeoutChecker::stopTimeoutCheck):
2931 (KJS::TimeoutChecker::alarmHandler):
2932 (KJS::TimeoutChecker::pauseTimeoutCheck):
2933 (KJS::TimeoutChecker::resumeTimeoutCheck):
2934 New TimeoutChecker class which handles setting Interpreter::m_timedOut flag after a given
2935 period of time. This currently only works on Unix platforms where setitimer and signals are used.
2937 (KJS::Interpreter::Interpreter):
2938 Initialize new member variables.
2940 (KJS::Interpreter::~Interpreter):
2941 Destroy the timeout checker.
2943 (KJS::Interpreter::startTimeoutCheck):
2944 (KJS::Interpreter::stopTimeoutCheck):
2945 (KJS::Interpreter::pauseTimeoutCheck):
2946 (KJS::Interpreter::resumeTimeoutCheck):
2947 Call the timeout checker.
2949 (KJS::Interpreter::handleTimeout):
2950 Called on timeout. Resets the m_timedOut flag and calls shouldInterruptScript.
2952 * kjs/interpreter.h:
2953 (KJS::Interpreter::setTimeoutTime):
2954 New function for setting the timeout time.
2956 (KJS::Interpreter::shouldInterruptScript):
2957 New function. The idea is that this should be overridden by subclasses in order to for example
2958 pop up a dialog asking the user if the script should be interrupted.
2960 (KJS::Interpreter::checkTimeout):
2961 New function which checks the m_timedOut flag and calls handleTimeout if it's set.
2964 (DoWhileNode::execute):
2965 (WhileNode::execute):
2967 Call Interpreter::checkTimeout after each iteration of the loop.
2969 2006-06-15 Timothy Hatcher <timothy@apple.com>
2971 Reviewed by Geoff and Darin.
2973 Prefer the DWARF debugging symbols format for use in Xcode 2.3.
2975 * JavaScriptCore.xcodeproj/project.pbxproj:
2977 2006-06-14 Geoffrey Garen <ggaren@apple.com>
2981 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=9438
2982 Someone broke ToT: cannot build
2984 * JavaScriptCore.xcodeproj/project.pbxproj:
2985 * bindings/runtime_root.h: Changed "Interpreter.h" to "interpreter.h"
2987 2006-06-12 Geoffrey Garen <ggaren@apple.com>
2991 * bindings/objc/WebScriptObject.mm:
2992 (+[WebScriptObject throwException:]): Restore assignment I accidentally
2993 deleted in previous commit
2995 2006-06-12 Geoffrey Garen <ggaren@apple.com>
2997 Reviewed by TimO, Maciej.
2999 - Merged InterpreterImp code into Interpreter, which implements
3000 all interpreter functionality now. This is part of my continuing quest
3001 to create an external notion of JS "execution context" that is unified and simple --
3002 something to replace the mix of Context, ContextImp, ExecState, Interpreter,
3003 InterpreterImp, and JSRun.
3005 All tests pass. Leaks test has not regressed from its baseline ~207 leaks
3006 with ~3460 leaked nodes.
3008 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3009 * JavaScriptCore.xcodeproj/project.pbxproj:
3010 * bindings/NP_jsobject.cpp:
3011 * bindings/objc/WebScriptObject.mm:
3012 (+[WebScriptObject throwException:]):
3013 * bindings/runtime_root.cpp:
3014 * bindings/runtime_root.h:
3016 (KJS::Context::Context):
3017 * kjs/ExecState.cpp: Added.
3018 (KJS::ExecState::lexicalInterpreter):
3019 * kjs/ExecState.h: Added.
3020 (KJS::ExecState::dynamicInterpreter):
3021 * kjs/SavedBuiltins.h: Added.
3022 * kjs/bool_object.cpp:
3023 (BooleanPrototype::BooleanPrototype):
3024 * kjs/collector.cpp:
3025 (KJS::Collector::collect):
3026 (KJS::Collector::numInterpreters):
3032 (KJS::FunctionImp::callAsFunction):
3033 (KJS::GlobalFuncImp::callAsFunction):
3034 * kjs/function_object.cpp:
3035 (FunctionObjectImp::construct):
3038 * kjs/interpreter.cpp:
3039 (KJS::interpreterMap):
3040 (KJS::Interpreter::Interpreter):
3041 (KJS::Interpreter::init):
3042 (KJS::Interpreter::~Interpreter):
3043 (KJS::Interpreter::globalObject):
3044 (KJS::Interpreter::initGlobalObject):
3045 (KJS::Interpreter::globalExec):
3046 (KJS::Interpreter::checkSyntax):
3047 (KJS::Interpreter::evaluate):
3048 (KJS::Interpreter::builtinObject):
3049 (KJS::Interpreter::builtinFunction):
3050 (KJS::Interpreter::builtinArray):
3051 (KJS::Interpreter::builtinBoolean):
3052 (KJS::Interpreter::builtinString):
3053 (KJS::Interpreter::builtinNumber):
3054 (KJS::Interpreter::builtinDate):
3055 (KJS::Interpreter::builtinRegExp):
3056 (KJS::Interpreter::builtinError):
3057 (KJS::Interpreter::builtinObjectPrototype):
3058 (KJS::Interpreter::builtinFunctionPrototype):
3059 (KJS::Interpreter::builtinArrayPrototype):
3060 (KJS::Interpreter::builtinBooleanPrototype):
3061 (KJS::Interpreter::builtinStringPrototype):
3062 (KJS::Interpreter::builtinNumberPrototype):
3063 (KJS::Interpreter::builtinDatePrototype):
3064 (KJS::Interpreter::builtinRegExpPrototype):
3065 (KJS::Interpreter::builtinErrorPrototype):
3066 (KJS::Interpreter::builtinEvalError):
3067 (KJS::Interpreter::builtinRangeError):
3068 (KJS::Interpreter::builtinReferenceError):
3069 (KJS::Interpreter::builtinSyntaxError):
3070 (KJS::Interpreter::builtinTypeError):
3071 (KJS::Interpreter::builtinURIError):
3072 (KJS::Interpreter::builtinEvalErrorPrototype):
3073 (KJS::Interpreter::builtinRangeErrorPrototype):
3074 (KJS::Interpreter::builtinReferenceErrorPrototype):
3075 (KJS::Interpreter::builtinSyntaxErrorPrototype):
3076 (KJS::Interpreter::builtinTypeErrorPrototype):
3077 (KJS::Interpreter::builtinURIErrorPrototype):
3078 (KJS::Interpreter::mark):
3079 (KJS::Interpreter::interpreterWithGlobalObject):
3080 (KJS::Interpreter::saveBuiltins):
3081 (KJS::Interpreter::restoreBuiltins):
3082 * kjs/interpreter.h:
3083 (KJS::Interpreter::setCompatMode):
3084 (KJS::Interpreter::compatMode):
3085 (KJS::Interpreter::firstInterpreter):
3086 (KJS::Interpreter::nextInterpreter):
3087 (KJS::Interpreter::prevInterpreter):
3088 (KJS::Interpreter::debugger):
3089 (KJS::Interpreter::setDebugger):
3090 (KJS::Interpreter::setContext):
3091 (KJS::Interpreter::context):
3093 (StatementNode::hitStatement):
3094 (RegExpNode::evaluate):
3097 2006-06-12 Geoffrey Garen <ggaren@apple.com>
3101 - Have *.lut.h files #include lookup.h to eliminate surprising header
3102 include order dependency.
3104 * DerivedSources.make:
3105 * kjs/array_object.cpp:
3106 * kjs/date_object.cpp:
3107 * kjs/date_object.h:
3108 (KJS::DateProtoFunc::):
3110 * kjs/math_object.cpp:
3111 * kjs/number_object.cpp:
3112 * kjs/regexp_object.cpp:
3113 * kjs/string_object.cpp:
3115 2006-06-10 Geoffrey Garen <ggaren@apple.com>
3117 - http://bugzilla.opendarwin.org/show_bug.cgi?id=8515
3118 Linux porting compile bug
3120 Fix by Mike Emmel, Reviewed by Darin.
3122 * JavaScriptCoreSources.bkl:
3126 2006-06-09 Geoffrey Garen <ggaren@apple.com>
3128 Build fix -- I think :).
3130 * JavaScriptCore.xcodeproj/project.pbxproj:
3133 2006-06-09 Geoffrey Garen <ggaren@apple.com>
3135 Reviewed by Eric (yay!).
3137 - Removed Context wrapper for ContextImp, renamed ContextImp to Context,
3138 split Context into its own file -- Context.cpp -- renamed _var to m_var,
3139 change ' *' to '* '.
3141 * JavaScriptCore.xcodeproj/project.pbxproj:
3142 * kjs/Context.cpp: Added.
3143 (KJS::Context::Context):
3144 (KJS::Context::~Context):
3145 (KJS::Context::mark):
3147 (KJS::Context::scopeChain):
3148 (KJS::Context::variableObject):
3149 (KJS::Context::setVariableObject):
3150 (KJS::Context::thisValue):
3151 (KJS::Context::callingContext):
3152 (KJS::Context::activationObject):
3153 (KJS::Context::currentBody):
3154 (KJS::Context::function):
3155 (KJS::Context::arguments):
3156 (KJS::Context::pushScope):
3157 (KJS::Context::seenLabels):
3159 (KJS::FunctionImp::callAsFunction):
3160 (KJS::FunctionImp::processParameters):
3161 (KJS::FunctionImp::argumentsGetter):
3162 (KJS::GlobalFuncImp::callAsFunction):
3164 (KJS::InterpreterImp::evaluate):
3166 (KJS::InterpreterImp::setContext):
3167 (KJS::InterpreterImp::context):
3168 * kjs/interpreter.cpp:
3169 * kjs/interpreter.h:
3170 (KJS::ExecState::context):
3171 (KJS::ExecState::ExecState):
3175 (ThisNode::evaluate):
3176 (ResolveNode::evaluate):
3177 (FunctionCallResolveNode::evaluate):
3178 (PostfixResolveNode::evaluate):
3179 (DeleteResolveNode::evaluate):
3180 (TypeOfResolveNode::evaluate):
3181 (PrefixResolveNode::evaluate):
3182 (AssignResolveNode::evaluate):
3183 (VarDeclNode::evaluate):
3184 (VarDeclNode::processVarDecls):
3185 (DoWhileNode::execute):
3186 (WhileNode::execute):
3188 (ForInNode::execute):
3189 (ContinueNode::execute):
3190 (BreakNode::execute):
3191 (ReturnNode::execute):
3192 (WithNode::execute):
3193 (SwitchNode::execute):
3194 (LabelNode::execute):
3196 (FuncDeclNode::processFuncDecl):
3197 (FuncExprNode::evaluate):
3199 2006-06-07 Geoffrey Garen <ggaren@apple.com>
3201 Removed API directory I prematurely/accidentally added.
3205 2006-06-05 Mitz Pettel <opendarwin.org@mitzpettel.com>
3207 Reviewed and landed by Geoff.
3209 - fix a regression in ecma_3/String/regress-104375.js
3211 * kjs/string_object.cpp:
3212 (substituteBackreferences): If a 2-digit back reference is out of range,
3213 parse it as a 1-digit reference (followed by the other digit). This matches
3216 2006-06-05 Geoffrey Garen <ggaren@apple.com>
3219 Darin already reviewed this change on the branch. See <rdar://problem/4317701>.
3221 - Fixed <rdar://problem/4291345> PCRE overflow in Safari JavaScriptCore
3223 No test case because there's no behavior change.
3225 * pcre/pcre_compile.c:
3226 (read_repeat_counts): Check for integer overflow / out of bounds
3228 2006-06-05 Geoffrey Garen <ggaren@apple.com>
3232 - Changed CString length from int to size_t. We sould probably do this
3233 for UString, too. (Darin, if you're reading this: Maciej said so.)
3238 (KJS::CString::CString):
3241 (KJS::CString::size):
3243 2006-06-04 Geoffrey Garen <ggaren@apple.com>
3247 - http://bugzilla.opendarwin.org/show_bug.cgi?id=9304
3248 Minor cleanup in JavaScriptCore
3250 * kjs/value.h: Removed redundant declarations
3252 2006-06-04 Darin Adler <darin@apple.com>
3256 - changed deleteAllValues so it can work on "const" collections
3257 Deleting the values affects the values, not the pointers in the
3258 collection, so it's legitimate to do it to a const collection,
3259 and a case of that actually came up in the XPath code.
3262 (WTF::deleteAllPairSeconds): Use const iterators.
3263 (WTF::deleteAllValues): Take const HashMap reference as a parameter.
3265 (WTF::deleteAllValues): Take const HashSet reference as a parameter,
3266 and use const iterators.
3268 (WTF::deleteAllValues): Take const Vector reference as a parameter.
3270 - added more functions that are present in <math.h> on some platforms,
3271 but not on others; moved here from various files in WebCore
3282 2006-06-02 Mitz Pettel <opendarwin.org@mitzpettel.com>
3286 - http://bugzilla.opendarwin.org/show_bug.cgi?id=9234
3287 Implement $&, $' and $` replacement codes in String.prototype.replace
3289 Test: fast/js/string-replace-3.html
3291 * kjs/string_object.cpp:
3292 (substituteBackreferences): Added support for $& (matched substring),
3293 $` (everything preceding matched substring), $' (everything following
3294 matched substring) and 2-digit back references, and cleaned up a little.
3296 2006-06-02 Adele Peterson <adele@apple.com>
3300 Set incremental linking to no. This seems to fix a build problem I was seeing
3301 where dftables couldn't find a dll.
3303 * JavaScriptCore.vcproj/dftables/dftables.vcproj:
3305 2006-05-26 Steve Falkenburg <sfalken@apple.com>
3309 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3311 === JavaScriptCore-521.11 ===
3313 2006-05-24 Geoffrey Garen <ggaren@apple.com>
3317 - JSC half of fix for <rdar://problem/4557926> TOT REGRESSSION: Crash
3318 occurs when attempting to view image in slideshow mode at
3319 http://d.smugmug.com/gallery/581716 ( KJS::IfNode::execute
3320 (KJS::ExecState*) + 312)
3322 On alternate threads, DOMObjects remain in the
3323 ScriptInterpreter's cache because they're not collected. So, they
3324 need an opportunity to mark their children.
3326 I'm not particularly happy with this solution because it fails to
3327 resolve many outstanding issues with the DOM object cache. Since none
3328 of those issues is a crasher or a serious compatibility concern,
3329 and since the behavior of other browsers is not much to go on in this
3330 case, I've filed <rdar://problem/4561439> about that, and I'm moving on
3333 * JavaScriptCore.xcodeproj/project.pbxproj:
3334 * kjs/collector.cpp:
3335 (KJS::Collector::collect):
3337 (KJS::InterpreterImp::mark):
3339 * kjs/interpreter.cpp:
3340 (KJS::Interpreter::mark):
3341 * kjs/interpreter.h:
3343 === JavaScriptCore-521.10 ===
3345 2006-05-22 Timothy Hatcher <timothy@apple.com>
3347 Reviewed by Eric, Kevin and Geoff.
3349 Merge open source build fixes. <rdar://problem/4555500>
3351 * kjs/collector.cpp: look at the rsp register in x86_64
3352 (KJS::Collector::markOtherThreadConservatively):
3353 * wtf/Platform.h: add x86_64 to the platform list
3355 2006-05-19 Anders Carlsson <acarlsson@apple.com>
3359 http://bugzilla.opendarwin.org/show_bug.cgi?id=8993
3360 Support function declaration in case statements
3362 * kjs/grammar.y: Get rid of StatementList and use SourceElements instead.
3365 (CaseClauseNode::evalStatements):
3366 (CaseClauseNode::processVarDecls):
3367 (CaseClauseNode::processFuncDecl):
3368 (ClauseListNode::processFuncDecl):
3369 (CaseBlockNode::processFuncDecl):
3370 (SwitchNode::processFuncDecl):
3372 (KJS::CaseClauseNode::CaseClauseNode):
3373 (KJS::ClauseListNode::ClauseListNode):
3374 (KJS::ClauseListNode::getClause):
3375 (KJS::ClauseListNode::getNext):
3376 (KJS::ClauseListNode::releaseNext):
3377 (KJS::SwitchNode::SwitchNode):
3378 Add processFuncDecl for the relevant nodes.
3380 * kjs/nodes2string.cpp:
3381 (CaseClauseNode::streamTo):
3382 next got renamed to source.
3384 2006-05-17 George Staikos <staikos@kde.org>
3386 Reviewed by Maciej, Alexey, and Eric.
3388 * pcre/pcre_compile.c:
3391 * wtf/UnusedParam.h:
3392 Use /**/ in .c files to compile with non-C99 and non-GCC compilers.
3395 Change include to <wtf/HashTraits.h> from "HashTraits.h" to avoid -I
3397 * wtf/unicode/qt4/UnicodeQt4.h:
3398 Use correct parentheses and correct mask for utf-32 support.
3400 2006-05-17 Alexey Proskuryakov <ap@nypop.com>
3404 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8870
3405 Crash typing in Yahoo auto-complete widget.
3407 Test: fast/js/regexp-stack-overflow.html
3409 * pcre/pcre-config.h: Define NO_RECURSE.
3411 2006-05-16 George Staikos <staikos@kde.org>
3415 Fix some warnings and strict compilation errors.
3420 2006-05-15 Alexey Proskuryakov <ap@nypop.com>
3422 * make-generated-sources.sh: Changed to be executable and removed
3423 text in the file generated by "svn diff".
3425 2006-05-15 Geoffrey Garen <ggaren@apple.com>
3429 - Fixed <rdar://problem/4534904> please do not treat "debugger" as
3430 a reserved word while parsing JavaScript (and other ECMA reserved
3435 http://bugzilla.opendarwin.org/show_bug.cgi?id=6179
3436 We treat "char" as a reserved word in JavaScript and firefox/IE do
3439 (1) I unreserved most of the spec's "future reserved words" because
3440 they're not reserved in IE or FF. (Most, but not all, because IE
3441 somewhat randomly *does* reserve a few of them.)
3442 (2) I made 'debugger' a legitimate statement that acts like an empty
3443 statement because FF and IE support it.
3446 * kjs/keywords.table:
3448 2006-05-15 Tim Omernick <timo@apple.com>
3450 Reviewed by John Sullivan.
3452 Part of <rdar://problem/4466508> Add 64-bit support to the Netscape Plugin API
3454 Added to the Netscape Plugin API the concept of "plugin drawing models". The drawing model
3455 determines the kind of graphics context created by the browser for the plugin, as well as
3456 the Mac types of various Netscape Plugin API data structures.
3458 There is a drawing model to represent the old QuickDraw-based API. It is used by default
3459 if QuickDraw is available on the system, unless the plugin specifies another drawing model.
3461 The big change is the addition of the CoreGraphics drawing model. A plugin may request this
3462 drawing model to obtain access to a CGContextRef for drawing, instead of a QuickDraw CGrafPtr.
3465 Define NP_NO_QUICKDRAW when compiling 64-bit; there is no 64-bit QuickDraw.
3466 Added NPNVpluginDrawingModel, NPNVsupportsQuickDrawBool, and NPNVsupportsCoreGraphicsBool
3468 Added NPDrawingModel enumeration. Currently the only drawing models are QuickDraw and
3470 NPRegion's type now depends on the drawing model specified by the plugin.
3471 NP_Port is now only defined when QuickDraw is available.
3472 Added NP_CGContext, which is the type of the NPWindow's "window" member in CoreGraphics mode.
3474 2006-05-13 Kevin M. Ollivier <kevino@theolliviers.com>
3476 Reviewed by Darin, landed by ap.
3478 - http://bugzilla.opendarwin.org/show_bug.cgi?id=8528
3479 Bakefiles (and generated Makefiles) for wx and gdk ports
3481 * make-generated-sources.sh:
3482 Added script to configure environment to run DerivedSources.make
3484 * JavaScriptCoreSources.bkl:
3485 Added JavaScriptCore sources list for Bakefile.
3488 Bakefile used to generate JavaScriptCore project files
3489 (currently only used by wx and gdk ports)
3491 2006-05-09 Steve Falkenburg <sfalken@apple.com>
3494 Minor fixes to WTF headers.
3498 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Fix include dirs, paths to files.
3499 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj: Fix include dirs.
3500 * wtf/Assertions.h: include Platform.h to get definition for COMPILER()
3501 * wtf/Vector.h: include FastMalloc.h for definition of fastMalloc, fastFree
3503 2006-05-09 Maciej Stachowiak <mjs@apple.com>
3505 Rubber stamped by Anders.
3507 - renamed kxmlcore to wtf
3513 * JavaScriptCore.xcodeproj/project.pbxproj:
3514 * bindings/c/c_instance.cpp:
3515 * bindings/objc/WebScriptObject.mm:
3516 * kjs/JSImmediate.h:
3519 * kjs/array_object.cpp:
3520 * kjs/collector.cpp:
3521 (KJS::Collector::registerThread):
3525 (KJS::isStrWhiteSpace):
3527 * kjs/identifier.cpp:
3532 (Lexer::isWhiteSpace):
3533 (Lexer::isIdentStart):
3534 (Lexer::isIdentPart):
3538 * kjs/number_object.cpp:
3540 * kjs/property_map.cpp:
3541 * kjs/property_map.h:
3542 * kjs/string_object.cpp:
3543 (StringProtoFunc::callAsFunction):
3548 * kxmlcore: Removed.
3549 * kxmlcore/AlwaysInline.h: Removed.
3550 * kxmlcore/Assertions.cpp: Removed.
3551 * kxmlcore/Assertions.h: Removed.
3552 * kxmlcore/FastMalloc.cpp: Removed.
3553 * kxmlcore/FastMalloc.h: Removed.
3554 * kxmlcore/FastMallocInternal.h: Removed.
3555 * kxmlcore/Forward.h: Removed.
3556 * kxmlcore/HashCountedSet.h: Removed.
3557 * kxmlcore/HashFunctions.h: Removed.
3558 * kxmlcore/HashMap.h: Removed.
3559 * kxmlcore/HashSet.h: Removed.
3560 * kxmlcore/HashTable.cpp: Removed.
3561 * kxmlcore/HashTable.h: Removed.
3562 * kxmlcore/HashTraits.h: Removed.
3563 * kxmlcore/ListRefPtr.h: Removed.
3564 * kxmlcore/Noncopyable.h: Removed.
3565 * kxmlcore/OwnArrayPtr.h: Removed.
3566 * kxmlcore/OwnPtr.h: Removed.
3567 * kxmlcore/PassRefPtr.h: Removed.
3568 * kxmlcore/Platform.h: Removed.
3569 * kxmlcore/RefPtr.h: Removed.
3570 * kxmlcore/TCPageMap.h: Removed.
3571 * kxmlcore/TCSpinLock.h: Removed.
3572 * kxmlcore/TCSystemAlloc.cpp: Removed.
3573 * kxmlcore/TCSystemAlloc.h: Removed.
3574 * kxmlcore/UnusedParam.h: Removed.
3575 * kxmlcore/Vector.h: Removed.
3576 * kxmlcore/VectorTraits.h: Removed.
3577 * kxmlcore/unicode: Removed.
3578 * kxmlcore/unicode/Unicode.h: Removed.
3579 * kxmlcore/unicode/UnicodeCategory.h: Removed.
3580 * kxmlcore/unicode/icu: Removed.
3581 * kxmlcore/unicode/icu/UnicodeIcu.h: Removed.
3582 * kxmlcore/unicode/posix: Removed.
3583 * kxmlcore/unicode/qt3: Removed.
3584 * kxmlcore/unicode/qt4: Removed.
3585 * kxmlcore/unicode/qt4/UnicodeQt4.h: Removed.
3588 * wtf/Assertions.cpp:
3590 * wtf/FastMalloc.cpp:
3591 (WTF::TCMalloc_ThreadCache::Scavenge):
3594 (WTF::TCMallocGuard::TCMallocGuard):
3601 * wtf/FastMallocInternal.h:
3603 * wtf/HashCountedSet.h:
3604 * wtf/HashFunctions.h:
3607 * wtf/HashTable.cpp:
3611 * wtf/Noncopyable.h:
3612 * wtf/OwnArrayPtr.h:
3616 * wtf/TCSystemAlloc.cpp:
3617 (TCMalloc_SystemAlloc):
3619 * wtf/VectorTraits.h:
3620 * wtf/unicode/UnicodeCategory.h:
3621 * wtf/unicode/icu/UnicodeIcu.h:
3623 2006-05-08 Timothy Hatcher <timothy@apple.com>
3627 * bindings/npapi.h: do not define #pragma options align=mac68k if we are 64-bit
3629 2006-05-07 Darin Adler <darin@apple.com>
3631 Reviewed and landed by Maciej.
3633 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8765
3634 Random crashes on TOT since the form state change
3636 I haven't figured out how to construct a test for this, but this does seem to fix the
3637 problem; Mitz mentioned that a double-destroy was occurring in these functions.
3639 * kxmlcore/HashMap.h: (KXMLCore::HashMap::remove): Use RefCounter::deref instead of calling
3640 ~ValueType, because ~ValueType often results in a double-destroy, since the HashTable also
3641 destroys the element based on the storage type. The RefCounter template correctly does work
3642 only in cases where ValueType and ValueStorageType differ and this class is what's used
3643 elsewhere for the same purpose; I somehow missed this case when optimizing HashMap.
3644 * kxmlcore/HashSet.h: (KXMLCore::HashSet::remove): Ditto.
3646 2006-05-05 Darin Adler <darin@apple.com>
3648 - http://bugzilla.opendarwin.org/show_bug.cgi?id=8722
3649 IE compatibility fix in date parsing
3651 * kjs/date_object.cpp: (KJS::parseDate): Merged change that George Staikos provided
3652 from KDE 3.4.3 branch that allows day values of 0 and values that are > 1000.
3654 2006-05-04 Anders Carlsson <andersca@mac.com>
3658 http://bugzilla.opendarwin.org/show_bug.cgi?id=8734
3659 Would like a Vector::append that takes another Vector
3661 * kxmlcore/Vector.h:
3662 (KXMLCore::::append):
3663 New function that takes another array.
3665 2006-05-02 Steve Falkenburg <sfalken@apple.com>
3669 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: set NDEBUG for release build
3670 * kxmlcore/FastMalloc.cpp: Prevent USE_SYSTEM_MALLOC from being defined twice
3672 2006-05-02 Anders Carlsson <andersca@mac.com>
3676 * kxmlcore/HashMap.h:
3677 (KXMLCore::::operator):
3680 2006-05-01 Tim Omernick <timo@apple.com>
3682 Reviewed by Tim Hatcher.
3684 <rdar://problem/4476875> Support printing for embedded Netscape plugins
3687 Fixed struct alignment problem in our npapi.h. Structs must be 68k-aligned on both pre-Mac OS X
3688 and Mac OS X systems, as this is what plugins expect.
3690 2006-05-01 Timothy Hatcher <timothy@apple.com>
3694 <rdar://problem/4308243> 8F36 Regression: crash in malloc_consolidate if you use a .PAC file
3696 The original fix missed the oversized cell case. Added a test for "currentThreadIsMainThread ||
3697 imp->m_destructorIsThreadSafe" where we collect oversized cells.
3699 We don't have a way to test PAC files yet, so there's no test attached.
3701 * kjs/collector.cpp:
3702 (KJS::Collector::collect): test the thread when we collect oversized cells
3704 2006-05-01 Tim Omernick <timo@apple.com>
3708 <rdar://problem/4526114> REGRESSION (two days ago): LOG() just prints @ for NSObject substitutions
3710 * kxmlcore/Assertions.cpp:
3711 Changed sense of strstr("%@") check. I already made the same fix to the WebBrowser assertions.
3713 2006-04-28 Steve Falkenburg <sfalken@apple.com>
3717 Actually apply the change that was reviewed insted of checking it in with an #if 0 (oops).
3720 (main): Suppress C runtime alerts
3722 2006-04-28 Steve Falkenburg <sfalken@apple.com>
3726 Suppress error reporting dialog that blocks Javascript tests from completing.
3728 Real error is due to an overflow in the date/time handling functions that needs
3729 to be addressed, but this will prevent the hang running the Javascript tests
3730 on the build bot (along with the related changes).
3733 (main): Suppress C runtime alerts
3735 2006-04-27 Geoffrey Garen <ggaren@apple.com>
3739 - Minor fixups I discovered while working on the autogenerator.
3742 (findEntry): ASSERT that size is not 0, because otherwise we'll % by 0,
3743 compute a garbage address, and possibly crash.
3745 (cacheGlobalObject): Don't enumerate cached objects -- ideally, they
3746 would be hidden entirely.
3748 2006-04-21 Kevin M. Ollivier <kevino@theolliviers.com>
3752 - http://bugzilla.opendarwin.org/show_bug.cgi?id=8507
3753 Compilation fixes for building on gcc 4.0.2, and without precomp headers
3756 * kxmlcore/Assertions.cpp:
3757 * kxmlcore/FastMalloc.cpp:
3758 Added necessary headers to resolve compilation issues when not using
3759 precompiled headers.
3761 * kjs/value.h: Declare the JSCell class before friend declaration
3762 to resolve compilation issues with gcc 4.0.2.
3764 * kxmlcore/Platform.h: Set Unicode support to use ICU on platforms
3765 other than KDE (previously only defined for Win and Mac OS)
3767 2006-04-18 Eric Seidel <eseidel@apple.com>
3771 Fix "new Function()" to correctly use lexical scoping.
3772 Add ScopeChain::print() function for debugging.
3773 <rdar://problem/4067864> REGRESSION (125-407): JavaScript failure on PeopleSoft REN Server
3775 * kjs/function_object.cpp:
3776 (FunctionObjectImp::construct):
3777 * kjs/scope_chain.cpp:
3778 (KJS::ScopeChain::print):
3779 * kjs/scope_chain.h:
3781 2006-04-14 James G. Speth <speth@end.com>
3783 Reviewed by Timothy.
3785 Bug 8389: support for Cocoa bindings - binding an NSTreeController to the WebView's DOM
3786 http://bugzilla.opendarwin.org/show_bug.cgi?id=8389
3788 Adds a category to WebScriptObject with array accessors for KVC/KVO.
3790 If super valueForKey: fails it will call valueForUndefinedKey:, which is
3791 important because it causes the right behavior to happen with bindings using
3792 the "Raises for Not Applicable Keys" flag and the "Not Applicable Placeholder"
3794 * bindings/objc/WebScriptObject.mm:
3795 (-[WebScriptObject valueForKey:]):
3796 (-[WebScriptObject count]):
3797 (-[WebScriptObject objectAtIndex:]):
3798 (-[WebUndefined description]): return "undefined"
3800 2006-04-13 Geoffrey Garen <ggaren@apple.com>
3805 (KJS::InterpreterImp::initGlobalObject): Add the built-in object
3806 prototype to the end of the global object's prototype chain instead of
3807 just blowing away its existing prototype. We need to do this because
3808 the window object has a meaningful prototype now.
3810 2006-04-13 Maciej Stachowiak <mjs@apple.com>
3814 - fix testkjs to not show false-positive KJS::Node leaks in debug builds
3820 2006-04-11 Geoffrey Garen <ggaren@apple.com>
3824 Minor code cleanup -- passes all the JS tests.
3826 * kjs/object_object.cpp:
3827 (ObjectObjectImp::construct):
3828 (ObjectObjectImp::callAsFunction):
3830 2006-04-11 Darin Adler <darin@apple.com>
3832 - another attempt to fix Windows build -- Vector in Forward.h was not working
3834 * kxmlcore/Forward.h: Remove Vector.
3835 * kxmlcore/Vector.h: Add back default arguments, remove include of
3838 2006-04-11 Darin Adler <darin@apple.com>
3840 - try to fix Windows build -- HashForward.h was not working
3842 * kxmlcore/HashForward.h: Removed.
3844 * JavaScriptCore.xcodeproj/project.pbxproj: Remove HashForward.h.
3845 * kjs/collector.h: Remove use of HashForward.h.
3846 * kxmlcore/HashCountedSet.h: Remove include of HashForward.h, restore
3848 * kxmlcore/HashMap.h: Ditto.
3849 * kxmlcore/HashSet.h: Ditto.
3851 2006-04-11 David Harrison <harrison@apple.com>
3855 - fixed clean build, broken by Darin's check-in
3857 * kjs/date_object.cpp: Add needed include of lookup.h.
3858 * kjs/regexp_object.cpp: Move include of .lut.h file below other includes.
3860 2006-04-10 Darin Adler <darin@apple.com>
3862 Rubber-stamped by John Sullivan.
3864 - switched from a shell script to a makefile for generated files
3865 - removed lots of unneeded includes
3866 - added new Forward.h and HashForward.h headers that allow compiling with
3867 fewer unneeded templates
3869 * DerivedSources.make: Added.
3870 * generate-derived-sources: Removed.
3871 * JavaScriptCore.xcodeproj/project.pbxproj: Added new files, changed to use
3872 DerivedSources.make.
3874 * kxmlcore/Forward.h: Added.
3875 * kxmlcore/HashForward.h: Added.
3877 * kxmlcore/HashCountedSet.h: Include HashForward for default args.
3878 * kxmlcore/HashMap.h: Ditto.
3879 * kxmlcore/HashSet.h: Ditto.
3883 Moved KJS_MAX_STACK into the .cpp file.
3885 * bindings/NP_jsobject.cpp:
3886 * bindings/c/c_instance.h:
3887 * bindings/jni/jni_class.h:
3888 * bindings/jni/jni_runtime.h:
3889 * bindings/jni/jni_utility.h:
3890 * bindings/objc/WebScriptObject.mm:
3891 * bindings/objc/WebScriptObjectPrivate.h:
3892 * bindings/objc/objc_class.h:
3893 * bindings/objc/objc_class.mm:
3894 * bindings/objc/objc_instance.h:
3895 * bindings/objc/objc_instance.mm:
3896 * bindings/objc/objc_runtime.mm:
3897 * bindings/objc/objc_utility.mm:
3898 * bindings/runtime.h:
3899 * bindings/runtime_array.cpp:
3900 * bindings/runtime_array.h:
3901 * bindings/runtime_method.cpp:
3902 * bindings/runtime_method.h:
3903 * bindings/runtime_object.cpp:
3904 * bindings/runtime_root.h:
3905 * kjs/JSImmediate.cpp:
3907 * kjs/array_object.cpp:
3908 * kjs/array_object.h:
3909 * kjs/bool_object.cpp:
3910 * kjs/bool_object.h:
3914 * kjs/error_object.h:
3915 * kjs/function_object.h:
3918 * kjs/math_object.cpp:
3919 * kjs/math_object.h:
3922 * kjs/number_object.cpp:
3923 * kjs/number_object.h:
3924 * kjs/object_object.cpp:
3925 * kjs/operations.cpp:
3926 * kjs/protected_reference.h:
3928 * kjs/reference_list.h:
3929 * kjs/regexp_object.h:
3930 * kjs/string_object.cpp:
3931 * kjs/string_object.h:
3935 * kxmlcore/HashTable.h:
3936 * kxmlcore/ListRefPtr.h:
3937 * kxmlcore/TCPageMap.h:
3938 * kxmlcore/Vector.h:
3939 Removed unneeded header includes.
3941 2006-04-09 Geoffrey Garen <ggaren@apple.com>
3945 - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=8284
3946 prevent unnecessary entries in the "nodes with extra refs" hash table
3948 This patch switches manually RefPtr exchange with use of
3949 RefPtr::release to ensure that a node's ref count never tops 1
3950 (in the normal case).
3953 (BlockNode::BlockNode):
3954 (CaseBlockNode::CaseBlockNode):
3956 (KJS::ArrayNode::ArrayNode):
3957 (KJS::ObjectLiteralNode::ObjectLiteralNode):
3958 (KJS::ArgumentsNode::ArgumentsNode):
3959 (KJS::VarStatementNode::VarStatementNode):
3960 (KJS::ForNode::ForNode):
3961 (KJS::CaseClauseNode::CaseClauseNode):
3962 (KJS::FuncExprNode::FuncExprNode):
3963 (KJS::FuncDeclNode::FuncDeclNode):
3965 2006-04-08 Alexey Proskuryakov <ap@nypop.com>
3969 One more attempt - use reinterpret_cast, rather than static_cast.
3971 2006-04-08 Alexey Proskuryakov <ap@nypop.com>
3975 An attempt to fix Win32 build - ICU uses wchar_t on Windows, so we need a type cast.
3977 * kxmlcore/unicode/icu/UnicodeIcu.h:
3978 (KXMLCore::Unicode::toLower):
3979 (KXMLCore::Unicode::toUpper):
3981 2006-04-08 Alexey Proskuryakov <ap@nypop.com>
3985 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8264
3986 toLowerCase and toUpperCase don't honor special mappings
3988 Test: fast/js/string-capitalization.html
3990 * JavaScriptCore.xcodeproj/project.pbxproj: Added KXMLCore::Unicode headers to the project.
3991 * icu/unicode/putil.h: Added (copied from WebCore).
3992 * icu/unicode/uiter.h: Ditto.
3993 * icu/unicode/ustring.h: Ditto.
3994 * kjs/string_object.cpp:
3995 (StringProtoFunc::callAsFunction): Use the new KXMLCore::Unicode::toUpper() and toLower().
3996 * kjs/ustring.cpp: Removed unused (and evil) UChar::toLower() and toUpper().
3997 * kjs/ustring.h: Ditto.
3999 * kxmlcore/unicode/Unicode.h: Corrected capitalization of the word Unicode.
4000 * kxmlcore/unicode/UnicodeCategory.h: Renamed include guard macro to match file name.
4002 * kxmlcore/unicode/icu/UnicodeIcu.h:
4003 (KXMLCore::Unicode::toLower): Work on strings, not individual characters. Use ICU root locale.
4004 (KXMLCore::Unicode::toUpper): Ditto.
4005 (KXMLCore::Unicode::isFormatChar): Use int32_t, which can hold a complete code point.
4006 (KXMLCore::Unicode::isSeparatorSpace): Ditto.
4007 (KXMLCore::Unicode::category): Ditto.
4008 * kxmlcore/unicode/qt4/UnicodeQt4.h:
4009 (KXMLCore::Unicode::toLower): Work on strings, not individual characters.
4010 (KXMLCore::Unicode::toUpper): Ditto.
4011 (KXMLCore::Unicode::isFormatChar): Use int32_t, which can hold a complete code point.
4012 (KXMLCore::Unicode::isSeparatorSpace): Ditto.
4013 (KXMLCore::Unicode::category): Ditto.
4015 * tests/mozilla/ecma/String/15.5.4.12-1.js: Corrected expected results.
4016 * tests/mozilla/ecma/String/15.5.4.12-5.js: Corrected expected results.
4018 2006-04-05 Darin Adler <darin@apple.com>
4020 - attempt to fix Windows build
4022 * kxmlcore/HashMap.h: (KXMLCore::HashMap::remove): Use (*it). instead of it->.
4023 * kxmlcore/HashSet.h: (KXMLCore::HashSet::remove): Ditto.
4025 2006-04-05 Darin Adler <darin@apple.com>
4027 - attempt to fix Windows build
4029 * os-win32/stdint.h: Add int8_t, uint8_t, int64_t.
4031 2006-04-05 Darin Adler <darin@apple.com>
4035 - fix memory leak introduced by the previous change
4037 * kxmlcore/HashTable.h: Specialize NeedsRef so that it correctly returns true when
4038 the value in question is a pair where one of the pair needs a ref and the other
4039 of the pair does not.
4041 2006-04-05 Darin Adler <darin@apple.com>
4045 - JavaScriptCore part of fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=8049
4046 StringImpl hash traits deleted value creates an init routine for WebCore
4047 <rdar://problem/4442248> REGRESSION: WebCore has init routines (8049)
4049 Change HashMap and HashSet implementation so they fold various types together.
4050 This allows us to implement maps and sets that use RefPtr<WebCore::StringImpl>
4051 and WebCore::String in terms of the underlying raw pointer type, and hence use
4052 -1 for the deleted value.
4054 * kxmlcore/HashTraits.h: Added a new type to HashTraits, StorageTraits, which is a
4055 type to be used when storing a value that has the same layout as the type itself.
4056 This is used only for non-key cases. In the case of keys, the hash function must also
4057 be considered. Moved emptyValue out of GenericHashTraitsBase into GenericHashTraits.
4058 Added a new bool to HashTraits, needsRef, which indicates whether the type needs
4059 explicit reference counting. If the type itself has needsRef true, but the storage
4060 type has needsRef false, then the HashSet or HashMap has to handle the reference
4061 counting explicitly. Added hash trait specializations for all signed integer values
4062 that give -1 as the deleted value. Gave all integers StorageTraits of the canonical
4063 integer type of the same size so int and long will share code. Gave all pointers and
4064 RefPtrs StorageTraits of the appropriately sized integer type. Removed redundant
4065 TraitType and emptyValue definitions in the pointer specialization for HashTraits.
4066 Added PairBaseHashTraits, which doesn't try to set up needsDestruction and deletedValue.
4067 Useful for types where we don't want to force the existence of deletedValue, such as
4068 the type of a pair in a HashMap which is not the actual storage type. Removed an
4069 unneeded parameter from the DeletedValueAssigner template. Added HashKeyStorageTraits
4070 template, which determines what type can be used to store a given hash key type with
4071 a given hash function, and specialized it for pointers and RefPtr so that pointer
4072 hash tables share an underlying HashTable that uses IntHash.
4074 * kxmlcore/HashTable.h: Added HashTableConstIteratorAdapter, HashTableIteratorAdapter,
4075 NeedsRef, RefCountManagerBase, RefCountManager, HashTableRefCountManagerBase, and
4076 HashTableRefCountManager. All are used by both HashSet and HashMap to handle hash
4077 tables where the type stored is not the same as the real value type.
4079 * kxmlcore/HashFunctions.h: Added a new struct named IntTypes that finds an
4080 integer type given a sizeof value. Renamed pointerHash to intHash and made it
4081 use overloading and take integer parameters. Added an IntHash struct which is
4082 a hash function that works for integers. Changed PtrHash to call IntHash with
4083 an appropriately sized integer. Made IntHash the default hash function for
4084 many integer types. Made PtrHash the default hash function for RefPtr as well
4085 as for raw pointers.
4087 * kxmlcore/HashSet.h: Changed implementation to use a separate "storage type"
4088 derived from the new traits. The HashTable will use the storage type and all
4089 necessary translation and ref/deref is done at the HashSet level. Also reorganized
4090 the file so that the HashSet is at the top and has no inline implementation inside
4091 it so it's easy to read the interface to HashSet.
4093 * kxmlcore/HashMap.h: Changed implementation to use a separate "storage type"
4094 derived from the new traits. The HashTable will use the storage type and all
4095 necessary translation and ref/deref is done at the HashMap level. Also reorganized
4096 the file so that the HashMap is at the top and has no inline implementation inside
4097 it so it's easy to read the interface to HashMap.
4099 * kxmlcore/HashMapPtrSpec.h: Removed. Superceded by optimizations in HashMap itself.
4101 * JavaScriptCore.xcodeproj/project.pbxproj: Remove HashMapPtrSpec.h, resort files,
4102 and also remove some unnecessary build settings from the aggregate target that
4103 generates derived sources.
4104 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Ditto.
4106 2006-04-04 Timothy Hatcher <timothy@apple.com>
4110 The Debug and Release frameworks are now built with install paths relative to the build products directory.
4111 This removes the need for other projects to build with -framework WebCore and -framework JavaScriptCore.
4113 * JavaScriptCore.xcodeproj/project.pbxproj:
4115 2006-04-04 Eric Seidel <eseidel@apple.com>
4120 Disable ASSERT redefinition warnings for now.
4122 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
4123 * kxmlcore/Assertions.h:
4125 2006-04-04 Bjrn Graf <bjoern.graf@gmail.com>
4127 Reviewed by ggaren & darin. Landed by eseidel.
4129 Integrate CURL version of gettimeofday
4130 http://bugzilla.opendarwin.org/show_bug.cgi?id=7399
4131 Disable crash report dialogs for testkjs.exe in Release mode
4132 http://bugzilla.opendarwin.org/show_bug.cgi?id=8113
4137 (StopWatch::getElapsedMS):
4141 2006-04-04 Eric Seidel <eseidel@apple.com>
4145 * kjs/number_object.cpp:
4146 (NumberProtoFunc::callAsFunction): remove trunc() to fix win32.
4148 2006-03-12 Maciej Stachowiak <mjs@apple.com>
4152 - fixed "toPrecision sometimes messes up the last digit on intel Macs"
4153 http://bugzilla.opendarwin.org/show_bug.cgi?id=7748
4155 * kjs/number_object.cpp:
4156 (intPow10): Compute integer powers of 10 using exponentiation by squaring.
4157 (NumberProtoFunc::callAsFunction): Use intPow10(n) in place of all pow(10.0, n),
4158 plus a bit of refactoring.
4160 2006-04-03 Darin Adler <darin@apple.com>
4162 - tweak config.h and Platform.h to try to get buildbot working
4163 (making some small changes at the same time)
4165 * kjs/config.h: Removed now-unneeded HAVE_ICU.