3 2006-09-11 Brady Eidson <beidson@apple.com>
5 Build fix - I think Tim's last checkin wasn't tested on Tiger, possibly. I simply
6 commented out the undefined constants until he can have a chance to make the right call
8 * bindings/objc/objc_utility.mm:
9 (KJS::Bindings::objcValueTypeForType): Commented out undefined symbols
11 2006-09-11 Timothy Hatcher <timothy@apple.com>
13 Reviewed by Tim O. and Darin.
15 Add support for more method signatures affecting ObjC methods called from JavaScript:
16 - Added unsigned types and long long.
17 - Allow methods that use const, oneway, bycopy and byref type modifiers.
19 * bindings/objc/objc_instance.mm:
20 (ObjcInstance::invokeMethod):
21 * bindings/objc/objc_utility.h:
23 * bindings/objc/objc_utility.mm:
24 (KJS::Bindings::convertValueToObjcValue):
25 (KJS::Bindings::convertObjcValueToValue):
26 (KJS::Bindings::objcValueTypeForType):
28 2006-09-05 Timothy Hatcher <timothy@apple.com>
32 <rdar://problem/4715840> SEL is not char*
34 * bindings/objc/objc_class.mm:
35 (KJS::Bindings::ObjcClass::methodsNamed): use sel_getName instead of a char* cast.
36 * bindings/objc/objc_runtime.mm:
37 (ObjcFallbackObjectImp::callAsFunction): ditto
39 2006-09-03 Alexey Proskuryakov <ap@nypop.com>
43 http://bugzilla.opendarwin.org/show_bug.cgi?id=10693
44 Convert JavaScript arrays to AppleScript lists
46 * JavaScriptCore.exp: Export ArrayInstance::info and ArrayInstance::getItem().
47 * kjs/array_instance.h:
48 * kjs/array_object.cpp:
49 (ArrayInstance::getItem): Added a method to access array items from C++.
51 2006-09-02 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
55 Bug 10454: Unix bakefile fixes
56 http://bugzilla.opendarwin.org/show_bug.cgi?id=10454
58 * JavaScriptCoreSources.bkl:
60 2006-09-01 Nikolas Zimmermann <zimmermann@kde.org>
62 Reviewed by hyatt. Landed by eseidel.
66 * pcre/CMakeLists.txt: Add wtf/ include.
68 2006-09-01 Nikolas Zimmermann <zimmermann@kde.org>
70 Reviewed and landed by ap.
72 Fix build on Linux (C89 without gcc extensions enabled).
74 * pcre/pcre_internal.h: Use C style comments.
75 * wtf/Assertions.h: Use C style comments.
76 * wtf/Platform.h: Use C style comments.
78 2006-09-01 Steve Falkenburg <sfalken@apple.com>
82 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
83 * JavaScriptCore.vcproj/dftables/dftables.vcproj:
85 2006-08-31 Anders Carlsson <acarlsson@apple.com>
89 Add new portability functions to MathExtras.h and add StringExtras.h which is for
90 string portability functions.
92 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
93 * bindings/c/c_instance.cpp:
94 * kjs/date_object.cpp:
98 * wtf/StringExtras.h: Added.
102 2006-08-31 Anders Carlsson <acarlsson@apple.com>
108 * JavaScriptCore.vcproj/dftables/dftables.vcproj:
109 * pcre/pcre_internal.h:
111 2006-08-31 Timothy Hatcher <timothy@apple.com>
115 Band-aid fix for PCRE to compile for ppc64 and x86_64 now that
116 we use -Wshorten-64-to-32. Adds an INT_CAST macro that ASSERTs
117 the value <= INT_MAX.
119 I filed <rdar://problem/4712064> to track the need to verify
120 PCRE's 64-bit compliance.
122 * pcre/pcre_compile.c:
131 (pcre_get_substring_list):
132 * pcre/pcre_internal.h:
133 * pcre/pcre_tables.c:
134 * pcre/pcre_try_flipped.c:
137 2006-08-30 Darin Adler <darin@apple.com>
139 Reviewed by Tim Hatcher.
141 - add WTF::getPtr, a function template that makes it possible to write
142 generic code that gets a raw pointer out of any of our pointer types
144 * JavaScriptCore.xcodeproj/project.pbxproj:
145 * wtf/GetPtr.h: Added.
146 * wtf/ListRefPtr.h: (WTF::getPtr): Added.
147 * wtf/OwnArrayPtr.h: (WTF::getPtr): Added.
148 * wtf/OwnPtr.h: (WTF::getPtr): Added.
149 * wtf/PassRefPtr.h: (WTF::getPtr): Added.
150 * wtf/RefPtr.h: (WTF::getPtr): Added.
152 2006-08-29 waylonis <waylonis@google.com>
154 Reviewed, tweaked by ggaren.
156 - Added storage and accessor functions for ExecState as a fix for
157 http://bugzilla.opendarwin.org/show_bug.cgi?id=10114
160 (KJS::ExecState::ExecState):
163 (KJS::Context::setExecState):
164 (KJS::Context::execState):
166 2006-08-30 Nikolas Zimmermann <zimmermann@kde.org>
170 Commit KDE related tweaks, to be able to
171 differentiate between a Qt-only or a KDE build.
173 * CMakeLists.txt: Install wtf-unity library.
174 * wtf/Platform.h: Add define for the KDE platform.
176 2006-08-28 Darin Adler <darin@apple.com>
180 * kjs/list.h: Use explicit in constructor (as appropriate).
182 2006-08-24 Nikolas Zimmermann <zimmermann@kde.org>
184 Reviewed, tweaked and landed by ap
186 http://bugzilla.opendarwin.org/show_bug.cgi?id=10467
187 WebKit should have Qt platform support (Part II)
189 * CMakeLists.txt: Adjust to Anders' build fixes.
190 * wtf/Platform.h: Fix define for the Qt platform (we don't use/need Cairo.)
192 2006-08-23 David Hyatt <hyatt@apple.com>
194 Fix Platform.h to include #defines for graphics features.
198 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
201 2006-08-23 Anders Carlsson <acarlsson@apple.com>
205 Make the bindings compile without CoreFoundation.
207 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
208 * bindings/c/c_instance.cpp:
209 * bindings/c/c_utility.cpp:
210 (KJS::Bindings::convertUTF8ToUTF16):
212 * bindings/runtime.cpp:
213 (KJS::Bindings::Instance::createBindingForLanguageInstance):
214 (KJS::Bindings::Instance::createLanguageInstanceForValue):
215 * bindings/runtime_root.cpp:
216 * bindings/runtime_root.h:
217 * kjs/interpreter.cpp:
218 (KJS::Interpreter::createLanguageInstanceForValue):
221 2006-08-22 Anders Carlsson <acarlsson@apple.com>
225 Move the npruntime code over to using HashMap and the runtime_root code over to using
226 HashMap and HashCountedSet.
228 * bindings/NP_jsobject.cpp:
229 * bindings/c/c_utility.cpp:
230 (KJS::Bindings::identifierFromNPIdentifier):
231 * bindings/c/c_utility.h:
232 * bindings/jni/jni_jsobject.cpp:
233 (JavaJSObject::invoke):
234 * bindings/npruntime.cpp:
235 (getStringIdentifierMap):
236 (getIntIdentifierMap):
237 (_NPN_GetStringIdentifier):
238 (_NPN_GetIntIdentifier):
239 * bindings/runtime_root.cpp:
240 (getReferencesByRootMap):
242 (KJS::Bindings::findReferenceSet):
243 (KJS::Bindings::rootForImp):
244 (KJS::Bindings::rootForInterpreter):
245 (KJS::Bindings::addNativeReference):
246 (KJS::Bindings::removeNativeReference):
247 (RootObject::removeAllNativeReferences):
248 * bindings/runtime_root.h:
250 2006-08-22 Anders Carlsson <acarlsson@apple.com>
254 Switch over the NPAPI and Java bindings to using HashMaps instead of dictionaries.
256 * JavaScriptCore.xcodeproj/project.pbxproj:
257 * bindings/c/c_class.cpp:
258 (KJS::Bindings::CClass::CClass):
259 (KJS::Bindings::CClass::~CClass):
260 (KJS::Bindings::CClass::classForIsA):
261 (KJS::Bindings::CClass::methodsNamed):
262 (KJS::Bindings::CClass::fieldNamed):
263 * bindings/c/c_class.h:
264 * bindings/jni/jni_class.cpp:
265 (JavaClass::JavaClass):
266 (JavaClass::~JavaClass):
267 (JavaClass::methodsNamed):
268 (JavaClass::fieldNamed):
269 * bindings/jni/jni_class.h:
270 * bindings/objc/objc_class.h:
271 * bindings/objc/objc_class.mm:
272 (KJS::Bindings::deleteMethod):
273 (KJS::Bindings::deleteField):
275 (KJS::Bindings::ObjcClass::methodsNamed):
276 (KJS::Bindings::ObjcClass::fieldNamed):
277 * bindings/runtime.cpp:
278 * bindings/runtime.h:
279 * bindings/runtime_object.cpp:
280 (RuntimeObjectImp::fieldGetter):
281 (RuntimeObjectImp::getOwnPropertySlot):
282 (RuntimeObjectImp::put):
283 (RuntimeObjectImp::canPut):
285 2006-08-21 Vladimir Olexa <vladimir.olexa@gmail.com>
289 http://bugzilla.opendarwin.org/show_bug.cgi?id=6252
290 JavaScript 1.6 Array.lastIndexOf
292 Test: fast/js/array-lastIndexOf.html
294 * kjs/array_object.cpp:
295 (ArrayProtoFunc::callAsFunction): Added a LastIndexOf case.
296 * kjs/array_object.h:
297 (KJS::ArrayProtoFunc::): Added LastIndexOf to enum.
298 * tests/mozilla/expected.html: Two more tests now pass.
300 2006-08-20 Nikolas Zimmermann <zimmermann@kde.org>
302 Reviewed by Maciej. Landed by rwlbuis.
304 Fixes parts of: http://bugzilla.opendarwin.org/show_bug.cgi?id=10463
305 WebKit should have Qt platform support
307 Removing obsolete QConstString/QString constructors in kjs code.
312 2006-08-17 Nikolas Zimmermann <zimmermann@kde.org>
314 Reviewed by Maciej. Landed by rwlbuis.
316 Fixes: http://bugzilla.opendarwin.org/show_bug.cgi?id=10463
317 WTF Changes needed for Qt platform code.
320 * wtf/unicode/UnicodeDecomposition.h: Added.
322 * wtf/unicode/UnicodeDirection.h: Added.
324 * wtf/unicode/qt4/UnicodeQt4.cpp: Added.
325 (WTF::Unicode::direction):
326 (WTF::Unicode::category):
327 (WTF::Unicode::decomposition):
328 * wtf/unicode/qt4/UnicodeQt4.h:
329 (WTF::Unicode::toLower):
330 (WTF::Unicode::toUpper):
331 (WTF::Unicode::isPrintableChar):
332 (WTF::Unicode::isSpace):
333 (WTF::Unicode::isPunct):
334 (WTF::Unicode::isDigit):
335 (WTF::Unicode::mirroredChar):
336 (WTF::Unicode::compare):
338 2006-08-17 Nikolas Zimmermann <zimmermann@kde.org>
340 Reviewed by Eric. Landed by rwlbuis.
342 Fixes: http://bugzilla.opendarwin.org/show_bug.cgi?id=10464
343 Offer a cmake build system for Qt platform.
345 * CMakeLists.txt: Added.
346 * pcre/CMakeLists.txt: Added.
348 2006-08-17 Anders Carlsson <acarlsson@apple.com>
355 2006-08-15 Steve Falkenburg <sfalken@apple.com>
361 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
364 2006-08-15 Mark Rowe <opendarwin.org@bdash.net.nz>
368 Build fix: DWARF and -gfull are incompatible with symbol separation.
370 * JavaScriptCore.xcodeproj/project.pbxproj:
372 2006-08-15 Mark Rowe <opendarwin.org@bdash.net.nz>
376 http://bugzilla.opendarwin.org/show_bug.cgi?id=10394
377 Bug 10394: WebKit Release and Production configurations should enable dead code stripping
379 * JavaScriptCore.xcodeproj/project.pbxproj:
381 2006-08-15 Mark Rowe <opendarwin.org@bdash.net.nz>
385 http://bugzilla.opendarwin.org/show_bug.cgi?id=10384
386 Bug 10384: Switch to DWARF for Release configuration
388 * JavaScriptCore.xcodeproj/project.pbxproj:
390 2006-08-13 Maks Orlovich <maksim@kde.org>
392 Reviewed (and tweaked a little) by Maciej.
394 - shrank the size of JSObject by 8 bytes and made the corresponding reduction to the cell size, resulting
395 in a 1.2% speed improvement on JS iBench (and probably overall memory savings).
397 This was done by removing _scope and _internalValue data members
398 from JSObject and moving them only to the subclasses that actually
402 (KJS::JSObject::mark): No need to mark scope or internal value here.
404 (KJS::JSObject::JSObject): Don't initialize them.
405 * kjs/JSWrapperObject.cpp: Added. New base class for object types that
406 wrap primitive values (Number, String, Boolean, Date).
407 (KJS::JSWrapperObject::mark):
408 * kjs/JSWrapperObject.h: Added.
409 (KJS::JSWrapperObject::JSWrapperObject):
410 (KJS::JSWrapperObject::internalValue):
411 (KJS::JSWrapperObject::setInternalValue):
412 * kjs/array_object.cpp:
413 (ArrayPrototype::ArrayPrototype): Don't set useless internal value.
414 * kjs/bool_object.cpp:
415 (BooleanInstance::BooleanInstance): Inherit from JSWrapperObject.
416 (BooleanProtoFunc::callAsFunction): Fixed to account for fact that not all
417 JSObjects have an internal value.
418 (BooleanObjectImp::construct): ditto.
420 * kjs/collector.cpp: Lowered cell size to 48.
421 (KJS::Collector::allocate): meaningless whitespace change
422 * kjs/date_object.cpp:
423 (KJS::DateInstance::DateInstance): Inherit from JSWrapperObject.
424 (KJS::DateProtoFunc::callAsFunction): adjusted for move of internalValue
425 (KJS::DateObjectImp::construct): ditto
427 * kjs/error_object.cpp:
428 (ErrorPrototype::ErrorPrototype): don't set internal value
429 * kjs/function.cpp: move _scope and related handling here
430 (KJS::FunctionImp::mark): mark scope
432 (KJS::FunctionImp::scope): moved here from JSObject
433 (KJS::FunctionImp::setScope): ditto
434 * kjs/number_object.cpp:
435 (NumberInstance::NumberInstance): inherit from JSWrapperObject
436 (NumberProtoFunc::callAsFunction): adjusted
437 (NumberObjectImp::construct): adjusted
438 * kjs/number_object.h: shring RegExp-related objects a little
439 * kjs/regexp_object.cpp:
440 (RegExpPrototype::RegExpPrototype): Adjust for size tweaks
441 (RegExpObjectImp::RegExpObjectImp): ditto
442 * kjs/regexp_object.h:
443 * kjs/string_object.cpp:
444 (StringInstance::StringInstance): inherit from JSWrapperObject
445 (StringProtoFunc::callAsFunction): adjusted
446 * kjs/string_object.h:
447 * JavaScriptCore.exp: Exported new methods as needed.
448 * JavaScriptCore.xcodeproj/project.pbxproj: Added new files to build.
450 2006-08-04 Brady Eidson <beidson@apple.com>
452 Reviewed by Geoff's rubber stamp
454 Fix a build break on Intel hardware causes by adapting stricter
455 compiler warnings (-Wshorten-64-to-32)
458 (assertEqualsAsNumber): manually cast some doubles to floats
461 2006-08-04 Sam Weinig <sam.weinig@gmail.com>
465 - patch for http://bugzilla.opendarwin.org/show_bug.cgi?id=10192
466 Make WebCore (and friends) compile with -Wshorten-64-to-32
468 * Adds -Wshorten-64-to-32 flag to Xcode project.
469 * Adds explicit casts where OK.
473 (JSNodeList_getProperty):
474 * JavaScriptCore.xcodeproj/project.pbxproj:
476 2006-08-04 Adam Roben <aroben@apple.com>
480 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Convert
483 2006-08-03 Sam Weinig <sam.weinig@gmail.com>
487 - patch for http://bugzilla.opendarwin.org/show_bug.cgi?id=10176
488 Make WebCore compile with -Wundef
490 * Adds -Wundef flag to Xcode project
491 * Converts #ifs to #ifdef and #ifndefs where needed.
492 * Added #define YYMAXDEPTH 10000 in kjs/grammar.y
493 to fix a warning from within Bison.
495 * JavaScriptCore.xcodeproj/project.pbxproj:
496 * bindings/jni/jni_jsobject.cpp:
497 (JavaJSObject::getSlot):
498 (JavaJSObject::setSlot):
500 * bindings/objc/objc_class.mm:
501 (KJS::Bindings::ObjcClass::methodsNamed):
502 (KJS::Bindings::ObjcClass::fieldNamed):
503 * bindings/objc/objc_instance.mm:
504 (ObjcInstance::invokeMethod):
505 * bindings/objc/objc_runtime.mm:
506 (ObjcMethod::getMethodSignature):
512 2006-08-03 Anders Carlsson <acarlsson@apple.com>
514 Reviewed by John Sullivan.
518 Return *this in operator=
520 2006-08-03 Adam Roben <aroben@apple.com>
524 - Fixed Windows build
526 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
527 * wtf/MathExtras.h: Implement inline versions of these functions
531 2006-08-02 Adam Roben <aroben@apple.com>
537 * kjs/date_object.cpp:
540 2006-07-29 Darin Adler <darin@apple.com>
542 - Removed tabs from these source files that still had them.
543 We don't use them; that way source files look fine in editors
544 that have tabs set to 8 spaces or to 4 spaces.
545 - Removed allow-tabs Subversion property from the files too.
547 * bindings/NP_jsobject.cpp:
548 * bindings/c/c_utility.cpp:
549 * bindings/jni/jni_runtime.cpp:
550 * bindings/jni/jni_utility.cpp:
551 * bindings/objc/objc_utility.mm:
552 * bindings/runtime.cpp:
553 * bindings/runtime_method.cpp:
554 * bindings/testbindings.cpp:
555 * bindings/testbindings.mm:
556 * kjs/date_object.cpp:
561 * kjs/string_object.cpp:
564 2006-07-29 Darin Adler <darin@apple.com>
566 * tests/mozilla/expected.html: Update test results now that regress-185165.js
567 is succeeding. I suspect Anders fix for bug 4620655 is the reason.
569 2006-07-29 Sam Weinig <sam.weinig@gmail.com>
573 - patch for http://bugzilla.opendarwin.org/show_bug.cgi?id=10080
574 Adopt pedantic changes from the Unity project to improve
575 cross-compiler compatibility
578 * Removing trailing semicolon from namespace braces.
579 * Removing trailing comma from last enum declaration.
580 * Updating to match style guidelines.
581 * Adding missing newline to the end of the file.
582 * Turning on gcc warning for missing newline at the end of a source file
583 (GCC_WARN_ABOUT_MISSING_NEWLINE in Xcode, -Wnewline in gcc).
584 * Alphabetical sorting of Xcode source list files.
585 * Replace use of non-portable variable-size array with Vector.
586 * Use C-style comments instead of C++ comments in files that might
587 be included by either C or C++ files.
589 * API/JSCallbackConstructor.cpp:
590 (KJS::JSCallbackConstructor::construct):
591 * API/JSCallbackFunction.cpp:
592 (KJS::JSCallbackFunction::callAsFunction):
593 * API/JSCallbackObject.cpp:
594 (KJS::JSCallbackObject::construct):
595 (KJS::JSCallbackObject::callAsFunction):
596 * JavaScriptCore.xcodeproj/project.pbxproj:
597 * JavaScriptCorePrefix.h:
598 * bindings/jni/jni_class.cpp:
599 (JavaClass::fieldNamed):
600 * bindings/jni/jni_class.h:
601 * bindings/jni/jni_instance.cpp:
602 (JavaInstance::JavaInstance):
603 (JavaInstance::valueOf):
604 * bindings/jni/jni_objc.mm:
605 (KJS::Bindings::dispatchJNICall):
606 * bindings/jni/jni_runtime.cpp:
607 (JavaParameter::JavaParameter):
608 (JavaArray::JavaArray):
609 * bindings/jni/jni_runtime.h:
610 * bindings/jni/jni_utility.h:
611 * bindings/objc/objc_instance.h:
612 * bindings/runtime_array.h:
618 2006-07-29 Mike Emmel <mike.emmel@gmail.com>
622 - fixes for Linux build
624 * JavaScriptCoreSources.bkl: Added new files to build, kjs/PropertyNameArray.cpp
625 and kjs/testkjs.cpp, and removed old files.
627 2006-07-24 Dan Waylonis <waylonis@google.com>
629 Reviewed and tweaked a bit by Darin.
631 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9902
632 jsNull and NSNull not properly converted between JS and ObjC
634 * bindings/objc/objc_utility.mm: (KJS::Bindings::convertObjcValueToValue):
635 Added case for converting NSNull to jsNull.
637 2006-07-24 Rob Buis <buis@kde.org>
641 http://bugzilla.opendarwin.org/show_bug.cgi?id=4258
642 Date().toString() only includes GMT offset, not timezone string
644 Use the info in tm_zone to append timezone abbreviation
645 to Date().toString().
647 * kjs/date_object.cpp:
650 2006-07-24 Rob Buis <buis@kde.org>
654 http://bugzilla.opendarwin.org/show_bug.cgi?id=5257
655 setYear() does not match FireFox/IE behavior
657 Make sure the right values end up in tm_year.
659 * kjs/date_object.cpp:
662 2006-07-23 Mark Rowe <opendarwin.org@bdash.net.nz>
666 Bug 9686: [Drosera] Need the ability to break into Drosera on Javascript exceptions
667 http://bugzilla.opendarwin.org/show_bug.cgi?id=9686
669 JavaScriptCore portion of the fix.
671 * JavaScriptCore.exp: Update symbol for change in argument type.
673 (Debugger::detach): Clear map of recent exceptions.
674 (Debugger::hasHandledException): Track the most recent exception
675 thrown by an interpreter.
676 (Debugger::exception): Change exception argument to a JSValue.
679 (Node::debugExceptionIfNeeded): Notify the debugger of an exception
680 if it hasn't seen it before.
681 (ThrowNode::execute): Notify the debugger that an exception is being thrown.
684 2006-07-23 Geoffrey Garen <ggaren@apple.com>
686 Patch by Eric Albert, reviewed by Darin and me.
688 - Fixed <rdar://problem/4645931> JavaScriptCore stack-scanning code
689 crashes (Collector::markStackObjectsConservatively)
691 * bindings/jni/jni_jsobject.cpp: On 64bit systems, jint is a long, not an
693 (JavaJSObject::getSlot):
694 (JavaJSObject::setSlot):
696 (KJS::Collector::markCurrentThreadConservatively): Use a pointer instead of
697 an int as 'dummy,' because on LP64 systems, an int is not pointer-aligned,
698 and we want to scan the stack for pointers.
699 * JavaScriptCore.xcodeproj/project.pbxproj: After a tense cease-fire, the
700 XCode war has started up again!
702 === Safari-521.20 ===
704 2006-07-21 Geoffrey Garen <ggaren@apple.com>
708 <rdar://problem/4507265> REGRESSION: overlays don't work on HousingMaps.com (Google Maps-based site)
710 - Added support for strings that masquerade as undefined. Currently used
711 by WebCore to implement undetectable style.filter.
713 The name is a little long, but it's only used in one line of code, so I
714 thought clarity should win over brevity.
716 * JavaScriptCore.exp:
717 * JavaScriptCore.xcodeproj/project.pbxproj:
719 * kjs/string_object.h:
720 (KJS::StringInstanceThatMasqueradesAsUndefined::StringInstanceThatMasqueradesAsUndefined):
721 (KJS::StringInstanceThatMasqueradesAsUndefined::masqueradeAsUndefined):
722 (KJS::StringInstanceThatMasqueradesAsUndefined::toBoolean):
724 === Safari-521.19 ===
726 2006-07-20 Steve Falkenburg <sfalken@apple.com>
731 (KJS::escapeStringForPrettyPrinting):
733 2006-07-19 Anders Carlsson <acarlsson@apple.com>
737 <rdar://problem/4620655> REGRESSION(10.4.7-10.5): preview button for a blogger.com post doesn't work
739 * kjs/nodes2string.cpp:
740 (StringNode::streamTo):
741 Return the escaped string.
743 (RegExpNode::streamTo):
744 Use the correct syntax.
747 (KJS::escapeStringForPrettyPrinting):
749 Add escape function which escapes a string for pretty-printing so it can be parsed again.
751 * wtf/unicode/icu/UnicodeIcu.h:
752 (WTF::Unicode::isPrintableChar):
755 2006-07-18 Maciej Stachowiak <mjs@apple.com>
757 Reviewed by Adele Peterson.
759 <rdar://problem/4589530> REGRESSION: null character in JS string causes parse error (works in Tiger and in other browsers)
768 2006-07-18 Tim Omernick <timo@apple.com>
770 Reviewed by Tim Hatcher.
772 Removed a misleading comment; we recently added support for the NPNVPluginElementNPObject
777 === Safari-521.18 ===
779 2006-07-18 Timothy Hatcher <timothy@apple.com>
781 Made the following headers public:
790 * JavaScriptCore.xcodeproj/project.pbxproj:
792 2006-07-17 Geoffrey Garen <ggaren@apple.com>
796 - Added automatic prototype creation for classes.
798 A class stores a weak reference to a prototype, which is cleared when
799 the prototype is garbage collected, to avoid a reference cycle.
801 We now have an attributes field in JSClassDefinition, that currently is
802 used only to override automatic prototype creation when you want to manage your
803 own prototypes, but can be extended in the future for other nefarious purposes.
805 Similarly, we have JSObjectMake and JSObjectMakeWithPrototype, the latter
806 allowing you to manage your own prototypes.
808 JSObjectMakeConstructor is more interesting now, able to make a constructor
809 on your behalf if you just give it a class.
811 - Removed bogus old code from minidom.js.
813 - Tweaked the headerdocs.
815 - Added more GC testing, which caught some leaks, and tested more funny
816 edge cases in lookup, which caught a lookup bug. Removed some testing
817 we used to do with MyObject because it was redundant with the new, cool
820 While fixing the lookup bug I retracted this change:
822 "If a static setProperty callback returns 'false', to indicate that the
823 property was not set, we no longer forward the set request up the class
824 chain, because that's almost certainly not what the programmer expected."
826 Returning false when setting a static property is a little silly, but you can see
827 it being useful when shadowing a base class's static properties, and, regardless
828 of usefullness, this is the defined behavior of the setProperty callback.
830 - Plus a little ASCII art, for the kids.
832 2006-07-17 Timothy Hatcher <timothy@apple.com>
836 <rdar://problem/4634874> WebScriptObject and WebUndefined are no longer defined by WebKit
838 Moves WebScriptObject and WebUndefined up to WebCore.
839 This change does create an upwards-dependancy on WebScriptObject existing
840 in the loaded process, but this code path in JavaScriptCore does not get used
841 unless it is through WebKit/WebCore. Moving all of the binding code out of
842 JavaScriptCore might make sense in the future.
844 * JavaScriptCore.exp:
845 * JavaScriptCore.xcodeproj/project.pbxproj:
846 * bindings/objc/WebScriptObject.h: Replaced.
847 * bindings/objc/WebScriptObject.mm: Removed.
848 * bindings/objc/WebScriptObjectPrivate.h: Removed.
849 * bindings/objc/objc_class.h:
850 * bindings/objc/objc_instance.h:
851 * bindings/objc/objc_instance.mm:
852 (ObjcInstance::~ObjcInstance):
853 * bindings/objc/objc_runtime.h:
854 * bindings/objc/objc_runtime.mm:
855 (convertValueToObjcObject):
856 * bindings/objc/objc_utility.mm:
857 (KJS::Bindings::convertValueToObjcValue):
858 (KJS::Bindings::convertObjcValueToValue):
859 (KJS::Bindings::createObjcInstanceForValue):
861 2006-07-17 Darin Adler <darin@apple.com>
863 * API/JSBase.h: Fix comment formatting where things used to be lined up but
864 are now ragged. Got rid of spaces that attempted to line things up.
865 * API/JSObjectRef.h: Ditto. Also add missing periods for a couple of comments.
867 2006-07-17 Geoffrey Garen <ggaren@apple.com>
871 - Removed the exception parameter from the initialize callback and, by extension,
872 JSObjectMake. We have never had a need for exceptions when iniitializing,
873 so the parameter seemed likely to "get in the way."
875 Also, an exception in JavaScript is thrown in response to input --
876 "invalid URL", "index not a number", etc., so it's the job of the
877 constructor function, not the initialize method, to throw.
879 If initialize *really* wants to throw, it can communicate the throw to
880 the constructor through the constructed object's private data (e.g., set
881 it to NULL, signaling to the consntructor that initialization failed.)
883 - Added JSObjectMakeWithData, which enables a constructor to set private
884 data on an object *before* it has been initialized. That way, the initialize
885 methods can properly operate on the data.
887 * API/JSNode.c: Moved ref into the initialize method, for better encapsulation,
888 now that it's possible.
889 * API/JSNodeList.c: ditto
891 (main): Do more aggressive garbage collection to test ref/deref and
893 * API/minidom.js: store childNodes in a temporary so it doesn't get re-created
894 like a thousand times. This makes debugging ref/deref easier
896 2006-07-17 Geoffrey Garen <ggaren@apple.com>
900 - Changed the initialize callback to run from least derived class (parent
901 class) to most derived class. This enables C++ style initialization,
902 and derived class overriding of member data.
904 - Added excpetion propopgation to JSObjectMake, to support initialize
905 exceptions, and generally round out our policy of making function
906 signatures as long as possible.
908 * API/JSCallbackObject.h: Use ExecState instead of ContextRef, cuz we're
911 2006-07-17 Geoffrey Garen <ggaren@apple.com>
915 - Changed JSObjectMakeConstructor to JSObjectMakeConstructorWithCallback,
916 to match JSObjectMakeFunctionWithCallback.
918 - Added prototype parameter, so the generated constructor
919 automatically works with hasInstance / instanceof
921 - Moved hasInstance implementation from InternalFunctionImp to JSObject
922 so that subclasses can inherit it without inheriting function-related baggage.
923 More refactoring here would be good, but this seems like a good short-term
926 (KJS::JSCallbackFunction::implementsHasInstance): override and return false,
927 because callback functions aren't constructors.
929 2006-07-17 Maciej Stachowiak <mjs@apple.com>
933 - add a JSContextRef parameter to all JSValueRef, JSObjectRef, and JSContextRef operations;
934 except JSObject{Get,Set}PrivateData which can be assumed to be simple pure accessors.
936 Also renamed the parameter "context" to "ctx" because it makes the code read better with this pervasive
937 but usually uninteresting parameter.
941 (JSCheckScriptSyntax):
944 * API/JSCallbackObject.cpp:
945 (KJS::JSCallbackObject::JSCallbackObject):
946 (KJS::JSCallbackObject::init):
947 (KJS::JSCallbackObject::getOwnPropertySlot):
948 (KJS::JSCallbackObject::put):
949 (KJS::JSCallbackObject::deleteProperty):
950 (KJS::JSCallbackObject::toNumber):
951 (KJS::JSCallbackObject::toString):
952 * API/JSContextRef.cpp:
953 (JSGlobalContextCreate):
954 (JSGlobalContextRetain):
955 (JSGlobalContextRelease):
956 (JSContextGetGlobalObject):
957 * API/JSContextRef.h:
959 (JSNodePrototype_appendChild):
960 (JSNodePrototype_removeChild):
961 (JSNodePrototype_replaceChild):
962 (JSNode_getNodeType):
963 (JSNode_getFirstChild):
966 (JSNodeListPrototype_item):
968 (JSNodeList_getProperty):
969 (JSNodeList_prototype):
970 * API/JSObjectRef.cpp:
972 (JSObjectMakeFunctionWithCallback):
973 (JSObjectMakeConstructor):
974 (JSObjectMakeFunction):
975 (JSObjectGetPrototype):
976 (JSObjectSetPrototype):
977 (JSObjectHasProperty):
978 (JSObjectGetProperty):
979 (JSObjectSetProperty):
980 (JSObjectGetPropertyAtIndex):
981 (JSObjectSetPropertyAtIndex):
982 (JSObjectDeleteProperty):
983 (JSObjectIsFunction):
984 (JSObjectCallAsFunction):
985 (JSObjectIsConstructor):
986 (JSObjectCallAsConstructor):
987 (JSObjectCopyPropertyNames):
989 * API/JSStringRef.cpp:
990 * API/JSValueRef.cpp:
992 (JSValueIsUndefined):
998 (JSValueIsObjectOfClass):
1000 (JSValueIsStrictEqual):
1001 (JSValueIsInstanceOfConstructor):
1002 (JSValueMakeUndefined):
1004 (JSValueMakeBoolean):
1005 (JSValueMakeNumber):
1006 (JSValueMakeString):
1009 (JSValueToStringCopy):
1017 (MyObject_getProperty):
1018 (MyObject_deleteProperty):
1019 (MyObject_callAsFunction):
1020 (MyObject_callAsConstructor):
1021 (MyObject_convertToType):
1022 (print_callAsFunction):
1025 2006-07-16 Geoffrey Garen <ggaren@apple.com>
1027 Approved by Maciej, RS by Beth.
1029 JSObjectMakeFunction -> JSObjectMakeFunctionWithCallback
1030 JSObjectMakeFunctionWithBody -> JSObjectMakeFunction
1032 because the latter is more common, and more fundamental, than the former.
1037 * API/JSCallbackObject.cpp:
1038 (KJS::JSCallbackObject::getOwnPropertySlot):
1039 (KJS::JSCallbackObject::put):
1040 (KJS::JSCallbackObject::deleteProperty):
1041 (KJS::JSCallbackObject::getPropertyNames):
1042 (KJS::JSCallbackObject::staticValueGetter):
1043 (KJS::JSCallbackObject::staticFunctionGetter):
1044 * API/JSClassRef.cpp:
1045 (OpaqueJSClass::OpaqueJSClass):
1046 (OpaqueJSClass::~OpaqueJSClass):
1048 * API/JSObjectRef.cpp:
1050 (JSObjectMakeFunctionWithCallback):
1051 (JSObjectMakeFunction):
1052 (OpaqueJSPropertyNameArray::OpaqueJSPropertyNameArray):
1053 (JSObjectCopyPropertyNames):
1054 * API/JSObjectRef.h:
1060 * JavaScriptCore.exp:
1062 2006-07-16 Geoffrey Garen <ggaren@apple.com>
1066 Replace __JS with OpaqueJS because the former, while used by CF, is
1067 a prefix that's triply-reserved by the compiler. (_* is reserved in global
1068 names, _[A-Z] is reserved in all names, and __ is reserved in all names
1071 Opaque is an alternative used by other Mac OS X framewokrs.
1076 * API/JSCallbackObject.cpp:
1077 (KJS::JSCallbackObject::getOwnPropertySlot):
1078 (KJS::JSCallbackObject::put):
1079 (KJS::JSCallbackObject::deleteProperty):
1080 (KJS::JSCallbackObject::getPropertyNames):
1081 (KJS::JSCallbackObject::staticValueGetter):
1082 (KJS::JSCallbackObject::staticFunctionGetter):
1083 * API/JSClassRef.cpp:
1084 (OpaqueJSClass::OpaqueJSClass):
1085 (OpaqueJSClass::~OpaqueJSClass):
1087 * API/JSObjectRef.cpp:
1089 (OpaqueJSPropertyNameArray::OpaqueJSPropertyNameArray):
1090 (JSObjectCopyPropertyNames):
1092 2006-07-16 Darin Adler <darin@apple.com>
1094 - try to fix Windows build
1096 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1097 Added some recently added files, removed some recently removed.
1099 2006-07-16 Geoffrey Garen <ggaren@apple.com>
1103 - Change getProperty* to return undefined, rather than NULL, for missing
1104 properties, since that's what the spec says. Also added exception out
1105 parameters to the *Index functions, because they can call through to the
1106 regular functions, which can throw for custom objects.
1108 * API/JSObjectRef.cpp:
1109 (JSObjectGetProperty):
1110 (JSObjectGetPropertyAtIndex):
1111 (JSObjectSetPropertyAtIndex):
1112 * API/JSObjectRef.h:
1116 2006-07-16 Geoffrey Garen <ggaren@apple.com>
1120 - Properly document and handle NULL callbacks for static properties. We
1121 throw an exception in any case other than a ReadOnly property with a NULL
1122 setProperty callback, because a NULL callback almost certainly indicates
1123 a programming error. Also throw an exception if hasProperty returns true
1124 for a property that getProperty can't get.
1126 - If a static setProperty callback returns 'false', to indicate that the
1127 property was not set, we no longer forward the set request up the class
1128 chain, because that's almost certainly not what the programmer expected.
1130 * API/JSCallbackObject.cpp:
1131 (KJS::JSCallbackObject::getOwnPropertySlot):
1132 (KJS::JSCallbackObject::put):
1133 (KJS::JSCallbackObject::staticValueGetter):
1134 (KJS::JSCallbackObject::staticFunctionGetter):
1135 (KJS::JSCallbackObject::callbackGetter):
1136 * API/JSObjectRef.h:
1139 (MyObject_hasProperty):
1142 2006-07-16 Geoffrey Garen <ggaren@apple.com>
1146 - Added names to functions.
1148 - Removed GetPrivate/SetPrivate from callbackFunctions and callbackConstructors.
1149 The private data idiom is that a JS object stores its native implementation
1150 as private data. For functions and constructors, the native implementation is nothing
1151 more than the callback they already store, so supporting private data, too,
1152 confuses the idiom. If you *really* want, you can still create a custom
1153 function with private data.
1155 * API/JSCallbackConstructor.cpp:
1156 * API/JSCallbackConstructor.h:
1157 * API/JSCallbackFunction.cpp:
1158 (KJS::JSCallbackFunction::JSCallbackFunction):
1159 * API/JSCallbackFunction.h:
1160 * API/JSCallbackObject.cpp:
1161 (KJS::JSCallbackObject::staticFunctionGetter):
1162 * API/JSObjectRef.cpp:
1163 (JSObjectMakeFunction):
1164 (JSObjectMakeFunctionWithBody):
1165 (JSObjectGetPrivate):
1166 (JSObjectSetPrivate):
1167 * API/JSObjectRef.h:
1173 2006-07-15 Maciej Stachowiak <mjs@apple.com>
1177 - switch property lists to be vector+set of Identifiers instead of list of References
1179 This has the following benefits:
1181 - no duplicates in property lists
1182 - simplifies API calls
1183 - probably more efficient, since linked list is gone
1184 - entirely removed Reference, ReferenceList and ProtectedReference types from the API
1186 * kjs/PropertyNameArray.cpp: Added.
1187 (KJS::PropertyNameArray::add): Check set, if not already there, add to
1189 * kjs/PropertyNameArray.h: Added.
1190 (KJS::PropertyNameArray::PropertyNameArray): Newly added type, combines
1191 a set and a vector to make a unique but ordered list of identifiers.
1192 (KJS::PropertyNameArray::begin): ditto
1193 (KJS::PropertyNameArray::end): ditto
1194 (KJS::PropertyNameArray::size): ditto
1195 (KJS::PropertyNameArray::operator[]): ditto
1196 * kjs/array_instance.h:
1197 * kjs/array_object.cpp:
1198 (ArrayInstance::getPropertyNames): renamed from getPropertyList, updated
1199 for PropertyNameArray
1200 (ArrayInstance::setLength): updated for PropertyNameArray
1201 (ArrayInstance::pushUndefinedObjectsToEnd): ditto
1203 (ForInNode::execute): updated for PropertyNameArray
1206 (KJS::JSObject::getPropertyNames): renamed from getPropertyList, updated
1207 for PropertyNameArray
1209 * kjs/property_map.cpp:
1210 (KJS::PropertyMap::getEnumerablePropertyNames): updated for PropertyNameArray
1211 (KJS::PropertyMap::getSparseArrayPropertyNames): ditto
1212 * kjs/property_map.h:
1213 * kjs/protected_reference.h: Removed.
1214 * kjs/reference.cpp: Removed.
1215 * kjs/reference.h: Removed.
1216 * kjs/reference_list.cpp: Removed.
1217 * kjs/reference_list.h: Removed.
1218 * kjs/scope_chain.cpp:
1219 (KJS::ScopeChain::print): Use PropertyNamesArray instead of ReferenceList.
1220 * kjs/string_object.cpp:
1221 (StringInstance::getPropertyNames): Updated for new approach.
1222 * kjs/string_object.h:
1225 (toJS): Added overload for PropertyNameAccumulatorRef / PropertyNameArray*
1228 * API/JSCallbackObject.cpp:
1229 (KJS::JSCallbackObject::getPropertyNames): Fixed for new API.
1230 * API/JSCallbackObject.h:
1231 * API/JSObjectRef.cpp:
1232 (__JSPropertyNameArray::__JSPropertyNameArray): Type used for a publicly vended
1233 JSPropertyNameArrayRef.
1234 (JSObjectCopyPropertyNames): New API call - renamed / refactored from
1235 JSObjectCreatePropertyList
1236 (JSPropertyNameArrayRetain): new retain call for JSPropertyNameArray.
1237 (JSPropertyNameArrayRelease): new release call for - " -.
1238 (JSPropertyNameArrayGetCount): Instead of having to use a stateful enumerator you
1239 can now get the count and items in any order.
1240 (JSPropertyNameArrayGetNameAtIndex): See above.
1241 (JSPropertyNameAccumulatorAddName): What you add properties to is now an opaque
1243 * API/JSObjectRef.h: Prototyped new functions, removed old ones
1244 * JavaScriptCore.exp: Updated exported symbols.
1245 * JavaScriptCore.xcodeproj/project.pbxproj: Added new files, removed old.
1247 (MyObject_getPropertyNames): Renamed / fixed callback to fit new paradigm.
1248 (main): Updated for new API.
1250 2006-07-15 Darin Adler <darin@apple.com>
1252 - oops, missed a few more arrays that had to be const
1255 (JSNodePrototype_appendChild): Added const.
1256 (JSNodePrototype_removeChild): Ditto.
1257 (JSNodePrototype_replaceChild): Ditto.
1258 (JSNode_construct): Ditto.
1260 (JSNodeListPrototype_item): Ditto.
1261 * API/JSObjectRef.cpp:
1262 (JSObjectMakeFunctionWithBody): Ditto.
1263 (JSObjectCallAsFunction): Ditto.
1264 (JSObjectCallAsConstructor): Ditto.
1268 (MyObject_callAsFunction): Ditto.
1269 (MyObject_callAsConstructor): Ditto.
1270 (print_callAsFunction): Ditto.
1271 (myConstructor_callAsConstructor): Ditto.
1273 2006-07-15 Darin Adler <darin@apple.com>
1277 * API/JSNode.h: Made an array parameter const.
1278 * API/JSObjectRef.h: Made array parameters const. Fixed a comment.
1280 2006-07-15 Geoffrey Garen <ggaren@apple.com>
1284 - JSObjectMakeFunctionWithBody includes a function name and named parameters now.
1286 * API/JSObjectRef.cpp:
1287 (JSObjectMakeFunctionWithBody):
1288 * API/JSObjectRef.h:
1290 (assertEqualsAsUTF8String): More informative failure reporting.
1291 (main): Test more function cases.
1293 2006-07-15 Geoffrey Garen <ggaren@apple.com>
1297 - Moved the arguments passed to JSClassCreate into a single structure,
1298 called JSClassDefinition. This will enable easier structure
1299 migration/versioning in the future, if necessary.
1301 - Added support for class names.
1303 - kJSClassDefinitionNull replaces kJSObjectCallbacksNone.
1305 - JSClass is becoming a fairly complex struct, so I migrated all of its
1306 implementation other than reference counting to the sruct.
1308 - Also moved JSClass* functions in the API to JSObjectRef.cpp, since they're
1309 declared in JSObjectRef.h
1311 - Also added some more informative explanation to the class structure doc.
1313 2006-07-15 Darin Adler <darin@apple.com>
1317 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8395
1318 <rdar://problem/4613467>
1319 REGRESSION: RegEx seems broken for hex escaped non breaking space
1321 Test: fast/js/regexp-extended-characters-more.html
1324 (match): Got rid of utf16Length local variable to guarantee there's no
1325 extra stack usage in recursive calls. Fixed two places in the PCRE_UTF16
1326 code that were using the length variable, which is the UTF-8 length of
1327 a character in the pattern, to move in the UTF-16 subject string. Instead
1328 they hardcode lengths of 1 and 2 since the code already handles BMP
1329 characters and surrogate pairs separately. Also fixed some DPRINTF so
1330 I could compile with DEBUG on.
1331 (pcre_exec): Changed a place that was checking for multibyte characters
1332 in the subject string to use ISMIDCHAR. Instead it was using hardcoded
1333 logic that was right for UTF-8 but wrong for UTF-16.
1335 * pcre/pcre_compile.c: (pcre_compile2): Fixed a DPRINTF so I could compile
1338 2006-07-14 Geoffrey Garen <ggaren@apple.com>
1342 Global replace in the API of argc/argv with argumentCount/arguments.
1344 2006-07-14 Geoffrey Garen <ggaren@apple.com>
1348 - Finalized exception handling in the API.
1350 setProperty can throw because it throws for built-in arrays. getProperty
1351 and deleteProperty can throw because setProperty can throw and we want
1352 to be consistent, and also because they seem like "actions." callAsFunction,
1353 callAsConstructor, and hasInstance can throw, because they caan throw for
1356 toBoolean can't throw because it's defined that way in the spec.
1358 - Documented that toBoolean and toObject can't be overridden by custom
1359 objects because they're defined that way in the spec.
1361 === Safari-521.17 ===
1363 2006-07-14 Geoffrey Garen <ggaren@apple.com>
1367 - Implemented ref-counting of JSContexts by splitting into two datatypes:
1368 JSGlobalContext, which you can create/retain/release, and JSContext, which
1371 Internally, you retain a JSGlobalContext/ExecState by retaining its
1372 interpreter, which, in the case of a global ExecState, owns it.
1374 - Also made ~Interpreter() protected to catch places where Interpreter
1375 is manually deleted. (Can't make it private because some crazy fool
1376 decided it would be a good idea to subclass Interpreter in other frameworks.
1380 (toJS): Added cast for new JSGlobalContext
1381 * API/JSStringRef.h: Changed vague "you must" language to more specific
1382 (but, ultimately, equally vague) "behavior is undefined if you don't"
1384 (KJS::Interpreter::Interpreter): Factored more common initialization into
1386 * kjs/interpreter.h:
1387 (KJS::Interpreter::ref): new
1388 (KJS::Interpreter::deref): new
1389 (KJS::Interpreter::refCount): new
1391 (doIt): Ref-count the interpreter.
1393 2006-07-14 Maciej Stachowiak <mjs@apple.com>
1397 - removed bool return value from JSObjectSetProperty, since it is inefficient and
1398 also doesn't work quite right
1399 - added JSObjectGetPropertyAtIndex and JSObjectSetPropertyAtIndex
1401 * API/JSObjectRef.cpp:
1402 (JSObjectSetProperty): Removed return value and canPut stuff.
1403 (JSObjectGetPropertyAtIndex): Added.
1404 (JSObjectSetPropertyAtIndex): Added.
1405 * API/JSObjectRef.h: Prototyped and documented new functions.
1407 2006-07-14 Geoffrey Garen <ggaren@apple.com>
1411 Moved JSCheckScriptSyntax, JSEvaluateScript, and JSGarbageCollect into
1412 JSBase.h/.cpp. They don't belong in the value-specific or context-specific
1413 files because they're not part of the value or context implementations.
1416 * API/JSContextRef.cpp:
1417 (JSContextGetGlobalObject):
1418 * API/JSContextRef.h:
1419 * API/JSValueRef.cpp:
1422 * JavaScriptCore.xcodeproj/project.pbxproj:
1424 2006-07-13 Timothy Hatcher <timothy@apple.com>
1428 Moved JavaScriptCore to be a public framework.
1430 * JavaScriptCore.xcodeproj/project.pbxproj:
1432 2006-07-13 Mark Rowe <opendarwin.org@bdash.net.nz>
1434 Reviewed by Geoffrey.
1436 http://bugzilla.opendarwin.org/show_bug.cgi?id=9742
1437 Bug 9742: REGRESSION: WebKit hangs when loading <http://www.vtbook.com>
1440 (KJS::JSValue::getUInt32): Only types tagged as numeric can be converted to UInt32.
1442 2006-07-13 Geoffrey Garen <ggaren@apple.com>
1446 - Renamed JSEvaluate -> JSEvaluateScript, JSCheckSyntax -> JSCheckScriptSyntax
1447 - Added exception out parameters to JSValueTo* and JSValueIsEqual because
1449 - Removed JSObjectGetDescription because it's useless and vague, and
1450 JSValueToString/JSValueIsObjectOfClass do a better job, anyway
1451 - Clarified comments about "IsFunction/Constructor" to indicate that they
1452 are true of all functions/constructors, not just those created by JSObjectMake*
1454 2006-07-12 Geoffrey Garen <ggaren@apple.com>
1458 Finished previously approved JSInternalString -> JSString conversion
1459 by renaming the files.
1461 * API/JSCallbackObject.cpp:
1462 * API/JSInternalStringRef.cpp: Removed.
1463 * API/JSInternalStringRef.h: Removed.
1464 * API/JSStringRef.cpp: Added.
1465 * API/JSStringRef.h: Added.
1466 * API/JavaScriptCore.h:
1467 * JavaScriptCore.xcodeproj/project.pbxproj:
1469 2006-07-12 Geoffrey Garen <ggaren@apple.com>
1473 - Removed context and exception parameters from JSObjectGetPropertyEnumerator,
1474 removing the spurious use of ExecState inside JavaScriptCore that made
1475 us think this was necessary in the first place.
1477 (StringInstance::getPropertyList): Use getString instead of toString because
1478 we know we're dealing with a string -- we put it there in the first place.
1479 While we're at it, store the string's size instead of retrieving it each time
1480 through the loop, to avoid the unnecessary killing of puppies.
1481 * kjs/string_object.h:
1483 2006-07-12 Maciej Stachowiak <mjs@apple.com>
1487 - add handling of hasInstance callback for API objects
1489 * API/JSCallbackObject.cpp:
1490 (KJS::JSCallbackObject::implementsHasInstance): Check if callback is present.
1491 (KJS::JSCallbackObject::hasInstance): Invoke appropriate callback.
1492 * API/JSCallbackObject.h:
1493 * API/JSClassRef.cpp:
1494 * API/JSObjectRef.h:
1496 (MyObject_hasInstance): Test case; should match what construct would do.
1499 2006-07-11 Geoffrey Garen <ggaren@apple.com>
1503 - Implemented a vast number of renames and comment clarifications
1504 suggested during API review.
1506 JSInternalString -> JSString
1507 JS*Make -> JSValueMake*, JSObjectMake*
1508 JSTypeCode -> JSType
1509 JSValueIsInstanceOf -> JSValueIsInstanceOfConstructor (reads strangely well in client code)
1510 JSGC*Protect -> JSValue*Protect
1511 JS*Callback -> JSObject*Callback
1512 JSGetPropertyListCallback -> JSObjectAddPropertiesToListCallback
1513 JSPropertyEnumeratorGetNext -> JSPropertyEnumeratorGetNextName
1515 JSStringCreateWithUTF8CString, JSStringGetUTF8CString,
1516 JSStringGetMaximumUTF8CStringSize JSStringIsEqualToUTF8CString,
1517 JSStringCreateWithCFString, JSStringCopyCFString, JSStringCreateWithCharacters.
1519 - Changed functions taking a JSValue out arg and returning a bool indicating
1520 whether it was set to simply return a JSValue or NULL.
1522 - Removed JSStringGetCharacters because it's more documentation than code,
1523 and it's just a glorified memcpy built on existing API functionality.
1525 - Moved standard library includes into the headers that actually require them.
1527 - Standardized use of the phrase "Create Rule."
1529 - Removed JSLock from make functions that don't allocate.
1531 - Added exception handling to JSValueToBoolean, since we now allow
1532 callback objects to throw exceptions upon converting to boolean.
1534 - Renamed JSGCCollect to JSGarbageCollect.
1536 2006-07-10 Geoffrey Garen <ggaren@apple.com>
1540 - Changed public header includes to the <JavaScriptCore/ style.
1541 - Changed instances of 'buffer' to 'string' since we decided on
1542 JSInternalString instead of JSStringBuffer.
1544 * API/JSContextRef.h:
1545 * API/JSInternalStringRef.cpp:
1547 (JSInternalStringRetain):
1548 (JSInternalStringRelease):
1549 (JSValueCopyStringValue):
1550 (JSInternalStringGetLength):
1551 (JSInternalStringGetCharactersPtr):
1552 (JSInternalStringGetCharacters):
1553 (JSInternalStringGetMaxLengthUTF8):
1554 (JSInternalStringGetCharactersUTF8):
1555 (CFStringCreateWithJSInternalString):
1556 * API/JSInternalStringRef.h:
1558 (JSNodePrototype_appendChild):
1559 (JSNode_getNodeType):
1560 * API/JSObjectRef.cpp:
1561 (JSObjectCallAsConstructor):
1563 * API/JavaScriptCore.h:
1568 (MyObject_getPropertyList):
1569 (myConstructor_callAsConstructor):
1570 (main): I noticed that we were prematurely releasing some string buffers,
1571 so I moved their release calls to the end of main(). I got rid of 'Buf' in *Buf
1572 (sometimes changing to 'IString', when necessary to differentiate a variable)
1573 to match the buffer->string change.
1575 === Safari-521.16 ===
1577 2006-07-10 Darin Adler <darin@apple.com>
1579 * kjs/value.cpp: (KJS::JSValue::toInt32Inline): Added inline keyword one more place.
1582 2006-07-10 Darin Adler <darin@apple.com>
1584 - fix the release build
1588 (KJS::JSValue::toInt32Inline): Move the code here to an inline.
1589 (KJS::JSValue::toInt32): Call the inline from both overloaded toInt32 functions.
1591 2006-07-10 David Kilzer <ddkilzer@kilzer.net>
1595 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9179
1596 Implement select.options.add() method
1598 * JavaScriptCore.exp: Added overloaded KJS::JSValue::toInt32() method.
1599 * JavaScriptCore.xcodeproj/project.pbxproj: Altered attributes metadata for
1600 kjs/value.h to make it available as a forwarded header.
1602 (KJS::lookupPut): Extracted a lookupPut() method from the existing lookupPut() method.
1603 The new method returns a boolean value if no entry is found in the lookup table.
1605 (KJS::JSValue::toInt32): Overloaded toInt32() method with boolean "Ok" argument.
1606 * kjs/value.h: Ditto.
1608 2006-07-10 Geoffrey Garen <ggaren@apple.com>
1610 No review necessary. Removed bogus file I accidentally checked in before.
1612 * API/JSInternalSringRef.h: Removed.
1614 2006-07-10 Geoffrey Garen <ggaren@apple.com>
1618 Added exception out parameter to API object callbacks, removed semi-bogus
1619 JSContext(.*)Exception functions.
1621 To make these calls syntactically simple, I added an exceptionSlot()
1622 method to the ExecState class, which provides a JSValue** slot in which to
1623 store a JSValue* exception.
1627 * API/JSCallbackConstructor.cpp:
1628 (KJS::JSCallbackConstructor::construct):
1629 * API/JSCallbackFunction.cpp:
1630 (KJS::JSCallbackFunction::callAsFunction):
1631 * API/JSCallbackObject.cpp:
1632 (KJS::JSCallbackObject::init):
1633 (KJS::JSCallbackObject::getOwnPropertySlot):
1634 (KJS::JSCallbackObject::put):
1635 (KJS::JSCallbackObject::deleteProperty):
1636 (KJS::JSCallbackObject::construct):
1637 (KJS::JSCallbackObject::callAsFunction):
1638 (KJS::JSCallbackObject::getPropertyList):
1639 (KJS::JSCallbackObject::toBoolean):
1640 (KJS::JSCallbackObject::toNumber):
1641 (KJS::JSCallbackObject::toString):
1642 (KJS::JSCallbackObject::staticValueGetter):
1643 (KJS::JSCallbackObject::callbackGetter):
1644 * API/JSContextRef.cpp:
1646 * API/JSContextRef.h:
1648 (JSNodePrototype_appendChild):
1649 (JSNodePrototype_removeChild):
1650 (JSNodePrototype_replaceChild):
1651 (JSNode_getNodeType):
1652 (JSNode_getChildNodes):
1653 (JSNode_getFirstChild):
1657 (JSNodeListPrototype_item):
1658 (JSNodeList_length):
1659 (JSNodeList_getProperty):
1660 * API/JSObjectRef.h:
1664 (MyObject_initialize):
1665 (MyObject_hasProperty):
1666 (MyObject_getProperty):
1667 (MyObject_setProperty):
1668 (MyObject_deleteProperty):
1669 (MyObject_getPropertyList):
1670 (MyObject_callAsFunction):
1671 (MyObject_callAsConstructor):
1672 (MyObject_convertToType):
1673 (print_callAsFunction):
1674 (myConstructor_callAsConstructor):
1676 * JavaScriptCore.exp:
1678 (KJS::ExecState::exceptionHandle):
1680 2006-07-10 Geoffrey Garen <ggaren@apple.com>
1684 Improved type safety by implementing opaque JSValue/JSObject typing through
1685 abuse of 'const', not void*. Also fixed an alarming number of bugs
1686 exposed by this new type safety.
1688 I made one design change in JavaScriptCore, which is that the JSObject
1689 constructor should take a JSValue* as its prototype argument, not a JSObject*,
1690 since we allow the prototype to be any JSValue*, including jsNull(), for
1696 * API/JSCallbackConstructor.cpp:
1697 (KJS::JSCallbackConstructor::construct):
1698 * API/JSCallbackFunction.cpp:
1699 (KJS::JSCallbackFunction::callAsFunction):
1700 * API/JSCallbackObject.cpp:
1701 (KJS::JSCallbackObject::JSCallbackObject):
1702 (KJS::JSCallbackObject::getOwnPropertySlot):
1703 (KJS::JSCallbackObject::put):
1704 (KJS::JSCallbackObject::construct):
1705 (KJS::JSCallbackObject::callAsFunction):
1706 (KJS::JSCallbackObject::staticFunctionGetter):
1707 * API/JSCallbackObject.h:
1708 * API/JSContextRef.cpp:
1711 (JSNodePrototype_appendChild):
1712 (JSNodePrototype_removeChild):
1713 (JSNodePrototype_replaceChild):
1714 * API/JSObjectRef.cpp:
1716 (JSFunctionMakeWithBody):
1717 (JSObjectGetProperty):
1718 (JSObjectCallAsFunction):
1719 (JSObjectCallAsConstructor):
1720 * API/JSObjectRef.h:
1725 (KJS::JSObject::JSObject):
1727 2006-07-10 Geoffrey Garen <ggaren@apple.com>
1729 Approved by Maciej, Darin.
1731 Renamed JSStringBufferRef to JSInternalStringRef. "Internal string" means the
1732 JavaScript engine's internal string representation, which is the most
1733 low-level and efficient representation to use when interfacing with JavaScript.
1739 * API/JSCallbackObject.cpp:
1740 (KJS::JSCallbackObject::getOwnPropertySlot):
1741 (KJS::JSCallbackObject::put):
1742 (KJS::JSCallbackObject::deleteProperty):
1743 (KJS::JSCallbackObject::staticValueGetter):
1744 (KJS::JSCallbackObject::callbackGetter):
1745 * API/JSContextRef.cpp:
1748 * API/JSContextRef.h:
1749 * API/JSInternalStringRef.cpp: Added.
1751 (JSInternalStringCreate):
1752 (JSInternalStringCreateUTF8):
1753 (JSInternalStringRetain):
1754 (JSInternalStringRelease):
1755 (JSValueCopyStringValue):
1756 (JSInternalStringGetLength):
1757 (JSInternalStringGetCharactersPtr):
1758 (JSInternalStringGetCharacters):
1759 (JSInternalStringGetMaxLengthUTF8):
1760 (JSInternalStringGetCharactersUTF8):
1761 (JSInternalStringIsEqual):
1762 (JSInternalStringIsEqualUTF8):
1763 (JSInternalStringCreateCF):
1764 (CFStringCreateWithJSInternalString):
1765 * API/JSInternalStringRef.h: Added.
1767 (JSNodePrototype_appendChild):
1768 (JSNode_getNodeType):
1769 (JSNode_getChildNodes):
1770 (JSNode_getFirstChild):
1772 (JSNodeList_length):
1773 (JSNodeList_getProperty):
1774 * API/JSObjectRef.cpp:
1775 (JSFunctionMakeWithBody):
1776 (JSObjectGetDescription):
1777 (JSObjectHasProperty):
1778 (JSObjectGetProperty):
1779 (JSObjectSetProperty):
1780 (JSObjectDeleteProperty):
1781 (JSPropertyEnumeratorGetNext):
1782 (JSPropertyListAdd):
1783 * API/JSObjectRef.h:
1784 * API/JSStringBufferRef.cpp: Removed.
1785 * API/JSStringBufferRef.h: Removed.
1787 * API/JavaScriptCore.h:
1792 (assertEqualsAsUTF8String):
1793 (assertEqualsAsCharactersPtr):
1794 (assertEqualsAsCharacters):
1795 (MyObject_hasProperty):
1796 (MyObject_getProperty):
1797 (MyObject_setProperty):
1798 (MyObject_deleteProperty):
1799 (MyObject_getPropertyList):
1800 (print_callAsFunction):
1801 (myConstructor_callAsConstructor):
1803 * JavaScriptCore.exp:
1804 * JavaScriptCore.xcodeproj/project.pbxproj:
1806 2006-07-08 Tim Omernick <timo@apple.com>
1810 Added an OpenGL drawing model to the Netscape Plug-in API.
1814 2006-07-08 Timothy Hatcher <timothy@apple.com>
1818 Moved KJS_GetCreatedJavaVMs to jni_utility.cpp.
1819 Switched KJS_GetCreatedJavaVMs over to use dlopen and dlsym
1820 now that NSAddImage, NSLookupSymbolInImage and NSAddressOfSymbol
1821 are deprecated in Leopard.
1823 * JavaScriptCore.exp:
1824 * JavaScriptCore.xcodeproj/project.pbxproj:
1825 * bindings/jni/jni_utility.cpp:
1826 (KJS::Bindings::KJS_GetCreatedJavaVMs):
1827 * bindings/softlinking.c: Removed.
1828 * bindings/softlinking.h: Removed.
1830 2006-07-08 Geoffrey Garen <ggaren@apple.com>
1834 - Make JSObjectGetProperty return a JSValue or NULL, like JSEvaluate does.
1836 * API/JSObjectRef.cpp:
1837 (JSObjectGetProperty):
1838 * API/JSObjectRef.h:
1842 2006-07-08 Geoffrey Garen <ggaren@apple.com>
1844 Style change -- no review necessary.
1846 Use 0 instead of NULL in API .cpp files, to match our style guidelines.
1848 * API/JSContextRef.cpp:
1850 * API/JSObjectRef.cpp:
1851 (JSFunctionMakeWithBody):
1852 (JSObjectCallAsFunction):
1853 (JSObjectCallAsConstructor):
1854 * API/JSValueRef.cpp:
1857 2006-07-08 Geoffrey Garen <ggaren@apple.com>
1861 - Added ability to pass NULL for thisObject when calling JSObjectCallAsFunction,
1862 to match JSEvaluate.
1864 * API/JSObjectRef.cpp:
1865 (JSObjectCallAsFunction):
1866 * API/JSObjectRef.h:
1870 === Safari-521.15 ===
1872 2006-07-07 Geoffrey Garen <ggaren@apple.com>
1876 - Standardized which functions take a JSContext as an argument. The rule is:
1877 if you might execute JavaScript, you take a JSContext, otherwise you don't.
1879 The FIXME in JSObjectRef.h requires refactoring some parts of Interpreter,
1880 but not API changes, so I'm putting it off until later.
1882 * API/JSCallbackObject.cpp:
1883 (KJS::JSCallbackObject::JSCallbackObject):
1884 (KJS::JSCallbackObject::init):
1885 * API/JSCallbackObject.h:
1886 * API/JSContextRef.cpp:
1888 * API/JSContextRef.h:
1889 * API/JSObjectRef.cpp:
1891 (JSPropertyEnumeratorGetNext):
1892 * API/JSObjectRef.h:
1894 (MyObject_initialize):
1896 * JavaScriptCore.exp:
1897 * kjs/array_object.cpp:
1898 (ArrayInstance::setLength):
1899 (ArrayInstance::pushUndefinedObjectsToEnd):
1901 (ForInNode::execute):
1902 * kjs/reference.cpp:
1903 (KJS::Reference::getPropertyName):
1904 (KJS::Reference::getValue):
1906 * kjs/scope_chain.cpp:
1907 (KJS::ScopeChain::print):
1909 2006-07-06 Geoffrey Garen <ggaren@apple.com>
1915 - Headerdoc finished
1918 - Added a JSContextRef argument to many functions, because you need a
1919 JSContextRef for doing virtually anything. I expect to add this argument
1920 to even more functions in a future patch.
1922 - Removed the globalObjectPrototype argument to JSContextCreate because
1923 you can't create an object until you have a context, so it's impossible
1924 to pass a prototype object to JSContextCreate. That's OK because (1) there's
1925 no reason to give the global object a prototype and (2) if you really want
1926 to, you can just use a separate call to JSObjectSetPrototype.
1928 - Removed the JSClassRef argument to JSClassCreate because it was unnecessary,
1929 and you need to be able to make the global object's class before you've
1930 created a JSContext.
1932 - Added an optional exception parameter to JSFunctionMakeWithBody because anything
1933 less would be uncivilized.
1935 - Made the return value parameter to JSObjectGetProperty optional to match
1936 all other return value parameters in the API.
1938 - Made JSObjectSetPrivate/JSObjectGetPrivate work on JSCallbackFunctions
1939 and JSCallbackConstructors. You could use an abstract base class or strategic
1940 placement of m_privateData in the class structure to implement this, but
1941 the former seemed like overkill, and the latter seemed too dangerous.
1943 - Fixed a bug where JSPropertyEnumeratorGetNext would skip the first property.
1946 - Reversed the logic of the JSChar #ifdef to avoid confusing headerdoc
1948 - Removed function names from @function declarations because headeroc
1949 can parse them automatically, and I wanted to rule out manual mismatch.
1951 - Changed Error::create to take a const UString& instead of a UString*
1952 because it was looking at me funny.
1954 - Renamed JSStringBufferCreateWithCFString to JSStringBufferCreateCF
1955 because the latter is more concise and it matches JSStringBufferCreateUTF8.
1957 * API/JSCallbackObject.cpp:
1958 (KJS::JSCallbackObject::getOwnPropertySlot):
1959 (KJS::JSCallbackObject::put):
1960 (KJS::JSCallbackObject::deleteProperty):
1961 (KJS::JSCallbackObject::getPropertyList):
1962 (KJS::JSCallbackObject::toBoolean):
1963 (KJS::JSCallbackObject::toNumber):
1964 (KJS::JSCallbackObject::toString):
1965 * API/JSClassRef.cpp:
1967 * API/JSContextRef.cpp:
1969 (JSContextSetException):
1970 * API/JSContextRef.h:
1972 (JSNodePrototype_class):
1975 (JSNodeListPrototype_class):
1977 * API/JSObjectRef.cpp:
1978 (JSObjectGetProperty):
1979 (JSObjectGetPrivate):
1980 (JSObjectSetPrivate):
1981 (JSObjectCallAsFunction):
1982 (JSObjectCallAsConstructor):
1983 (JSPropertyEnumeratorGetNext):
1984 * API/JSObjectRef.h:
1985 * API/JSStringBufferRef.cpp:
1986 (JSStringBufferCreateCF):
1987 * API/JSStringBufferRef.h:
1988 * API/JSValueRef.cpp:
1989 (JSValueIsInstanceOf):
1995 (MyObject_hasProperty):
1996 (MyObject_setProperty):
1997 (MyObject_deleteProperty):
1998 (MyObject_getPropertyList):
1999 (MyObject_convertToType):
2002 * JavaScriptCore.exp:
2004 2006-07-07 Geoffrey Garen <ggaren@apple.com>
2008 - Fixed a few crashes resulting from NULL parameters to JSClassCreate.
2010 * API/JSClassRef.cpp:
2013 * API/testapi.c: Added test for NULL parameters.
2016 2006-07-07 Geoffrey Garen <ggaren@apple.com>
2018 Reviewed by John, mocked by Darin.
2020 - Changed JSEvaluate to take a JSObjectRef instead of a JSValueRef as
2021 "this," since "this" must be an object.
2023 * API/JSContextRef.cpp:
2025 * API/JSContextRef.h:
2027 2006-07-07 Geoffrey Garen <ggaren@apple.com>
2034 * JavaScriptCore.xcodeproj/project.pbxproj:
2036 2006-07-05 Geoffrey Garen <ggaren@apple.com>
2040 Renamed JSCharBufferRef, which was universally unpopular, to JSStringBufferRef,
2041 which, hopefully, will be less unpopular.
2047 * API/JSCallbackObject.cpp:
2048 (KJS::JSCallbackObject::getOwnPropertySlot):
2049 (KJS::JSCallbackObject::put):
2050 (KJS::JSCallbackObject::deleteProperty):
2051 (KJS::JSCallbackObject::staticValueGetter):
2052 (KJS::JSCallbackObject::callbackGetter):
2053 * API/JSCharBufferRef.cpp: Removed.
2054 * API/JSCharBufferRef.h: Removed.
2055 * API/JSContextRef.cpp:
2058 * API/JSContextRef.h:
2060 (JSNodePrototype_appendChild):
2061 (JSNode_getNodeType):
2062 (JSNode_getChildNodes):
2063 (JSNode_getFirstChild):
2065 (JSNodeList_length):
2066 (JSNodeList_getProperty):
2067 * API/JSObjectRef.cpp:
2068 (JSFunctionMakeWithBody):
2069 (JSObjectGetDescription):
2070 (JSObjectHasProperty):
2071 (JSObjectGetProperty):
2072 (JSObjectSetProperty):
2073 (JSObjectDeleteProperty):
2074 (JSPropertyEnumeratorGetNext):
2075 (JSPropertyListAdd):
2076 * API/JSObjectRef.h:
2077 * API/JSStringBufferRef.cpp: Added.
2079 (JSStringBufferCreate):
2080 (JSStringBufferCreateUTF8):
2081 (JSStringBufferRetain):
2082 (JSStringBufferRelease):
2083 (JSValueCopyStringValue):
2084 (JSStringBufferGetLength):
2085 (JSStringBufferGetCharactersPtr):
2086 (JSStringBufferGetCharacters):
2087 (JSStringBufferGetMaxLengthUTF8):
2088 (JSStringBufferGetCharactersUTF8):
2089 (JSStringBufferIsEqual):
2090 (JSStringBufferIsEqualUTF8):
2091 (JSStringBufferCreateWithCFString):
2092 (CFStringCreateWithJSStringBuffer):
2093 * API/JSStringBufferRef.h: Added.
2095 * API/JavaScriptCore.h:
2100 (assertEqualsAsUTF8String):
2101 (assertEqualsAsCharactersPtr):
2102 (assertEqualsAsCharacters):
2103 (MyObject_hasProperty):
2104 (MyObject_getProperty):
2105 (MyObject_setProperty):
2106 (MyObject_deleteProperty):
2107 (MyObject_getPropertyList):
2108 (print_callAsFunction):
2109 (myConstructor_callAsConstructor):
2111 * JavaScriptCore.exp:
2112 * JavaScriptCore.xcodeproj/project.pbxproj:
2114 2006-07-05 Geoffrey Garen <ggaren@apple.com>
2118 Moved some code around for more logical file separation.
2121 * API/JSContextRef.h:
2122 * API/JSObjectRef.cpp:
2123 * API/JSValueRef.cpp:
2127 2006-07-03 Geoffrey Garen <ggaren@apple.com>
2131 Implemented JSFunctionMakeWithBody, which parses a script as a function body
2132 in the global scope, and returns the resulting anonymous function.
2134 I also removed private data from JSCallbackFunction. It never worked,
2135 since JSCallbackFunction doesn't inherit from JSCallbackObject.
2137 * API/JSCallbackConstructor.cpp: Removed.
2138 * API/JSCallbackConstructor.h: Removed.
2139 * API/JSCallbackFunction.cpp:
2140 (KJS::JSCallbackFunction::JSCallbackFunction):
2141 (KJS::JSCallbackFunction::implementsConstruct):
2142 (KJS::JSCallbackFunction::construct):
2143 (KJS::JSCallbackFunction::implementsCall):
2144 (KJS::JSCallbackFunction::callAsFunction):
2145 * API/JSCallbackFunction.h:
2146 * API/JSCallbackObject.cpp:
2147 (KJS::JSCallbackObject::staticFunctionGetter):
2148 * API/JSObjectRef.cpp:
2150 (JSFunctionMakeWithCallbacks):
2151 * API/JSObjectRef.h:
2157 * JavaScriptCore.exp: Programmatically added all symbols exported by
2158 API object files, and sorted results
2159 * JavaScriptCore.xcodeproj/project.pbxproj:
2161 2006-07-03 Geoffrey Garen <ggaren@apple.com>
2165 - Return syntax error in JSCheckSyntax through a JSValueRef* exception
2169 * API/JSContextRef.cpp:
2173 * JavaScriptCore.exp:
2174 * kjs/interpreter.cpp:
2175 (KJS::Interpreter::checkSyntax):
2176 * kjs/interpreter.h:
2178 2006-07-04 Darin Adler <darin@apple.com>
2182 * wtf/MathExtras.h: Oops. Added missing #endif.
2184 2006-07-04 Bjoern Graf <bjoern.graf@gmail.com>
2187 Tweaked a bit by Darin.
2189 - http://bugzilla.opendarwin.org/show_bug.cgi?id=9678
2190 work around MSVCRT's fmod function returning NaN for fmod(x, infinity) instead of x
2192 * wtf/MathExtras.h: Added include of <float.h>.
2193 (isinf): Fix to return false for NAN.
2194 (wtf_fmod): Added. An inline that works around the bug.
2197 * kjs/number_object.cpp:
2198 * kjs/operations.cpp:
2200 Added includes of MathExtras.h to all files using fmod.
2202 * JavaScriptCore.xcodeproj/project.pbxproj: Let Xcode 2.3 have its way with
2205 2006-07-01 Geoffrey Garen <ggaren@apple.com>
2209 - Refined value conversions in the API:
2210 - failed toNumber returns NaN
2211 - failed toObject returns NULL
2212 - failed toString returns empty string
2214 - Refined excpetion handling in the API:
2215 - failed value conversions do not throw exceptions
2216 - uncaught exceptions in JSEvaluate, JSObjectCallAsFunction, and
2217 JSObjectCallAsConstructor are returned through a JSValueRef* exception
2219 - removed JSContextHasException, because JSContextGetException does
2223 * API/JSCharBufferRef.cpp:
2224 (JSValueCopyStringValue):
2225 * API/JSContextRef.cpp:
2227 * API/JSContextRef.h:
2228 * API/JSNodeList.c: Added test code demonstrating how you would use
2229 toNumber, and why you probably don't need toUInt32, etc.
2230 (JSNodeListPrototype_item):
2231 (JSNodeList_getProperty):
2232 * API/JSObjectRef.cpp:
2234 (JSObjectCallAsFunction):
2235 (JSObjectCallAsConstructor):
2236 * API/JSObjectRef.h:
2237 * API/JSValueRef.cpp:
2243 (main): Added tests for new rules, and call to JSGCProtect to fix Intel
2245 * JavaScriptCore.exp:
2247 2006-07-03 Darin Adler <darin@apple.com>
2249 - Rolled out HashMap implementation of NPRuntime, at least temporarily.
2251 Fixes hang in the bindings section of layout tests seen on the
2254 This code was using HashMap<const char*, PrivateIdentifier*>.
2255 But that hashes based on pointer identity, not string value.
2256 The default hash for any pointer type is to hash based on the pointer.
2257 And WTF doesn't currently have a string hash for char*.
2258 We'll need to fix that before re-landing this patch.
2260 (Formatting was also incorrect -- extra spaces in parentheses.)
2262 * bindings/npruntime.cpp: Rolled out last change.
2264 2006-07-02 Justin Haygood <jhaygood@spsu.edu>
2266 Reviewed, tweaked, landed by ggaren.
2268 - Port NPRuntime from CFDictionary to HashMap.
2270 * bindings/npruntime.cpp:
2271 (getStringIdentifierDictionary):
2272 (getIntIdentifierDictionary):
2273 (_NPN_GetStringIdentifier):
2274 (_NPN_GetIntIdentifier):
2275 * bindings/npruntime.h:
2277 2006-07-01 Geoffrey Garen <ggaren@apple.com>
2281 - Fixed <rdar://problem/4611197> REGRESSION: Liveconnect with Java test
2282 fails at http://www-sor.inria.fr/~dedieu/notes/liveconnect/simple_example.html
2284 * JavaScriptCore.exp: Export symbols used by liveconnect
2286 2006-06-29 Geoffrey Garen <ggaren@apple.com>
2290 - Phase 2 in the JS API.
2292 - Added support for specifying static tables of values -- this should
2293 obviate the need for using complicated callbacks for most lookups.
2295 - API objects are now created with classes (JSClassRef) -- in order to support
2296 static values, and in order to prevent API objects from storing their
2297 data inline, and thus falling into the oversized (read: slow and prone to
2298 giving Maciej the frowny face) heap.
2300 - Added two specialized JSObject subclasses -- JSCallbackFunction and JSCallbackConstructor --
2301 to allow JSFunctionMake and JSConstructorMake to continue to work with
2302 the new class model. Another solution to this problem would be to create
2303 a custom class object for each function and constructor you make. This
2304 solution is more code but also more efficient.
2306 - Substantially beefed up the minidom example to demonstrate and test a
2307 lot of these techniques. Its output is still pretty haphazard, though.
2309 - Gave the <kjs/ preface to some includes -- I'm told this matters to
2310 building on some versions of Linux.
2312 - Implemented JSValueIsInstanceOf and JSValueIsObjectOfClass
2314 - Removed GetDescription callback. Something in the class datastructure
2315 should take care of this.
2318 * API/JSCallbackConstructor.cpp: Added.
2320 (KJS::JSCallbackConstructor::JSCallbackConstructor):
2321 (KJS::JSCallbackConstructor::implementsConstruct):
2322 (KJS::JSCallbackConstructor::construct):
2323 (KJS::JSCallbackConstructor::setPrivate):
2324 (KJS::JSCallbackConstructor::getPrivate):
2325 * API/JSCallbackConstructor.h: Added.
2326 (KJS::JSCallbackConstructor::classInfo):
2327 * API/JSCallbackFunction.cpp: Added.
2329 (KJS::JSCallbackFunction::JSCallbackFunction):
2330 (KJS::JSCallbackFunction::implementsCall):
2331 (KJS::JSCallbackFunction::callAsFunction):
2332 (KJS::JSCallbackFunction::setPrivate):
2333 (KJS::JSCallbackFunction::getPrivate):
2334 * API/JSCallbackFunction.h: Added.
2335 (KJS::JSCallbackFunction::classInfo):
2336 * API/JSCallbackObject.cpp:
2338 (KJS::JSCallbackObject::JSCallbackObject):
2339 (KJS::JSCallbackObject::init):
2340 (KJS::JSCallbackObject::~JSCallbackObject):
2341 (KJS::JSCallbackObject::className):
2342 (KJS::JSCallbackObject::getOwnPropertySlot):
2343 (KJS::JSCallbackObject::put):
2344 (KJS::JSCallbackObject::deleteProperty):
2345 (KJS::JSCallbackObject::implementsConstruct):
2346 (KJS::JSCallbackObject::construct):
2347 (KJS::JSCallbackObject::implementsCall):
2348 (KJS::JSCallbackObject::callAsFunction):
2349 (KJS::JSCallbackObject::getPropertyList):
2350 (KJS::JSCallbackObject::toBoolean):
2351 (KJS::JSCallbackObject::toNumber):
2352 (KJS::JSCallbackObject::toString):
2353 (KJS::JSCallbackObject::inherits):
2354 (KJS::JSCallbackObject::staticValueGetter):
2355 (KJS::JSCallbackObject::staticFunctionGetter):
2356 (KJS::JSCallbackObject::callbackGetter):
2357 * API/JSCallbackObject.h:
2358 * API/JSCharBufferRef.cpp:
2359 * API/JSClassRef.cpp: Added.
2363 * API/JSClassRef.h: Added.
2364 (StaticValueEntry::StaticValueEntry):
2365 (StaticFunctionEntry::StaticFunctionEntry):
2366 (__JSClass::__JSClass):
2367 * API/JSContextRef.cpp:
2370 * API/JSContextRef.h:
2371 * API/JSNode.c: Added.
2372 (JSNodePrototype_appendChild):
2373 (JSNodePrototype_removeChild):
2374 (JSNodePrototype_replaceChild):
2375 (JSNodePrototype_class):
2376 (JSNode_getNodeType):
2377 (JSNode_getChildNodes):
2378 (JSNode_getFirstChild):
2384 * API/JSNode.h: Added.
2385 * API/JSNodeList.c: Added.
2386 (JSNodeListPrototype_item):
2387 (JSNodeListPrototype_class):
2388 (JSNodeList_length):
2389 (JSNodeList_getProperty):
2390 (JSNodeList_finalize):
2392 (JSNodeList_prototype):
2394 * API/JSNodeList.h: Added.
2395 * API/JSObjectRef.cpp:
2398 (JSConstructorMake):
2399 (__JSPropertyEnumerator::__JSPropertyEnumerator):
2400 (JSObjectCreatePropertyEnumerator):
2401 (JSPropertyEnumeratorGetNext):
2402 (JSPropertyEnumeratorRetain):
2403 (JSPropertyEnumeratorRelease):
2404 * API/JSObjectRef.h:
2405 (__JSObjectCallbacks::):
2406 * API/JSValueRef.cpp:
2407 (JSValueIsObjectOfClass):
2408 (JSValueIsInstanceOf):
2410 * API/Node.c: Added.
2414 (Node_replaceChild):
2417 * API/Node.h: Added.
2418 * API/NodeList.c: Added.
2424 * API/NodeList.h: Added.
2428 (createStringWithContentsOfFile):
2431 (assertEqualsAsCharacters):
2432 (MyObject_getProperty):
2434 (myConstructor_callAsConstructor):
2437 * JavaScriptCore.xcodeproj/project.pbxproj:
2439 2006-06-26 Kevin Ollivier <kevino@theolliviers.com>
2441 Reviewed and tweaked by Darin.
2443 - Compile fixes for wx port / gcc 4.0.2
2445 * kjs/array_object.cpp:
2446 Added missing headers.
2449 gcc needs class prototypes before defining those classes as friend classes
2451 2006-06-30 Mike Emmel <mike.emmel@gmail.com>
2455 Compilation fixes for Linux/Gdk.
2457 * JavaScriptCore/kjs/interpreter.cpp: added include of signal.h
2458 * JavaScriptCore/kjs/ExecState.h: added missing class declaration
2459 * JavaScriptCore/kjs/ExecState.cpp: case wrong on include of context.h
2460 * JavaScriptCore/JavaScriptCoreSources.bkl: added Context.cpp and ExecState.cpp
2462 === Safari-521.14 ===
2464 2006-06-29 Maciej Stachowiak <mjs@apple.com>
2468 - add headerdoc comments to some of the new JS API headers
2473 2006-06-28 Timothy Hatcher <timothy@apple.com>
2475 Prefer the Stabs debugging symbols format until DWARF bugs are fixed.
2477 * JavaScriptCore.xcodeproj/project.pbxproj:
2479 2006-06-27 Timothy Hatcher <timothy@apple.com>
2483 <rdar://problem/4448350> Deprecated ObjC language API used in JavaScriptCore, WebCore, WebKit and WebBrowser
2485 Switch to the new ObjC 2 API, ifdefed the old code around OBJC_API_VERSION so it still works on Tiger.
2486 Removed the use of the old stringWithCString, switched to the new Tiger version that accepts an encoding.
2487 Lots of code style cleanup.
2489 * JavaScriptCore.xcodeproj/project.pbxproj:
2490 * bindings/objc/objc_class.h:
2491 * bindings/objc/objc_class.mm:
2492 (KJS::Bindings::ObjcClass::~ObjcClass):
2493 (KJS::Bindings::_createClassesByIsAIfNecessary):
2494 (KJS::Bindings::ObjcClass::classForIsA):
2495 (KJS::Bindings::ObjcClass::name):
2496 (KJS::Bindings::ObjcClass::methodsNamed):
2497 (KJS::Bindings::ObjcClass::fieldNamed):
2498 (KJS::Bindings::ObjcClass::fallbackObject):
2499 * bindings/objc/objc_header.h:
2500 * bindings/objc/objc_instance.h:
2501 * bindings/objc/objc_instance.mm:
2502 (ObjcInstance::ObjcInstance):
2503 (ObjcInstance::~ObjcInstance):
2504 (ObjcInstance::operator=):
2505 (ObjcInstance::begin):
2506 (ObjcInstance::end):
2507 (ObjcInstance::getClass):
2508 (ObjcInstance::invokeMethod):
2509 (ObjcInstance::invokeDefaultMethod):
2510 (ObjcInstance::setValueOfField):
2511 (ObjcInstance::supportsSetValueOfUndefinedField):
2512 (ObjcInstance::setValueOfUndefinedField):
2513 (ObjcInstance::getValueOfField):
2514 (ObjcInstance::getValueOfUndefinedField):
2515 (ObjcInstance::defaultValue):
2516 (ObjcInstance::stringValue):
2517 (ObjcInstance::numberValue):
2518 (ObjcInstance::booleanValue):
2519 (ObjcInstance::valueOf):
2520 * bindings/objc/objc_runtime.h:
2521 * bindings/objc/objc_runtime.mm:
2522 (ObjcMethod::ObjcMethod):
2524 (ObjcMethod::getMethodSignature):
2525 (ObjcMethod::setJavaScriptName):
2528 (ObjcField::valueFromInstance):
2529 (convertValueToObjcObject):
2530 (ObjcField::setValueToInstance):
2531 (ObjcArray::operator=):
2532 (ObjcArray::setValueAt):
2533 (ObjcArray::valueAt):
2534 (ObjcFallbackObjectImp::ObjcFallbackObjectImp):
2535 (ObjcFallbackObjectImp::callAsFunction):
2536 (ObjcFallbackObjectImp::defaultValue):
2538 2006-06-28 Anders Carlsson <acarlsson@apple.com>
2542 http://bugzilla.opendarwin.org/show_bug.cgi?id=8636
2543 REGRESSION: JavaScript access to Java applet causes hang (_webViewURL not implemented)
2545 * bindings/jni/jni_objc.mm:
2546 (KJS::Bindings::dispatchJNICall):
2547 Just pass nil as the calling URL. This will cause the Java plugin to use the URL of the page
2548 containing the applet (which is what we used to do).
2550 2006-06-27 Timothy Hatcher <timothy@apple.com>
2554 <rdar://problem/4406785> Add an export file to TOT JavaScriptCore like the Safari-2-0-branch
2556 * JavaScriptCore.exp: Added.
2557 * JavaScriptCore.xcodeproj/project.pbxproj:
2559 2006-06-25 Geoffrey Garen <ggaren@apple.com>
2563 - Added JSConstructorMake to match JSFunctionMake, along with test code.
2565 [ I checked in the ChangeLog before without the actual files. ]
2567 * API/JSObjectRef.cpp:
2568 (JSConstructorMake):
2569 * API/JSObjectRef.h:
2571 (myConstructor_callAsConstructor):
2575 * JavaScriptCore.xcodeproj/project.pbxproj: Moved testapi.c to the testapi
2576 target -- this was an oversight in my earlier check-in.
2578 2006-06-25 Timothy Hatcher <timothy@apple.com>
2582 Bug 9574: Drosera should show inline scripts within the original HTML
2583 http://bugzilla.opendarwin.org/show_bug.cgi?id=9574
2585 Pass the starting line number and error message to the debugger.
2588 (Debugger::sourceParsed):
2591 (KJS::GlobalFuncImp::callAsFunction):
2592 * kjs/function_object.cpp:
2593 (FunctionObjectImp::construct):
2594 * kjs/interpreter.cpp:
2595 (KJS::Interpreter::evaluate):
2597 2006-06-24 Alexey Proskuryakov <ap@nypop.com>
2599 Rubber-stamped by Eric.
2601 Add a -h (do not follow symlinks) option to ln in derived sources build script (without it,
2602 a symlink was created inside the source directory on second build).
2604 * JavaScriptCore.xcodeproj/project.pbxproj:
2606 2006-06-24 David Kilzer <ddkilzer@kilzer.net>
2608 Reviewed by Timothy.
2610 * Info.plist: Fixed copyright to include 2003-2006.
2612 2006-06-24 Alexey Proskuryakov <ap@nypop.com>
2616 - http://bugzilla.opendarwin.org/show_bug.cgi?id=9418
2617 WebKit will not build when Space exists in path
2619 * JavaScriptCore.xcodeproj/project.pbxproj: Enclose search paths in quotes; create symlinks to
2620 avoid passing paths with spaces to make.
2622 2006-06-23 Timothy Hatcher <timothy@apple.com>
2626 Adding more operator[] overloads for long and short types.
2629 (WTF::Vector::operator[]):
2631 === JavaScriptCore-521.13 ===
2633 2006-06-22 Alexey Proskuryakov <ap@nypop.com>
2637 - http://bugzilla.opendarwin.org/show_bug.cgi?id=9539
2638 Another case error preventing build
2640 * API/JSObjectRef.cpp: Changed "identifier.h" to "Identifier.h"
2642 2006-06-22 David Kilzer <ddkilzer@kilzer.net>
2646 http://bugzilla.opendarwin.org/show_bug.cgi?id=9539
2647 Another case error preventing build
2649 * API/APICast.h: Changed "UString.h" to "ustring.h".
2651 2006-06-21 Geoffrey Garen <ggaren@apple.com>
2653 Fixed release build, fixed accidental infinite recursion due to
2654 last minute global replace gone awry.
2659 (assertEqualsAsBoolean):
2660 (assertEqualsAsNumber):
2661 (assertEqualsAsUTF8String):
2662 (assertEqualsAsCharactersPtr):
2663 * JavaScriptCore.xcodeproj/project.pbxproj:
2665 2006-06-21 Geoffrey Garen <ggaren@apple.com>
2669 - First cut at C API to JavaScript. Includes a unit test, 'testapi.c',
2670 and the outline of a test app, 'minidom.c'.
2672 Includes one change to JSC internals: Rename propList to getPropertyList and have it
2673 take its target property list by reference so that subclasses can
2674 add properties to the list before calling through to their superclasses.
2676 Also, I just ran prepare-ChangeLog in about 10 seconds, and I would like
2677 to give a shout-out to that.
2679 * API/APICast.h: Added.
2682 * API/JSBase.h: Added.
2683 * API/JSCallbackObject.cpp: Added.
2685 (KJS::JSCallbackObject::JSCallbackObject):
2686 (KJS::JSCallbackObject::~JSCallbackObject):
2687 (KJS::JSCallbackObject::className):
2688 (KJS::JSCallbackObject::getOwnPropertySlot):
2689 (KJS::JSCallbackObject::put):
2690 (KJS::JSCallbackObject::deleteProperty):
2691 (KJS::JSCallbackObject::implementsConstruct):
2692 (KJS::JSCallbackObject::construct):
2693 (KJS::JSCallbackObject::implementsCall):
2694 (KJS::JSCallbackObject::callAsFunction):
2695 (KJS::JSCallbackObject::getPropertyList):
2696 (KJS::JSCallbackObject::toBoolean):
2697 (KJS::JSCallbackObject::toNumber):
2698 (KJS::JSCallbackObject::toString):
2699 (KJS::JSCallbackObject::setPrivate):
2700 (KJS::JSCallbackObject::getPrivate):
2701 (KJS::JSCallbackObject::cachedValueGetter):
2702 (KJS::JSCallbackObject::callbackGetter):
2703 * API/JSCallbackObject.h: Added.
2704 (KJS::JSCallbackObject::classInfo):
2705 * API/JSCharBufferRef.cpp: Added.
2707 (JSCharBufferCreate):
2708 (JSCharBufferCreateUTF8):
2709 (JSCharBufferRetain):
2710 (JSCharBufferRelease):
2711 (JSValueCopyStringValue):
2712 (JSCharBufferGetLength):
2713 (JSCharBufferGetCharactersPtr):
2714 (JSCharBufferGetCharacters):
2715 (JSCharBufferGetMaxLengthUTF8):
2716 (JSCharBufferGetCharactersUTF8):
2717 (JSCharBufferIsEqual):
2718 (JSCharBufferIsEqualUTF8):
2719 (JSCharBufferCreateWithCFString):
2720 (CFStringCreateWithJSCharBuffer):
2721 * API/JSCharBufferRef.h: Added.
2722 * API/JSContextRef.cpp: Added.
2725 (JSContextGetGlobalObject):
2728 (JSContextHasException):
2729 (JSContextGetException):
2730 (JSContextClearException):
2731 (JSContextSetException):
2732 * API/JSContextRef.h: Added.
2733 * API/JSObjectRef.cpp: Added.
2737 (JSObjectGetDescription):
2738 (JSObjectGetPrototype):
2739 (JSObjectSetPrototype):
2740 (JSObjectHasProperty):
2741 (JSObjectGetProperty):
2742 (JSObjectSetProperty):
2743 (JSObjectDeleteProperty):
2744 (JSObjectGetPrivate):
2745 (JSObjectSetPrivate):
2746 (JSObjectIsFunction):
2747 (JSObjectCallAsFunction):
2748 (JSObjectIsConstructor):
2749 (JSObjectCallAsConstructor):
2750 (__JSPropertyListEnumerator::__JSPropertyListEnumerator):
2751 (JSObjectCreatePropertyEnumerator):
2752 (JSPropertyEnumeratorGetNext):
2753 (JSPropertyEnumeratorRetain):
2754 (JSPropertyEnumeratorRelease):
2755 (JSPropertyListAdd):
2756 * API/JSObjectRef.h: Added.
2757 * API/JSValueRef.cpp: Added.
2759 (JSValueIsUndefined):
2766 (JSValueIsStrictEqual):
2776 * API/JSValueRef.h: Added.
2777 * API/JavaScriptCore.h: Added.
2778 * API/minidom.c: Added.
2780 * API/minidom.html: Added.
2781 * API/minidom.js: Added.
2782 * API/testapi.c: Added.
2783 (assertEqualsAsBoolean):
2784 (assertEqualsAsNumber):
2785 (assertEqualsAsUTF8String):
2786 (assertEqualsAsCharactersPtr):
2787 (assertEqualsAsCharacters):
2788 (MyObject_initialize):
2789 (MyObject_copyDescription):
2790 (MyObject_hasProperty):
2791 (MyObject_getProperty):
2792 (MyObject_setProperty):
2793 (MyObject_deleteProperty):
2794 (MyObject_getPropertyList):
2795 (MyObject_callAsFunction):
2796 (MyObject_callAsConstructor):
2797 (MyObject_convertToType):
2798 (MyObject_finalize):
2799 (print_callAsFunction):
2801 (createStringWithContentsOfFile):
2802 * API/testapi.js: Added.
2804 * JavaScriptCore.xcodeproj/project.pbxproj:
2805 * bindings/npruntime_impl.h:
2806 * kjs/array_instance.h:
2807 * kjs/array_object.cpp:
2808 (ArrayInstance::getPropertyList):
2809 * kjs/interpreter.cpp:
2810 (KJS::Interpreter::evaluate):
2812 (ForInNode::execute):
2814 (KJS::JSObject::put):
2815 (KJS::JSObject::canPut):
2816 (KJS::JSObject::deleteProperty):
2817 (KJS::JSObject::propertyIsEnumerable):
2818 (KJS::JSObject::getPropertyAttributes):
2819 (KJS::JSObject::getPropertyList):
2821 * kjs/property_map.cpp:
2822 (KJS::PropertyMap::get):
2823 * kjs/property_map.h:
2824 * kjs/scope_chain.cpp:
2825 (KJS::ScopeChain::print):
2826 * kjs/string_object.cpp:
2827 (StringInstance::getPropertyList):
2828 * kjs/string_object.h:
2830 (KJS::UString::Rep::ref):
2832 2006-06-20 Timothy Hatcher <timothy@apple.com>
2836 Make sure we clear the exception before returning so
2837 that future calls will not fail because of an earlier
2838 exception state. Assert on entry that the WebScriptObject
2839 is working with an ExecState that dose not have an exception.
2840 Document that evaluateWebScript and callWebScriptMethod return
2841 WebUndefined when an exception is thrown.
2843 * bindings/objc/WebScriptObject.h:
2844 * bindings/objc/WebScriptObject.mm:
2845 (-[WebScriptObject callWebScriptMethod:withArguments:]):
2846 (-[WebScriptObject evaluateWebScript:]):
2847 (-[WebScriptObject setValue:forKey:]):
2848 (-[WebScriptObject valueForKey:]):
2849 (-[WebScriptObject removeWebScriptKey:]):
2850 (-[WebScriptObject webScriptValueAtIndex:]):
2851 (-[WebScriptObject setWebScriptValueAtIndex:value:]):
2853 2006-06-19 Anders Carlsson <acarlsson@apple.com>
2857 * kjs/interpreter.cpp:
2858 (KJS::TimeoutChecker::pauseTimeoutCheck):
2859 (KJS::TimeoutChecker::resumeTimeoutCheck):
2860 Fix argument order in setitimer calls.
2862 2006-06-18 Anders Carlsson <acarlsson@apple.com>
2866 * kjs/interpreter.cpp:
2867 (KJS::TimeoutChecker::pauseTimeoutCheck):
2868 Do nothing if the timeout check hasn't been started.
2870 (KJS::TimeoutChecker::resumeTimeoutCheck):
2871 Do nothing if the timeout check hasn't been started.
2872 Use the right signal handler when unblocking.
2874 (KJS::Interpreter::handleTimeout):
2875 pause/resume the timeout check around the call to
2876 shouldInterruptScript().
2878 2006-06-16 Ben Goodger <beng@google.com>
2882 http://bugzilla.opendarwin.org/show_bug.cgi?id=9491
2883 Windows build breaks in interpreter.cpp
2885 * kjs/interpreter.cpp
2886 (KJS::TimeoutChecker::pauseTimeoutCheck):
2887 (KJS::TimeoutChecker::resumeTimeoutCheck):
2888 Make sure to only assert equality with s_executingInterpreter when it
2889 is being used (i.e. when HAVE(SYS_TIME_H) == true)
2891 2006-06-17 David Kilzer <ddkilzer@kilzer.net>
2895 http://bugzilla.opendarwin.org/show_bug.cgi?id=9477
2896 REGRESSION: fast/dom/replaceChild.html crashes on WebKit ToT in debug build
2899 (KJS::FunctionImp::callAsFunction): Refetch the debugger after executing the function
2900 in case the WebFrame it was running in has since been destroyed.
2902 2006-06-17 David Kilzer <ddkilzer@kilzer.net>
2906 http://bugzilla.opendarwin.org/show_bug.cgi?id=9476
2907 REGRESSION: Reproducible crash after closing window after viewing
2908 css2.1/t0803-c5501-imrgn-t-00-b-ag.html
2911 (Debugger::detach): Call setDebugger(0) for all interpreters removed from
2912 the 'attached to a debugger' list.
2914 2006-06-17 Anders Carlsson <acarlsson@apple.com>
2916 Reviewed by Maciej and Geoff.
2918 http://bugzilla.opendarwin.org/show_bug.cgi?id=7080
2919 Provide some way to stop a JavaScript infinite loop
2923 Add Interrupted completion type.
2926 (KJS::FunctionImp::callAsFunction):
2927 (KJS::GlobalFuncImp::callAsFunction):
2928 Only set the exception on the new ExecState if the current one has had one.
2930 * kjs/interpreter.cpp:
2931 (KJS::TimeoutChecker::startTimeoutCheck):
2932 (KJS::TimeoutChecker::stopTimeoutCheck):
2933 (KJS::TimeoutChecker::alarmHandler):
2934 (KJS::TimeoutChecker::pauseTimeoutCheck):
2935 (KJS::TimeoutChecker::resumeTimeoutCheck):
2936 New TimeoutChecker class which handles setting Interpreter::m_timedOut flag after a given
2937 period of time. This currently only works on Unix platforms where setitimer and signals are used.
2939 (KJS::Interpreter::Interpreter):
2940 Initialize new member variables.
2942 (KJS::Interpreter::~Interpreter):
2943 Destroy the timeout checker.
2945 (KJS::Interpreter::startTimeoutCheck):
2946 (KJS::Interpreter::stopTimeoutCheck):
2947 (KJS::Interpreter::pauseTimeoutCheck):
2948 (KJS::Interpreter::resumeTimeoutCheck):
2949 Call the timeout checker.
2951 (KJS::Interpreter::handleTimeout):
2952 Called on timeout. Resets the m_timedOut flag and calls shouldInterruptScript.
2954 * kjs/interpreter.h:
2955 (KJS::Interpreter::setTimeoutTime):
2956 New function for setting the timeout time.
2958 (KJS::Interpreter::shouldInterruptScript):
2959 New function. The idea is that this should be overridden by subclasses in order to for example
2960 pop up a dialog asking the user if the script should be interrupted.
2962 (KJS::Interpreter::checkTimeout):
2963 New function which checks the m_timedOut flag and calls handleTimeout if it's set.
2966 (DoWhileNode::execute):
2967 (WhileNode::execute):
2969 Call Interpreter::checkTimeout after each iteration of the loop.
2971 2006-06-15 Timothy Hatcher <timothy@apple.com>
2973 Reviewed by Geoff and Darin.
2975 Prefer the DWARF debugging symbols format for use in Xcode 2.3.
2977 * JavaScriptCore.xcodeproj/project.pbxproj:
2979 2006-06-14 Geoffrey Garen <ggaren@apple.com>
2983 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=9438
2984 Someone broke ToT: cannot build
2986 * JavaScriptCore.xcodeproj/project.pbxproj:
2987 * bindings/runtime_root.h: Changed "Interpreter.h" to "interpreter.h"
2989 2006-06-12 Geoffrey Garen <ggaren@apple.com>
2993 * bindings/objc/WebScriptObject.mm:
2994 (+[WebScriptObject throwException:]): Restore assignment I accidentally
2995 deleted in previous commit
2997 2006-06-12 Geoffrey Garen <ggaren@apple.com>
2999 Reviewed by TimO, Maciej.
3001 - Merged InterpreterImp code into Interpreter, which implements
3002 all interpreter functionality now. This is part of my continuing quest
3003 to create an external notion of JS "execution context" that is unified and simple --
3004 something to replace the mix of Context, ContextImp, ExecState, Interpreter,
3005 InterpreterImp, and JSRun.
3007 All tests pass. Leaks test has not regressed from its baseline ~207 leaks
3008 with ~3460 leaked nodes.
3010 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3011 * JavaScriptCore.xcodeproj/project.pbxproj:
3012 * bindings/NP_jsobject.cpp:
3013 * bindings/objc/WebScriptObject.mm:
3014 (+[WebScriptObject throwException:]):
3015 * bindings/runtime_root.cpp:
3016 * bindings/runtime_root.h:
3018 (KJS::Context::Context):
3019 * kjs/ExecState.cpp: Added.
3020 (KJS::ExecState::lexicalInterpreter):
3021 * kjs/ExecState.h: Added.
3022 (KJS::ExecState::dynamicInterpreter):
3023 * kjs/SavedBuiltins.h: Added.
3024 * kjs/bool_object.cpp:
3025 (BooleanPrototype::BooleanPrototype):
3026 * kjs/collector.cpp:
3027 (KJS::Collector::collect):
3028 (KJS::Collector::numInterpreters):
3034 (KJS::FunctionImp::callAsFunction):
3035 (KJS::GlobalFuncImp::callAsFunction):
3036 * kjs/function_object.cpp:
3037 (FunctionObjectImp::construct):
3040 * kjs/interpreter.cpp:
3041 (KJS::interpreterMap):
3042 (KJS::Interpreter::Interpreter):
3043 (KJS::Interpreter::init):
3044 (KJS::Interpreter::~Interpreter):
3045 (KJS::Interpreter::globalObject):
3046 (KJS::Interpreter::initGlobalObject):
3047 (KJS::Interpreter::globalExec):
3048 (KJS::Interpreter::checkSyntax):
3049 (KJS::Interpreter::evaluate):
3050 (KJS::Interpreter::builtinObject):
3051 (KJS::Interpreter::builtinFunction):
3052 (KJS::Interpreter::builtinArray):
3053 (KJS::Interpreter::builtinBoolean):
3054 (KJS::Interpreter::builtinString):
3055 (KJS::Interpreter::builtinNumber):
3056 (KJS::Interpreter::builtinDate):
3057 (KJS::Interpreter::builtinRegExp):
3058 (KJS::Interpreter::builtinError):
3059 (KJS::Interpreter::builtinObjectPrototype):
3060 (KJS::Interpreter::builtinFunctionPrototype):
3061 (KJS::Interpreter::builtinArrayPrototype):
3062 (KJS::Interpreter::builtinBooleanPrototype):
3063 (KJS::Interpreter::builtinStringPrototype):
3064 (KJS::Interpreter::builtinNumberPrototype):
3065 (KJS::Interpreter::builtinDatePrototype):
3066 (KJS::Interpreter::builtinRegExpPrototype):
3067 (KJS::Interpreter::builtinErrorPrototype):
3068 (KJS::Interpreter::builtinEvalError):
3069 (KJS::Interpreter::builtinRangeError):
3070 (KJS::Interpreter::builtinReferenceError):
3071 (KJS::Interpreter::builtinSyntaxError):
3072 (KJS::Interpreter::builtinTypeError):
3073 (KJS::Interpreter::builtinURIError):
3074 (KJS::Interpreter::builtinEvalErrorPrototype):
3075 (KJS::Interpreter::builtinRangeErrorPrototype):
3076 (KJS::Interpreter::builtinReferenceErrorPrototype):
3077 (KJS::Interpreter::builtinSyntaxErrorPrototype):
3078 (KJS::Interpreter::builtinTypeErrorPrototype):
3079 (KJS::Interpreter::builtinURIErrorPrototype):
3080 (KJS::Interpreter::mark):
3081 (KJS::Interpreter::interpreterWithGlobalObject):
3082 (KJS::Interpreter::saveBuiltins):
3083 (KJS::Interpreter::restoreBuiltins):
3084 * kjs/interpreter.h:
3085 (KJS::Interpreter::setCompatMode):
3086 (KJS::Interpreter::compatMode):
3087 (KJS::Interpreter::firstInterpreter):
3088 (KJS::Interpreter::nextInterpreter):
3089 (KJS::Interpreter::prevInterpreter):
3090 (KJS::Interpreter::debugger):
3091 (KJS::Interpreter::setDebugger):
3092 (KJS::Interpreter::setContext):
3093 (KJS::Interpreter::context):
3095 (StatementNode::hitStatement):
3096 (RegExpNode::evaluate):
3099 2006-06-12 Geoffrey Garen <ggaren@apple.com>
3103 - Have *.lut.h files #include lookup.h to eliminate surprising header
3104 include order dependency.
3106 * DerivedSources.make:
3107 * kjs/array_object.cpp:
3108 * kjs/date_object.cpp:
3109 * kjs/date_object.h:
3110 (KJS::DateProtoFunc::):
3112 * kjs/math_object.cpp:
3113 * kjs/number_object.cpp:
3114 * kjs/regexp_object.cpp:
3115 * kjs/string_object.cpp:
3117 2006-06-10 Geoffrey Garen <ggaren@apple.com>
3119 - http://bugzilla.opendarwin.org/show_bug.cgi?id=8515
3120 Linux porting compile bug
3122 Fix by Mike Emmel, Reviewed by Darin.
3124 * JavaScriptCoreSources.bkl:
3128 2006-06-09 Geoffrey Garen <ggaren@apple.com>
3130 Build fix -- I think :).
3132 * JavaScriptCore.xcodeproj/project.pbxproj:
3135 2006-06-09 Geoffrey Garen <ggaren@apple.com>
3137 Reviewed by Eric (yay!).
3139 - Removed Context wrapper for ContextImp, renamed ContextImp to Context,
3140 split Context into its own file -- Context.cpp -- renamed _var to m_var,
3141 change ' *' to '* '.
3143 * JavaScriptCore.xcodeproj/project.pbxproj:
3144 * kjs/Context.cpp: Added.
3145 (KJS::Context::Context):
3146 (KJS::Context::~Context):
3147 (KJS::Context::mark):
3149 (KJS::Context::scopeChain):
3150 (KJS::Context::variableObject):
3151 (KJS::Context::setVariableObject):
3152 (KJS::Context::thisValue):
3153 (KJS::Context::callingContext):
3154 (KJS::Context::activationObject):
3155 (KJS::Context::currentBody):
3156 (KJS::Context::function):
3157 (KJS::Context::arguments):
3158 (KJS::Context::pushScope):
3159 (KJS::Context::seenLabels):
3161 (KJS::FunctionImp::callAsFunction):
3162 (KJS::FunctionImp::processParameters):
3163 (KJS::FunctionImp::argumentsGetter):
3164 (KJS::GlobalFuncImp::callAsFunction):
3166 (KJS::InterpreterImp::evaluate):
3168 (KJS::InterpreterImp::setContext):
3169 (KJS::InterpreterImp::context):
3170 * kjs/interpreter.cpp:
3171 * kjs/interpreter.h:
3172 (KJS::ExecState::context):
3173 (KJS::ExecState::ExecState):
3177 (ThisNode::evaluate):
3178 (ResolveNode::evaluate):
3179 (FunctionCallResolveNode::evaluate):
3180 (PostfixResolveNode::evaluate):
3181 (DeleteResolveNode::evaluate):
3182 (TypeOfResolveNode::evaluate):
3183 (PrefixResolveNode::evaluate):
3184 (AssignResolveNode::evaluate):
3185 (VarDeclNode::evaluate):
3186 (VarDeclNode::processVarDecls):
3187 (DoWhileNode::execute):
3188 (WhileNode::execute):
3190 (ForInNode::execute):
3191 (ContinueNode::execute):
3192 (BreakNode::execute):
3193 (ReturnNode::execute):
3194 (WithNode::execute):
3195 (SwitchNode::execute):
3196 (LabelNode::execute):
3198 (FuncDeclNode::processFuncDecl):
3199 (FuncExprNode::evaluate):
3201 2006-06-07 Geoffrey Garen <ggaren@apple.com>
3203 Removed API directory I prematurely/accidentally added.
3207 2006-06-05 Mitz Pettel <opendarwin.org@mitzpettel.com>
3209 Reviewed and landed by Geoff.
3211 - fix a regression in ecma_3/String/regress-104375.js
3213 * kjs/string_object.cpp:
3214 (substituteBackreferences): If a 2-digit back reference is out of range,
3215 parse it as a 1-digit reference (followed by the other digit). This matches
3218 2006-06-05 Geoffrey Garen <ggaren@apple.com>
3221 Darin already reviewed this change on the branch. See <rdar://problem/4317701>.
3223 - Fixed <rdar://problem/4291345> PCRE overflow in Safari JavaScriptCore
3225 No test case because there's no behavior change.
3227 * pcre/pcre_compile.c:
3228 (read_repeat_counts): Check for integer overflow / out of bounds
3230 2006-06-05 Geoffrey Garen <ggaren@apple.com>
3234 - Changed CString length from int to size_t. We sould probably do this
3235 for UString, too. (Darin, if you're reading this: Maciej said so.)
3240 (KJS::CString::CString):
3243 (KJS::CString::size):
3245 2006-06-04 Geoffrey Garen <ggaren@apple.com>
3249 - http://bugzilla.opendarwin.org/show_bug.cgi?id=9304
3250 Minor cleanup in JavaScriptCore
3252 * kjs/value.h: Removed redundant declarations
3254 2006-06-04 Darin Adler <darin@apple.com>
3258 - changed deleteAllValues so it can work on "const" collections
3259 Deleting the values affects the values, not the pointers in the
3260 collection, so it's legitimate to do it to a const collection,
3261 and a case of that actually came up in the XPath code.
3264 (WTF::deleteAllPairSeconds): Use const iterators.
3265 (WTF::deleteAllValues): Take const HashMap reference as a parameter.
3267 (WTF::deleteAllValues): Take const HashSet reference as a parameter,
3268 and use const iterators.
3270 (WTF::deleteAllValues): Take const Vector reference as a parameter.
3272 - added more functions that are present in <math.h> on some platforms,
3273 but not on others; moved here from various files in WebCore
3284 2006-06-02 Mitz Pettel <opendarwin.org@mitzpettel.com>
3288 - http://bugzilla.opendarwin.org/show_bug.cgi?id=9234
3289 Implement $&, $' and $` replacement codes in String.prototype.replace
3291 Test: fast/js/string-replace-3.html
3293 * kjs/string_object.cpp:
3294 (substituteBackreferences): Added support for $& (matched substring),
3295 $` (everything preceding matched substring), $' (everything following
3296 matched substring) and 2-digit back references, and cleaned up a little.
3298 2006-06-02 Adele Peterson <adele@apple.com>
3302 Set incremental linking to no. This seems to fix a build problem I was seeing
3303 where dftables couldn't find a dll.
3305 * JavaScriptCore.vcproj/dftables/dftables.vcproj:
3307 2006-05-26 Steve Falkenburg <sfalken@apple.com>
3311 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3313 === JavaScriptCore-521.11 ===
3315 2006-05-24 Geoffrey Garen <ggaren@apple.com>
3319 - JSC half of fix for <rdar://problem/4557926> TOT REGRESSSION: Crash
3320 occurs when attempting to view image in slideshow mode at
3321 http://d.smugmug.com/gallery/581716 ( KJS::IfNode::execute
3322 (KJS::ExecState*) + 312)
3324 On alternate threads, DOMObjects remain in the
3325 ScriptInterpreter's cache because they're not collected. So, they
3326 need an opportunity to mark their children.
3328 I'm not particularly happy with this solution because it fails to
3329 resolve many outstanding issues with the DOM object cache. Since none
3330 of those issues is a crasher or a serious compatibility concern,
3331 and since the behavior of other browsers is not much to go on in this
3332 case, I've filed <rdar://problem/4561439> about that, and I'm moving on
3335 * JavaScriptCore.xcodeproj/project.pbxproj:
3336 * kjs/collector.cpp:
3337 (KJS::Collector::collect):
3339 (KJS::InterpreterImp::mark):
3341 * kjs/interpreter.cpp:
3342 (KJS::Interpreter::mark):
3343 * kjs/interpreter.h:
3345 === JavaScriptCore-521.10 ===
3347 2006-05-22 Timothy Hatcher <timothy@apple.com>
3349 Reviewed by Eric, Kevin and Geoff.
3351 Merge open source build fixes. <rdar://problem/4555500>
3353 * kjs/collector.cpp: look at the rsp register in x86_64
3354 (KJS::Collector::markOtherThreadConservatively):
3355 * wtf/Platform.h: add x86_64 to the platform list
3357 2006-05-19 Anders Carlsson <acarlsson@apple.com>
3361 http://bugzilla.opendarwin.org/show_bug.cgi?id=8993
3362 Support function declaration in case statements
3364 * kjs/grammar.y: Get rid of StatementList and use SourceElements instead.
3367 (CaseClauseNode::evalStatements):
3368 (CaseClauseNode::processVarDecls):
3369 (CaseClauseNode::processFuncDecl):
3370 (ClauseListNode::processFuncDecl):
3371 (CaseBlockNode::processFuncDecl):
3372 (SwitchNode::processFuncDecl):
3374 (KJS::CaseClauseNode::CaseClauseNode):
3375 (KJS::ClauseListNode::ClauseListNode):
3376 (KJS::ClauseListNode::getClause):
3377 (KJS::ClauseListNode::getNext):
3378 (KJS::ClauseListNode::releaseNext):
3379 (KJS::SwitchNode::SwitchNode):
3380 Add processFuncDecl for the relevant nodes.
3382 * kjs/nodes2string.cpp:
3383 (CaseClauseNode::streamTo):
3384 next got renamed to source.
3386 2006-05-17 George Staikos <staikos@kde.org>
3388 Reviewed by Maciej, Alexey, and Eric.
3390 * pcre/pcre_compile.c:
3393 * wtf/UnusedParam.h:
3394 Use /**/ in .c files to compile with non-C99 and non-GCC compilers.
3397 Change include to <wtf/HashTraits.h> from "HashTraits.h" to avoid -I
3399 * wtf/unicode/qt4/UnicodeQt4.h:
3400 Use correct parentheses and correct mask for utf-32 support.
3402 2006-05-17 Alexey Proskuryakov <ap@nypop.com>
3406 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8870
3407 Crash typing in Yahoo auto-complete widget.
3409 Test: fast/js/regexp-stack-overflow.html
3411 * pcre/pcre-config.h: Define NO_RECURSE.
3413 2006-05-16 George Staikos <staikos@kde.org>
3417 Fix some warnings and strict compilation errors.
3422 2006-05-15 Alexey Proskuryakov <ap@nypop.com>
3424 * make-generated-sources.sh: Changed to be executable and removed
3425 text in the file generated by "svn diff".
3427 2006-05-15 Geoffrey Garen <ggaren@apple.com>
3431 - Fixed <rdar://problem/4534904> please do not treat "debugger" as
3432 a reserved word while parsing JavaScript (and other ECMA reserved
3437 http://bugzilla.opendarwin.org/show_bug.cgi?id=6179
3438 We treat "char" as a reserved word in JavaScript and firefox/IE do
3441 (1) I unreserved most of the spec's "future reserved words" because
3442 they're not reserved in IE or FF. (Most, but not all, because IE
3443 somewhat randomly *does* reserve a few of them.)
3444 (2) I made 'debugger' a legitimate statement that acts like an empty
3445 statement because FF and IE support it.
3448 * kjs/keywords.table:
3450 2006-05-15 Tim Omernick <timo@apple.com>
3452 Reviewed by John Sullivan.
3454 Part of <rdar://problem/4466508> Add 64-bit support to the Netscape Plugin API
3456 Added to the Netscape Plugin API the concept of "plugin drawing models". The drawing model
3457 determines the kind of graphics context created by the browser for the plugin, as well as
3458 the Mac types of various Netscape Plugin API data structures.
3460 There is a drawing model to represent the old QuickDraw-based API. It is used by default
3461 if QuickDraw is available on the system, unless the plugin specifies another drawing model.
3463 The big change is the addition of the CoreGraphics drawing model. A plugin may request this
3464 drawing model to obtain access to a CGContextRef for drawing, instead of a QuickDraw CGrafPtr.
3467 Define NP_NO_QUICKDRAW when compiling 64-bit; there is no 64-bit QuickDraw.
3468 Added NPNVpluginDrawingModel, NPNVsupportsQuickDrawBool, and NPNVsupportsCoreGraphicsBool
3470 Added NPDrawingModel enumeration. Currently the only drawing models are QuickDraw and
3472 NPRegion's type now depends on the drawing model specified by the plugin.
3473 NP_Port is now only defined when QuickDraw is available.
3474 Added NP_CGContext, which is the type of the NPWindow's "window" member in CoreGraphics mode.
3476 2006-05-13 Kevin M. Ollivier <kevino@theolliviers.com>
3478 Reviewed by Darin, landed by ap.
3480 - http://bugzilla.opendarwin.org/show_bug.cgi?id=8528
3481 Bakefiles (and generated Makefiles) for wx and gdk ports
3483 * make-generated-sources.sh:
3484 Added script to configure environment to run DerivedSources.make
3486 * JavaScriptCoreSources.bkl:
3487 Added JavaScriptCore sources list for Bakefile.
3490 Bakefile used to generate JavaScriptCore project files
3491 (currently only used by wx and gdk ports)
3493 2006-05-09 Steve Falkenburg <sfalken@apple.com>
3496 Minor fixes to WTF headers.
3500 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Fix include dirs, paths to files.
3501 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj: Fix include dirs.
3502 * wtf/Assertions.h: include Platform.h to get definition for COMPILER()
3503 * wtf/Vector.h: include FastMalloc.h for definition of fastMalloc, fastFree
3505 2006-05-09 Maciej Stachowiak <mjs@apple.com>
3507 Rubber stamped by Anders.
3509 - renamed kxmlcore to wtf
3515 * JavaScriptCore.xcodeproj/project.pbxproj:
3516 * bindings/c/c_instance.cpp:
3517 * bindings/objc/WebScriptObject.mm:
3518 * kjs/JSImmediate.h:
3521 * kjs/array_object.cpp:
3522 * kjs/collector.cpp:
3523 (KJS::Collector::registerThread):
3527 (KJS::isStrWhiteSpace):
3529 * kjs/identifier.cpp:
3534 (Lexer::isWhiteSpace):
3535 (Lexer::isIdentStart):
3536 (Lexer::isIdentPart):
3540 * kjs/number_object.cpp:
3542 * kjs/property_map.cpp:
3543 * kjs/property_map.h:
3544 * kjs/string_object.cpp:
3545 (StringProtoFunc::callAsFunction):
3550 * kxmlcore: Removed.
3551 * kxmlcore/AlwaysInline.h: Removed.
3552 * kxmlcore/Assertions.cpp: Removed.