1 2006-11-19 Simon Hausmann <hausmann@kde.org>
5 http://bugs.webkit.org/show_bug.cgi?id=11649
6 Fix CMake Qt-only build without KDE CMake files
11 2006-11-17 Anders Carlsson <acarlsson@apple.com>
15 Make sure that we always use std::min and std::max instead of macros.
17 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
23 2006-11-12 Geoffrey Garen <ggaren@apple.com>
25 Reviewed by Beth Dakin.
27 Added project-wide setting to disable Microsoft's made-up deprecation
28 warnings related to std:: functions. (Doesn't have any affect yet,
29 since we currently disable all deprecation warnings.)
31 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
33 2006-11-12 Mark Rowe <bdash@webkit.org>
37 Clean up of JavaScriptCore bakefiles.
39 * JavaScriptCoreSources.bkl:
42 2006-11-11 Alexey Proskuryakov <ap@webkit.org>
46 http://bugs.webkit.org/show_bug.cgi?id=11508
47 Undisable some warnings for JSImmediate.h
49 Fix suggested by Don Gibson.
52 Re-enable all MSVC warnings, move the remaining runtime checks
55 2006-11-10 Zalan Bujtas <zalan.bujtas@nokia.com>
59 Added s60/symbian platform defines.
60 http://bugs.webkit.org/show_bug.cgi?id=11540
66 2006-11-08 Ada Chan <adachan@apple.com>
70 Added a method to delete all the keys in a HashMap.
73 (WTF::deleteAllPairFirsts):
76 2006-11-07 Anders Carlsson <acarlsson@apple.com>
81 (OpaqueJSClass::OpaqueJSClass):
82 Initialize cachedPrototype to 0.
84 2006-11-06 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
88 Remove warning about garbage after #else. #else clause applies for all
89 non-mac platforms, not only win.
91 * kjs/date_object.cpp:
93 2006-11-06 Mark Rowe <bdash@webkit.org>
95 Reviewed by the wonderful Mitz Pettel.
97 http://bugs.webkit.org/show_bug.cgi?id=11524
98 Bug 11524: REGRESSION(r9842): Array.prototype.join should use ToString operator rather than calling toString on each element
100 * kjs/array_object.cpp:
101 (ArrayProtoFunc::callAsFunction): Use ToString operator on each element rather than calling their toString method.
103 2006-11-03 Steve Falkenburg <sfalken@apple.com>
109 2006-11-03 Alexey Proskuryakov <ap@nypop.com>
113 http://bugs.webkit.org/show_bug.cgi?id=11504
114 Fix warnings on non 32 bit platforms
117 (KJS::JSImmediate::NanAsBits):
118 (KJS::JSImmediate::oneAsBits):
119 Rewrite in a way that moves runtime checks to compile-time.
122 (KJS::JSImmediate::fromDouble):
123 (KJS::JSImmediate::toDouble):
125 2006-11-02 George Staikos <staikos@kde.org>
130 Remove a deprecated pthreads call.
132 2006-11-02 Anders Carlsson <acarlsson@apple.com>
134 Reviewed by Maciej, landed by Anders.
137 Make KDE support optional.
139 2006-11-01 Kevin McCullough <KMcCullough@apple.com>
143 - Fixes many JavaScriptCore tests in other timezones. The root problem is that on mac localtime() returns historically accurate information for DST, but the JavaScript spec explicitly states to not take into account historical information but rather to interpolate from valid years.
146 (KJS::equivalentYearForDST):
147 (KJS::getDSTOffsetSimple):
150 2006-10-31 Geoffrey Garen <ggaren@apple.com>
154 Fixed http://bugs.webkit.org/show_bug.cgi?id=11477
155 REGRESSION: GMail crashes in KJS::FunctionImp::callerGetter
158 (KJS::FunctionImp::argumentsGetter): Removed unnecessary braces.
159 (KJS::FunctionImp::callerGetter): More logical NULL checking.
161 2006-10-31 Oliver Hunt <oliver@apple.com>
165 Adding definition for PLATFORM(CI)
169 2006-10-31 Vladimir Olexa <vladimir.olexa@gmail.com>
173 http://bugs.webkit.org/show_bug.cgi?id=4166
174 Function object does not support caller property
176 Test: fast/js/caller-property.html
179 (KJS::FunctionImp::callerGetter): added
180 (KJS::FunctionImp::getOwnPropertySlot): added if statement to handle callerGetter()
181 * kjs/function.h: added callerGetter() declaration
182 * kjs/identifier.h: added caller property macro
183 * tests/mozilla/expected.html:
185 2006-10-30 Kevin McCullough <KMcCullough@apple.com>
189 - Fix some timezone issues and JavaScriptCore date tests. Addresses bugzilla 4930.
192 (KJS::GregorianDateTime::GregorianDateTime): Here's the fix, to add parenthesis for order of precedence.
193 * kjs/date_object.cpp:
194 (KJS::DateProtoFunc::callAsFunction):
195 (KJS::DateObjectImp::construct): memset not needed as GregorianDateTime initializes itself.
197 2006-10-30 Darin Adler <darin@apple.com>
199 Reviewed by John Sullivan.
201 * kjs/SavedBuiltins.h: Added needed include.
202 * wtf/OwnPtr.h: (WTF::OwnPtr::set): Fixed mistake in assertion.
204 2006-10-28 Darin Adler <darin@apple.com>
208 - renamed PassRefPtr::release to releaseRef to make it clearer that
209 it's the counterpart of adoptRef, and to make it harder to confuse
210 it with the safer-to-use RefPtr::release
212 * kjs/identifier.cpp:
213 (KJS::CStringTranslator::translate):
214 (KJS::UCharBufferTranslator::translate):
216 (KJS::UString::Rep::create):
218 (WTF::PassRefPtr::PassRefPtr):
219 (WTF::PassRefPtr::~PassRefPtr):
220 (WTF::PassRefPtr::get):
221 (WTF::PassRefPtr::releaseRef):
222 (WTF::PassRefPtr::operator->):
223 (WTF::PassRefPtr::operator=):
225 (WTF::static_pointer_cast):
226 (WTF::const_pointer_cast):
228 (WTF::RefPtr::RefPtr):
229 (WTF::RefPtr::operator=):
231 2006-10-28 Darin Adler <darin@apple.com>
235 * kjs/grammar.y: Add definitions of YYMALLOC and YYFREE to fix
236 a warning some people see (not sure why others don't see it).
238 * JavaScriptCore.vcproj/JavaScriptCore/grammarWrapper.cpp: Touch
239 this file to force it to re-build grammar.cpp.
241 2006-10-28 Darin Adler <darin@apple.com>
245 - made changes so the code compiles with the highest warning level
246 under MSVC (disabling some warnings, making some code fixes)
248 * API/JSCallbackConstructor.cpp:
249 (KJS::JSCallbackConstructor::construct):
250 * API/JSCallbackFunction.cpp:
251 (KJS::JSCallbackFunction::callAsFunction):
252 * API/JSCallbackObject.cpp:
253 (KJS::JSCallbackObject::init):
254 (KJS::JSCallbackObject::construct):
255 (KJS::JSCallbackObject::callAsFunction):
256 * API/JSObjectRef.cpp:
257 (JSPropertyNameArrayGetNameAtIndex):
258 * API/JSStringRef.cpp:
259 (JSStringCreateWithCharacters):
260 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
261 * bindings/c/c_utility.cpp:
262 (KJS::Bindings::convertUTF8ToUTF16):
263 (KJS::Bindings::coerceValueToNPVariantStringType):
264 (KJS::Bindings::convertValueToNPVariant):
266 (KJS::GregorianDateTime::GregorianDateTime):
268 (KJS::ExecState::hadException):
270 (KJS::JSImmediate::fromDouble):
271 (KJS::JSImmediate::toDouble):
272 (KJS::JSImmediate::NanAsBits):
273 (KJS::JSImmediate::oneAsBits):
275 * kjs/PropertyNameArray.h:
276 (KJS::PropertyNameArray::size):
277 * kjs/array_object.cpp:
278 (ArrayObjectImp::callAsFunction):
279 * kjs/bool_object.cpp:
280 (BooleanObjectImp::callAsFunction):
282 (KJS::Collector::allocate):
283 (KJS::Collector::markCurrentThreadConservatively):
284 (KJS::Collector::collect):
286 (KJS::Completion::isValueCompletion):
287 * kjs/date_object.cpp:
290 (Debugger::sourceParsed):
291 (Debugger::sourceUnused):
292 (Debugger::exception):
293 (Debugger::atStatement):
294 (Debugger::callEvent):
295 (Debugger::returnEvent):
297 * kjs/error_object.cpp:
298 (ErrorObjectImp::callAsFunction):
299 (NativeErrorImp::callAsFunction):
301 (KJS::FunctionImp::processVarDecls):
302 (KJS::GlobalFuncImp::callAsFunction):
303 * kjs/function_object.cpp:
304 (FunctionPrototype::callAsFunction):
306 * kjs/identifier.cpp:
307 (KJS::CStringTranslator::translate):
308 (KJS::Identifier::add):
312 (Lexer::isIdentStart):
313 (Lexer::isIdentPart):
316 (Lexer::isOctalDigit):
317 (Lexer::matchPunctuator):
318 (Lexer::singleEscape):
319 (Lexer::convertOctal):
321 (Lexer::convertUnicode):
324 * kjs/math_object.cpp:
325 (MathFuncImp::callAsFunction):
326 * kjs/number_object.cpp:
327 (integer_part_noexp):
329 (NumberProtoFunc::callAsFunction):
330 (NumberObjectImp::callAsFunction):
332 (KJS::JSObject::deleteProperty):
333 (KJS::JSObject::callAsFunction):
334 (KJS::JSObject::toBoolean):
335 (KJS::JSObject::toObject):
337 (KJS::JSObject::getPropertySlot):
338 * kjs/property_map.cpp:
340 (KJS::PropertyMap::put):
341 (KJS::PropertyMap::insert):
342 (KJS::PropertyMap::containsGettersOrSetters):
343 * kjs/property_map.h:
344 (KJS::PropertyMap::hasGetterSetterProperties):
345 * kjs/property_slot.h:
346 * kjs/string_object.cpp:
347 (StringInstance::getPropertyNames):
348 (StringObjectImp::callAsFunction):
349 (StringObjectFuncImp::callAsFunction):
351 (KJS::UString::Rep::computeHash):
352 (KJS::UString::UString):
353 (KJS::UString::from):
354 (KJS::UString::append):
355 (KJS::UString::ascii):
356 (KJS::UString::operator=):
357 (KJS::UString::find):
358 (KJS::UString::rfind):
362 (KJS::UCharReference::low):
363 (KJS::UCharReference::high):
365 (KJS::JSValue::toUInt16):
367 * pcre/pcre_compile.c:
368 (get_othercase_range):
371 * pcre/pcre_internal.h:
372 * wtf/HashFunctions.h:
374 (WTF::PtrHash::hash):
379 * wtf/StringExtras.h:
381 * wtf/unicode/icu/UnicodeIcu.h:
382 (WTF::Unicode::isPrintableChar):
384 2006-10-26 W. Andy Carrel <wac@google.com>
388 - Fix http://bugs.webkit.org/show_bug.cgi?id=7445 /
389 <rdar://problem/4614195> (and 7253 / <rdar://4694011>) by changing
390 inline regexps so that they can have \u escaped Unicode sequences and
396 (Lexer::shift): Looking ahead one additional character for the benefit
398 (Lexer::scanRegExp): Change code to support unicode escapes in inline
400 * kjs/lexer.h: Extra lookahead added.
402 === Safari-521.29 ===
404 2006-10-26 Nikolas Zimmermann <zimmermann@kde.org>
408 Fix build with older gcc 3.3.4.
410 * kjs/DateMath.cpp: Remove inline prefix.
411 (KJS::equivalentYearForDST):
413 2006-10-26 Darin Adler <darin@apple.com>
417 - fix iteration of properties of string objects (found because of a warning
418 emitted by the MSVC compiler)
420 * kjs/string_object.cpp: (StringInstance::getPropertyNames): Change code that
421 wants to format a number as a string to use UString::from. Before it was using
422 the UString constructor that makes a string from a character!
425 * kjs/ustring.cpp: Remove the dangerous and not all that helpful UString(char)
428 * kjs/grammar.y: Change code to not depend on the UString(char) constructor.
429 This is potentially more efficient anyway because we could overload the + operator
430 some day to handle char* directly instead of creating a UString.
432 * kjs/nodes2string.cpp: (SourceStream::operator<<): Change code to not depend on
433 the UString(char) constructor.
435 2006-10-25 Kevin McCullough <KMcCullough@apple.com>
437 Reviewed by Steve (rubber stamp).
439 - Link against your local build of JavaScriptCore.lib first, this fixes some errors on release builds of testkjs.
441 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
443 2006-10-25 Geoffrey Garen <ggaren@apple.com>
447 Removed duplicate symbol declaration.
449 * JavaScriptCore.xcodeproj/project.pbxproj:
452 2006-10-24 Steve Falkenburg <sfalken@apple.com>
456 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
458 2006-10-24 Kevin McCullough <KMcCullough@apple.com>
462 - Fixes a date formatting issue on win. Specifically strftime cannot handle some ranges of time so we shift time call strftime and then manipulate the returned string, if needed.
464 * kjs/date_object.cpp:
466 (KJS::formatLocaleDate):
467 (KJS::DateProtoFunc::callAsFunction):
469 2006-10-23 Kevin McCullough <KMcCullough@apple.com>
475 * JavaScriptCore.xcodeproj/project.pbxproj:
478 2006-10-23 Kevin McCullough <KMcCullough@apple.com>
482 - Makes the toTM function an operator. Was going to piggy back on a patch but the patch needs more work.
485 (KJS::equivalentYearForDST):
487 (KJS::GregorianDateTime::operator tm):
488 * kjs/date_object.cpp:
490 (KJS::DateProtoFunc::callAsFunction):
492 2006-10-23 Kevin McCullough <KMcCullough@apple.com>
496 - Fixes two regressions on win. Both are stack overflows. For one the number of recursions is capped at 100, and for the other, nested parenthesis pairs are not evaluated (since they would evaluate to whatever is in them anyway).
501 2006-10-21 Steve Falkenburg <sfalken@apple.com>
505 Add minimal compatibility with MSVCRT leak checker
509 2006-10-23 Kevin McCullough <KMcCullough@apple.com>
513 - Sets the lowercase range correctly in the test and consolidates a variable to make the test more readable.
515 * tests/mozilla/ecma/String/15.5.4.11-2.js:
517 2006-10-21 Darin Adler <darin@apple.com>
521 - http://bugs.webkit.org/show_bug.cgi?id=11377
522 swap(Vector, Vector) should be O(1) instead of O(n)
525 (WTF::VectorBuffer::swap): Added.
526 (WTF::Vector::swap): Added.
527 (WTF::swap): Added overload that takes two Vector objects.
529 2006-10-21 Darin Adler <darin@apple.com>
533 - http://bugs.webkit.org/show_bug.cgi?id=11376
534 build scripts should invoke make with "-j" option for multiple processors
536 * JavaScriptCore.xcodeproj/project.pbxproj: Pass -j `sysctl -n hw.ncpu` to make.
538 2006-10-19 Kevin McCullough <KMcCullough@apple.com>
542 Changed test to make us pass Georgian case changing for Unicode 4.0 and 5.0. This incorporates changes from the 1.4 revision of the same mozilla test.
543 On Tiger we are still using Unicode 4.0 but on win and Leopard we are using Unicode 5.0, so this test currently allows for either answer.
545 * tests/mozilla/ecma/String/15.5.4.11-2.js:
547 2006-10-18 Maciej Stachowiak <mjs@apple.com>
551 - remove vestiges of KXMLCore name (former name of WTF).
559 * wtf/FastMallocInternal.h:
562 * wtf/HashCountedSet.h:
563 * wtf/HashFunctions.h:
576 * wtf/StringExtras.h:
580 * wtf/VectorTraits.h:
582 2006-10-17 Steve Falkenburg <sfalken@apple.com>
588 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
590 2006-10-17 Kevin McCullough <KMcCullough@apple.com>
594 Fixed a date issue where the UTC offset was not set in win.
597 (KJS::getDSTOffsetSimple):
599 (KJS::msToGregorianDateTime):
602 (KJS::GregorianDateTime::GregorianDateTime):
604 2006-10-17 Kevin McCullough <KMcCullough@apple.com>
608 Fixes a JavaScriptCore math issue on win.
610 * kjs/math_object.cpp:
611 (MathFuncImp::callAsFunction):
615 2006-10-16 Kevin McCullough <kmccullough@apple.com>
619 Removed unecessary global specifiers.
621 * kjs/math_object.cpp:
622 (MathFuncImp::callAsFunction):
624 2006-10-16 Kevin McCullough <KMcCullough@apple.com>
628 Fixes a compile order issue for testkjs on win.
630 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
632 2006-10-15 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
636 Remove junk (as gcc calls it) after #else clause.
638 * wtf/FastMalloc.cpp:
641 2006-10-14 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
645 Define KXMLCORE_USE_CURL for platforms that wish to use CURL as
646 networking, and set it for GDK build
650 2006-10-13 Marvin Decker <marv.decker@gmail.com>
652 Reviewed by Kevin McCullough.
654 Fixes http://bugs.webkit.org/show_bug.cgi?id=11283
655 Fixes Qt/Linux and Windows build
659 * kjs/date_object.cpp:
660 (KJS::DateProtoFunc::callAsFunction):
662 2006-10-13 Kevin McCullough <KMcCullough@apple.com>
664 Reviewed by Adam, Geoff, Darin.
666 Fixed displaying the UTC offset and time zone string, as well as renamed the GregorianDateTime structure and clean up.
671 (KJS::getDSTOffsetSimple):
672 (KJS::gregorianDateTimeToMS):
673 (KJS::msToGregorianDateTime):
675 (KJS::GregorianDateTime::GregorianDateTime):
676 (KJS::GregorianDateTime::~GregorianDateTime):
677 (KJS::GregorianDateTime::toTM):
678 * kjs/date_object.cpp:
681 (KJS::formatDateUTCVariant):
683 (KJS::fillStructuresUsingTimeArgs):
684 (KJS::fillStructuresUsingDateArgs):
685 (KJS::DateInstance::getTime):
686 (KJS::DateInstance::getUTCTime):
687 (KJS::DateProtoFunc::callAsFunction):
688 (KJS::DateObjectImp::construct):
689 (KJS::DateObjectImp::callAsFunction):
690 (KJS::DateObjectFuncImp::callAsFunction):
694 2006-10-13 Kevin McCullough <KMcCullough@apple.com>
698 Gets JavaScripCore tests running on windows.
700 * Scripts/run-javascriptcore-tests:
701 * Scripts/webkitdirs.pm:
703 2006-10-12 Geoffrey Garen <ggaren@apple.com>
707 Removed JSObjectMakeWithPrototype, clarified some comments. We really
708 don't want people to manage their own prototypes, so we don't want an
709 extra function in the API devoted to just that. People can still manage
710 their own prototypes if they really want by using JSObjectSetPrototype.
712 * API/JSClassRef.cpp:
713 (OpaqueJSClass::createNoAutomaticPrototype):
714 (OpaqueJSClass::create):
716 * API/JSObjectRef.cpp:
722 * JavaScriptCore.exp:
724 2006-10-12 Kevin McCullough <KMcCullough@apple.com>
732 * kjs/date_object.cpp:
735 2006-10-11 Kevin McCullough <KMcCullough@apple.com>
739 Added our own tm struct to have a consistent set of fields, which lets us display the DST offset and timezone strings correctly. Also there is some code cleanup.
744 (KJS::getDSTOffsetSimple):
750 * kjs/date_object.cpp:
753 (KJS::DateProtoFunc::callAsFunction):
754 (KJS::DateObjectImp::construct):
755 (KJS::DateObjectImp::callAsFunction):
756 (KJS::DateObjectFuncImp::callAsFunction):
760 2006-10-09 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
764 Improve gdk build compiler flags (show warning, no rtti and exceptions).
768 2006-10-06 Kevin McCullough <KMcCullough@apple.com>
772 DST and TimeZones were wrong in some cases, specifically on some of the dates where DST changes.
775 (KJS::equivalentYearForDST):
777 (KJS::getDSTOffsetSimple):
779 (KJS::dateToMseconds):
782 * kjs/date_object.cpp:
785 2006-10-05 Darin Adler <darin@apple.com>
787 Reviewed by Kevin McCullough.
789 * wtf/Assertions.cpp: Fix build when _DEBUG is not defined.
791 2006-10-04 Kevin McCullough <KMcCullough@apple.com>
795 - Removed an unnecessary assert that was stopping many pages. tm_gmtoff was not set for UTC time in mozilla but is always set for us.
800 * kjs/date_object.cpp:
804 2006-10-04 Geoffrey Garen <ggaren@apple.com>
806 Patch by Darin and me, reviewed by Maciej.
808 Fixed <rdar://problem/4518397> REGRESSION(?): Oft-seen but unrepro crash
809 in JavaScript garbage collection (KJS::Collector::collect())
810 <rdar://problem/4752492> Crash in KJS::collect
812 The issue here was allocating one garbage-collected object in the midst
813 of allocating a second garbage-collected object. In such a case, the
814 zeroIfFree word lies.
817 (KJS::Collector::allocate):
818 (KJS::Collector::collect):
820 2006-10-04 Kevin McCullough <KMcCullough@apple.com>
827 (KJS::dateToDayInYear): accept and correctly handle negative months
829 2006-10-05 Kevin McCullough <KMcCullough@apple.com>
834 (KJS::dateToDayInYear):
836 2006-10-05 Mark Rowe <bdash@webkit.org>
838 Reviewed by maculloch.
842 * JavaScriptCoreSources.bkl: Add DateMath.cpp to file list.
844 2006-10-05 Kevin McCullough <KMcCullough@apple.com>
850 * JavaScriptCore.xcodeproj/project.pbxproj:
852 2006-10-04 Nikolas Zimmermann <zimmermann@kde.org>
856 Fix Qt/Linux build by adding DateMath.cpp to compilation.
858 * CMakeLists.txt: Also replace tabs with spaces.
860 2006-10-04 Kevin McCullough <KMcCullough@apple.com>
862 Reviewed by DethBakin.
864 - Apparently the build bot uses an older version of XCode which warns about conversions and the newest version does not. I hope this fixes the build but I cann't be sure on my system.
869 (KJS::dateToDayInYear):
871 2006-10-05 Darin Adler <darin@apple.com>
875 * wtf/Assertions.cpp: Changed assertion formatting to omit the "======"
876 lines so you can see more assertions in less space. Also improved format
877 of file/line information so it works with more development environments.
879 2006-10-04 Kevin McCullough <KMcCullough@apple.com>
883 - The build machine is more sensitive about automatic conversions. These fixes exp
884 licitly cast or change the input and return types of functions to avoid conversions.
886 * JavaScriptCore.xcodeproj/project.pbxproj:
892 (KJS::monthToDayInYear):
893 (KJS::dateToDayInYear):
894 (KJS::getDSTOffsetSimple):
896 (KJS::dateToMseconds):
899 2006-10-04 Kevin McCullough <KMcCullough@apple.com>
903 - This is a big makeover for our Date implemenetation. This solves many platform specific issues, specifically dates before 1970, and simplifies some ugly code. The purpose of this was to get us to pass many of the JavaScriptCore tests on windows.
905 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
906 * JavaScriptCore.xcodeproj/project.pbxproj:
907 * kjs/DateMath.cpp: Added.
910 (KJS::daysFrom1970ToYear):
911 (KJS::msFrom1970ToYear):
917 (KJS::msToMilliseconds):
923 (KJS::msToDayInMonth):
924 (KJS::monthToDayInYear):
925 (KJS::timeToMseconds):
926 (KJS::dateToDayInYear):
927 (KJS::equivalentYearForDST):
929 (KJS::getDSTOffsetSimple):
931 (KJS::localTimeToUTC):
932 (KJS::UTCToLocalTime):
933 (KJS::dateToMseconds):
936 * kjs/DateMath.h: Added.
938 * kjs/date_object.cpp:
941 (KJS::DateInstance::getTime):
942 (KJS::DateInstance::getUTCTime):
943 (KJS::DateProtoFunc::callAsFunction):
944 (KJS::DateObjectImp::construct):
945 (KJS::DateObjectFuncImp::callAsFunction):
950 2006-10-02 Nikolas Zimmermann <zimmermann@kde.org>
952 Reviewed/landed by Adam.
954 Build testkjs on Qt/Linux.
958 2006-10-02 Nikolas Zimmermann <zimmermann@kde.org>
960 Reviewed by eseidel. Landed by eseidel.
962 Fix win32 build, which has no inttypes.h
966 2006-10-02 Nikolas Zimmermann <zimmermann@kde.org>
968 Reviewed by eseidel & mjs. Landed by eseidel.
970 Fix Qt/Linux build with older gcc 3.3.4.
971 http://bugs.webkit.org/show_bug.cgi?id=11116
973 * kjs/lookup.h: Move cacheGlobalObject into KJS namespace.
974 (KJS::cacheGlobalObject): Also remove GCC_ROOT_NS_HACK.
975 * wtf/Assertions.h: Include inttypes.h for uintptr_t.
977 2006-09-28 Steve Falkenburg <sfalken@apple.com>
981 Use $(ConfigSuffix) set via vsprops files to add _debug
982 to end of debug filenames.
984 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
985 * JavaScriptCore.vcproj/debug.vsprops: Added.
986 * JavaScriptCore.vcproj/dftables/dftables.vcproj:
987 * JavaScriptCore.vcproj/release.vsprops: Added.
988 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
990 2006-09-28 Darin Adler <darin@apple.com>
994 - support for change that should fix <rdar://problem/4733044>
995 REGRESSION: XML iBench shows 10% perf. regression (copying
996 strings while decoding)
998 * wtf/Vector.h: Changed VectorBuffer so that the general case
999 contains an instance of the 0 case, since deriving from it
1000 was violating the Liskov Substitution Principle.
1001 (WTF::VectorBuffer::releaseBuffer): Added. Releases the buffer so it can
1002 be adopted by another data structure that uses the FastMalloc.h allocator.
1003 Returns 0 if the internal buffer was being used.
1004 (WTF::Vector::releaseBuffer): Added. Releases the buffer as above or creates
1005 a new one in the case where the internal buffer was being used.
1007 2006-09-28 Maciej Stachowiak <mjs@apple.com>
1011 - change garbage collection to happen at increments proportional to number of live objects, not always
1012 every 1000 allocations
1014 * kjs/collector.cpp:
1015 (KJS::Collector::allocate):
1017 2006-09-28 Maciej Stachowiak <mjs@apple.com>
1021 - fixed REGRESSION (r16606): javascriptCore Crash on website load
1025 - fixed some possible off-by-one bugs
1026 - use indexing, not iterators, for Vectors
1027 - store Vector by pointer instead of by value to avoid blowing out FunctionImp size
1030 (KJS::FunctionImp::addParameter):
1031 (KJS::FunctionImp::parameterString):
1032 (KJS::FunctionImp::processParameters):
1033 (KJS::FunctionImp::lengthGetter):
1034 (KJS::FunctionImp::getParameterName):
1037 2006-09-27 Steve Falkenburg <sfalken@apple.com>
1043 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1044 * JavaScriptCore.vcproj/JavaScriptCore/dstroot-to-sdk.cmd: Removed.
1046 2006-09-27 John Sullivan <sullivan@apple.com>
1049 (KJS::FunctionImp::getParameterName):
1050 removed assertion that displeased gcc 4.0.1 (build 5420):
1051 ASSERT(static_cast<size_t>(index) == index);
1053 2006-09-27 Kevin McCullough <KMcCullough@apple.com>
1057 Cleanup of previous fix which was to address Radar: 4752492
1060 (KJS::FunctionImp::addParameter):
1061 (KJS::FunctionImp::parameterString):
1062 (KJS::FunctionImp::processParameters):
1063 (KJS::FunctionImp::lengthGetter):
1064 (KJS::FunctionImp::getParameterName):
1067 2006-09-27 Kevin McCullough <KMcCullough@apple.com>
1071 Fixes a GC stack overflow crash.
1072 The change is to move from a linked list implementation of Parameters to a Vector.
1073 The problem with the linked list is that each one creates it's own stack frame when being destroyed and in extreme cases this caused the stack to overflow.
1076 (KJS::Parameter::Parameter):
1077 (KJS::FunctionImp::addParameter):
1078 (KJS::FunctionImp::parameterString):
1079 (KJS::FunctionImp::processParameters):
1080 (KJS::FunctionImp::lengthGetter):
1081 (KJS::FunctionImp::getParameterName):
1084 2006-09-27 Steve Falkenburg <sfalken@apple.com>
1088 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1090 2006-09-27 Steve Falkenburg <sfalken@apple.com>
1092 Set path before build.
1094 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1096 2006-09-27 Sean Gies <seangies@apple.com>
1098 Reviewed by Adam Roben.
1100 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Debug config should link to debug runtime.
1101 * JavaScriptCore.vcproj/dftables/dftables.vcproj: Debug config should link to debug runtime.
1103 2006-09-27 Don Melton <gramps@apple.com>
1105 Reviewed by Adam Roben.
1107 Changed line ending from DOS to UNIX format so it doesn't die running
1110 * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
1112 2006-09-23 Alexey Proskuryakov <ap@nypop.com>
1116 http://bugs.webkit.org/show_bug.cgi?id=10183
1117 REGRESSION: obfuscated JS decoding breaks because of soft hyphen removal
1118 (Fanfiction.net author pages not listing stories)
1120 Rolled out the fix for bug 4139.
1125 * tests/mozilla/ecma/Array/15.4.5.1-1.js:
1126 * tests/mozilla/expected.html:
1128 2006-09-22 Steve Falkenburg <sfalken@apple.com>
1132 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1134 2006-09-22 Darin Adler <darin@apple.com>
1138 * wtf/Vector.h: Add an append that takes a pointer and length.
1139 Generalize the existing Vector append to work on vectors with
1140 any value for inlineCapacity. Change the append algorithm so
1141 it doesn't check capacity each time through the loop.
1143 2006-09-22 Steve Falkenburg <sfalken@apple.com>
1147 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1149 2006-09-21 Geoffrey Garen <ggaren@apple.com>
1153 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1154 Updated to include the right path.
1155 * wtf/FastMalloc.h: #include Platform.h, since we use Platform macros.
1157 === Safari-521.27 ===
1159 2006-09-20 Anders Carlsson <acarlsson@apple.com>
1161 Reviewed by Dave Hyatt.
1166 2006-09-20 Sean Gies <seangies@apple.com>
1168 Reviewed by Steve Falkenburg.
1170 * wtf/Assertions.cpp: Debug messages should go into debugger console.
1172 2006-09-20 David Hyatt <hyatt@apple.com>
1174 Add an implementation of lrint for Win32.
1181 2006-09-15 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
1185 http://bugs.webkit.org/show_bug.cgi?id=10864
1186 Bug 10864: Linux\GDK build fixes
1188 * JavaScriptCoreSources.bkl:
1191 2006-09-15 Adam Roben <aroben@apple.com>
1195 * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
1197 2006-09-15 Anders Carlsson <acarlsson@apple.com>
1199 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1200 Fix the release build.
1202 2006-09-15 Anders Carlsson <acarlsson@apple.com>
1206 Add JavaScriptCore API to the build.
1208 * API/JSCallbackConstructor.cpp:
1209 * API/JSCallbackFunction.cpp:
1210 * API/JSCallbackObject.cpp:
1211 * API/JSClassRef.cpp:
1212 * API/JSContextRef.cpp:
1213 * API/JSObjectRef.cpp:
1214 * API/JSStringRef.cpp:
1215 * API/JSValueRef.cpp:
1216 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1217 * os-win32/stdbool.h: Added.
1219 2006-09-12 Steve Falkenburg <sfalken@apple.com>
1223 Build tweaks (doing JavaScriptCore now since it doesn't have
1226 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1227 * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
1228 * JavaScriptCore.vcproj/JavaScriptCore/dstroot-to-sdk.cmd: Added.
1229 * JavaScriptCore.vcproj/dftables/dftables.vcproj:
1230 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
1232 2006-09-11 Brady Eidson <beidson@apple.com>
1234 Build fix - I think Tim's last checkin wasn't tested on Tiger, possibly. I simply
1235 commented out the undefined constants until he can have a chance to make the right call
1237 * bindings/objc/objc_utility.mm:
1238 (KJS::Bindings::objcValueTypeForType): Commented out undefined symbols
1240 2006-09-11 Timothy Hatcher <timothy@apple.com>
1242 Reviewed by Tim O. and Darin.
1244 Add support for more method signatures affecting ObjC methods called from JavaScript:
1245 - Added unsigned types and long long.
1246 - Allow methods that use const, oneway, bycopy and byref type modifiers.
1248 * bindings/objc/objc_instance.mm:
1249 (ObjcInstance::invokeMethod):
1250 * bindings/objc/objc_utility.h:
1252 * bindings/objc/objc_utility.mm:
1253 (KJS::Bindings::convertValueToObjcValue):
1254 (KJS::Bindings::convertObjcValueToValue):
1255 (KJS::Bindings::objcValueTypeForType):
1257 2006-09-05 Timothy Hatcher <timothy@apple.com>
1261 <rdar://problem/4715840> SEL is not char*
1263 * bindings/objc/objc_class.mm:
1264 (KJS::Bindings::ObjcClass::methodsNamed): use sel_getName instead of a char* cast.
1265 * bindings/objc/objc_runtime.mm:
1266 (ObjcFallbackObjectImp::callAsFunction): ditto
1268 2006-09-03 Alexey Proskuryakov <ap@nypop.com>
1272 http://bugs.webkit.org/show_bug.cgi?id=10693
1273 Convert JavaScript arrays to AppleScript lists
1275 * JavaScriptCore.exp: Export ArrayInstance::info and ArrayInstance::getItem().
1276 * kjs/array_instance.h:
1277 * kjs/array_object.cpp:
1278 (ArrayInstance::getItem): Added a method to access array items from C++.
1280 2006-09-02 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
1284 Bug 10454: Unix bakefile fixes
1285 http://bugs.webkit.org/show_bug.cgi?id=10454
1287 * JavaScriptCoreSources.bkl:
1289 2006-09-01 Nikolas Zimmermann <zimmermann@kde.org>
1291 Reviewed by hyatt. Landed by eseidel.
1295 * pcre/CMakeLists.txt: Add wtf/ include.
1297 2006-09-01 Nikolas Zimmermann <zimmermann@kde.org>
1299 Reviewed and landed by ap.
1301 Fix build on Linux (C89 without gcc extensions enabled).
1303 * pcre/pcre_internal.h: Use C style comments.
1304 * wtf/Assertions.h: Use C style comments.
1305 * wtf/Platform.h: Use C style comments.
1307 2006-09-01 Steve Falkenburg <sfalken@apple.com>
1311 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1312 * JavaScriptCore.vcproj/dftables/dftables.vcproj:
1314 2006-08-31 Anders Carlsson <acarlsson@apple.com>
1318 Add new portability functions to MathExtras.h and add StringExtras.h which is for
1319 string portability functions.
1321 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1322 * bindings/c/c_instance.cpp:
1323 * kjs/date_object.cpp:
1327 * wtf/StringExtras.h: Added.
1331 2006-08-31 Anders Carlsson <acarlsson@apple.com>
1337 * JavaScriptCore.vcproj/dftables/dftables.vcproj:
1338 * pcre/pcre_internal.h:
1340 2006-08-31 Timothy Hatcher <timothy@apple.com>
1344 Band-aid fix for PCRE to compile for ppc64 and x86_64 now that
1345 we use -Wshorten-64-to-32. Adds an INT_CAST macro that ASSERTs
1346 the value <= INT_MAX.
1348 I filed <rdar://problem/4712064> to track the need to verify
1349 PCRE's 64-bit compliance.
1351 * pcre/pcre_compile.c:
1360 (pcre_get_substring_list):
1361 * pcre/pcre_internal.h:
1362 * pcre/pcre_tables.c:
1363 * pcre/pcre_try_flipped.c:
1364 (_pcre_try_flipped):
1366 2006-08-30 Darin Adler <darin@apple.com>
1368 Reviewed by Tim Hatcher.
1370 - add WTF::getPtr, a function template that makes it possible to write
1371 generic code that gets a raw pointer out of any of our pointer types
1373 * JavaScriptCore.xcodeproj/project.pbxproj:
1374 * wtf/GetPtr.h: Added.
1375 * wtf/ListRefPtr.h: (WTF::getPtr): Added.
1376 * wtf/OwnArrayPtr.h: (WTF::getPtr): Added.
1377 * wtf/OwnPtr.h: (WTF::getPtr): Added.
1378 * wtf/PassRefPtr.h: (WTF::getPtr): Added.
1379 * wtf/RefPtr.h: (WTF::getPtr): Added.
1381 2006-08-29 waylonis <waylonis@google.com>
1383 Reviewed, tweaked by ggaren.
1385 - Added storage and accessor functions for ExecState as a fix for
1386 http://bugs.webkit.org/show_bug.cgi?id=10114
1388 * kjs/ExecState.cpp:
1389 (KJS::ExecState::ExecState):
1392 (KJS::Context::setExecState):
1393 (KJS::Context::execState):
1395 2006-08-30 Nikolas Zimmermann <zimmermann@kde.org>
1399 Commit KDE related tweaks, to be able to
1400 differentiate between a Qt-only or a KDE build.
1402 * CMakeLists.txt: Install wtf-unity library.
1403 * wtf/Platform.h: Add define for the KDE platform.
1405 2006-08-28 Darin Adler <darin@apple.com>
1409 * kjs/list.h: Use explicit in constructor (as appropriate).
1411 2006-08-24 Nikolas Zimmermann <zimmermann@kde.org>
1413 Reviewed, tweaked and landed by ap
1415 http://bugs.webkit.org/show_bug.cgi?id=10467
1416 WebKit should have Qt platform support (Part II)
1418 * CMakeLists.txt: Adjust to Anders' build fixes.
1419 * wtf/Platform.h: Fix define for the Qt platform (we don't use/need Cairo.)
1421 2006-08-23 David Hyatt <hyatt@apple.com>
1423 Fix Platform.h to include #defines for graphics features.
1427 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1430 2006-08-23 Anders Carlsson <acarlsson@apple.com>
1434 Make the bindings compile without CoreFoundation.
1436 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1437 * bindings/c/c_instance.cpp:
1438 * bindings/c/c_utility.cpp:
1439 (KJS::Bindings::convertUTF8ToUTF16):
1441 * bindings/runtime.cpp:
1442 (KJS::Bindings::Instance::createBindingForLanguageInstance):
1443 (KJS::Bindings::Instance::createLanguageInstanceForValue):
1444 * bindings/runtime_root.cpp:
1445 * bindings/runtime_root.h:
1446 * kjs/interpreter.cpp:
1447 (KJS::Interpreter::createLanguageInstanceForValue):
1448 * kjs/interpreter.h:
1450 2006-08-22 Anders Carlsson <acarlsson@apple.com>
1454 Move the npruntime code over to using HashMap and the runtime_root code over to using
1455 HashMap and HashCountedSet.
1457 * bindings/NP_jsobject.cpp:
1458 * bindings/c/c_utility.cpp:
1459 (KJS::Bindings::identifierFromNPIdentifier):
1460 * bindings/c/c_utility.h:
1461 * bindings/jni/jni_jsobject.cpp:
1462 (JavaJSObject::invoke):
1463 * bindings/npruntime.cpp:
1464 (getStringIdentifierMap):
1465 (getIntIdentifierMap):
1466 (_NPN_GetStringIdentifier):
1467 (_NPN_GetIntIdentifier):
1468 * bindings/runtime_root.cpp:
1469 (getReferencesByRootMap):
1471 (KJS::Bindings::findReferenceSet):
1472 (KJS::Bindings::rootForImp):
1473 (KJS::Bindings::rootForInterpreter):
1474 (KJS::Bindings::addNativeReference):
1475 (KJS::Bindings::removeNativeReference):
1476 (RootObject::removeAllNativeReferences):
1477 * bindings/runtime_root.h:
1479 2006-08-22 Anders Carlsson <acarlsson@apple.com>
1483 Switch over the NPAPI and Java bindings to using HashMaps instead of dictionaries.
1485 * JavaScriptCore.xcodeproj/project.pbxproj:
1486 * bindings/c/c_class.cpp:
1487 (KJS::Bindings::CClass::CClass):
1488 (KJS::Bindings::CClass::~CClass):
1489 (KJS::Bindings::CClass::classForIsA):
1490 (KJS::Bindings::CClass::methodsNamed):
1491 (KJS::Bindings::CClass::fieldNamed):
1492 * bindings/c/c_class.h:
1493 * bindings/jni/jni_class.cpp:
1494 (JavaClass::JavaClass):
1495 (JavaClass::~JavaClass):
1496 (JavaClass::methodsNamed):
1497 (JavaClass::fieldNamed):
1498 * bindings/jni/jni_class.h:
1499 * bindings/objc/objc_class.h:
1500 * bindings/objc/objc_class.mm:
1501 (KJS::Bindings::deleteMethod):
1502 (KJS::Bindings::deleteField):
1504 (KJS::Bindings::ObjcClass::methodsNamed):
1505 (KJS::Bindings::ObjcClass::fieldNamed):
1506 * bindings/runtime.cpp:
1507 * bindings/runtime.h:
1508 * bindings/runtime_object.cpp:
1509 (RuntimeObjectImp::fieldGetter):
1510 (RuntimeObjectImp::getOwnPropertySlot):
1511 (RuntimeObjectImp::put):
1512 (RuntimeObjectImp::canPut):
1514 2006-08-21 Vladimir Olexa <vladimir.olexa@gmail.com>
1518 http://bugs.webkit.org/show_bug.cgi?id=6252
1519 JavaScript 1.6 Array.lastIndexOf
1521 Test: fast/js/array-lastIndexOf.html
1523 * kjs/array_object.cpp:
1524 (ArrayProtoFunc::callAsFunction): Added a LastIndexOf case.
1525 * kjs/array_object.h:
1526 (KJS::ArrayProtoFunc::): Added LastIndexOf to enum.
1527 * tests/mozilla/expected.html: Two more tests now pass.
1529 2006-08-20 Nikolas Zimmermann <zimmermann@kde.org>
1531 Reviewed by Maciej. Landed by rwlbuis.
1533 Fixes parts of: http://bugs.webkit.org/show_bug.cgi?id=10463
1534 WebKit should have Qt platform support
1536 Removing obsolete QConstString/QString constructors in kjs code.
1541 2006-08-17 Nikolas Zimmermann <zimmermann@kde.org>
1543 Reviewed by Maciej. Landed by rwlbuis.
1545 Fixes: http://bugs.webkit.org/show_bug.cgi?id=10463
1546 WTF Changes needed for Qt platform code.
1549 * wtf/unicode/UnicodeDecomposition.h: Added.
1551 * wtf/unicode/UnicodeDirection.h: Added.
1553 * wtf/unicode/qt4/UnicodeQt4.cpp: Added.
1554 (WTF::Unicode::direction):
1555 (WTF::Unicode::category):
1556 (WTF::Unicode::decomposition):
1557 * wtf/unicode/qt4/UnicodeQt4.h:
1558 (WTF::Unicode::toLower):
1559 (WTF::Unicode::toUpper):
1560 (WTF::Unicode::isPrintableChar):
1561 (WTF::Unicode::isSpace):
1562 (WTF::Unicode::isPunct):
1563 (WTF::Unicode::isDigit):
1564 (WTF::Unicode::mirroredChar):
1565 (WTF::Unicode::compare):
1567 2006-08-17 Nikolas Zimmermann <zimmermann@kde.org>
1569 Reviewed by Eric. Landed by rwlbuis.
1571 Fixes: http://bugs.webkit.org/show_bug.cgi?id=10464
1572 Offer a cmake build system for Qt platform.
1574 * CMakeLists.txt: Added.
1575 * pcre/CMakeLists.txt: Added.
1577 2006-08-17 Anders Carlsson <acarlsson@apple.com>
1584 2006-08-15 Steve Falkenburg <sfalken@apple.com>
1590 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1593 2006-08-15 Mark Rowe <opendarwin.org@bdash.net.nz>
1597 Build fix: DWARF and -gfull are incompatible with symbol separation.
1599 * JavaScriptCore.xcodeproj/project.pbxproj:
1601 2006-08-15 Mark Rowe <opendarwin.org@bdash.net.nz>
1605 http://bugs.webkit.org/show_bug.cgi?id=10394
1606 Bug 10394: WebKit Release and Production configurations should enable dead code stripping
1608 * JavaScriptCore.xcodeproj/project.pbxproj:
1610 2006-08-15 Mark Rowe <opendarwin.org@bdash.net.nz>
1614 http://bugs.webkit.org/show_bug.cgi?id=10384
1615 Bug 10384: Switch to DWARF for Release configuration
1617 * JavaScriptCore.xcodeproj/project.pbxproj:
1619 2006-08-13 Maks Orlovich <maksim@kde.org>
1621 Reviewed (and tweaked a little) by Maciej.
1623 - shrank the size of JSObject by 8 bytes and made the corresponding reduction to the cell size, resulting
1624 in a 1.2% speed improvement on JS iBench (and probably overall memory savings).
1626 This was done by removing _scope and _internalValue data members
1627 from JSObject and moving them only to the subclasses that actually
1631 (KJS::JSObject::mark): No need to mark scope or internal value here.
1633 (KJS::JSObject::JSObject): Don't initialize them.
1634 * kjs/JSWrapperObject.cpp: Added. New base class for object types that
1635 wrap primitive values (Number, String, Boolean, Date).
1636 (KJS::JSWrapperObject::mark):
1637 * kjs/JSWrapperObject.h: Added.
1638 (KJS::JSWrapperObject::JSWrapperObject):
1639 (KJS::JSWrapperObject::internalValue):
1640 (KJS::JSWrapperObject::setInternalValue):
1641 * kjs/array_object.cpp:
1642 (ArrayPrototype::ArrayPrototype): Don't set useless internal value.
1643 * kjs/bool_object.cpp:
1644 (BooleanInstance::BooleanInstance): Inherit from JSWrapperObject.
1645 (BooleanProtoFunc::callAsFunction): Fixed to account for fact that not all
1646 JSObjects have an internal value.
1647 (BooleanObjectImp::construct): ditto.
1648 * kjs/bool_object.h:
1649 * kjs/collector.cpp: Lowered cell size to 48.
1650 (KJS::Collector::allocate): meaningless whitespace change
1651 * kjs/date_object.cpp:
1652 (KJS::DateInstance::DateInstance): Inherit from JSWrapperObject.
1653 (KJS::DateProtoFunc::callAsFunction): adjusted for move of internalValue
1654 (KJS::DateObjectImp::construct): ditto
1655 * kjs/date_object.h:
1656 * kjs/error_object.cpp:
1657 (ErrorPrototype::ErrorPrototype): don't set internal value
1658 * kjs/function.cpp: move _scope and related handling here
1659 (KJS::FunctionImp::mark): mark scope
1661 (KJS::FunctionImp::scope): moved here from JSObject
1662 (KJS::FunctionImp::setScope): ditto
1663 * kjs/number_object.cpp:
1664 (NumberInstance::NumberInstance): inherit from JSWrapperObject
1665 (NumberProtoFunc::callAsFunction): adjusted
1666 (NumberObjectImp::construct): adjusted
1667 * kjs/number_object.h: shring RegExp-related objects a little
1668 * kjs/regexp_object.cpp:
1669 (RegExpPrototype::RegExpPrototype): Adjust for size tweaks
1670 (RegExpObjectImp::RegExpObjectImp): ditto
1671 * kjs/regexp_object.h:
1672 * kjs/string_object.cpp:
1673 (StringInstance::StringInstance): inherit from JSWrapperObject
1674 (StringProtoFunc::callAsFunction): adjusted
1675 * kjs/string_object.h:
1676 * JavaScriptCore.exp: Exported new methods as needed.
1677 * JavaScriptCore.xcodeproj/project.pbxproj: Added new files to build.
1679 2006-08-04 Brady Eidson <beidson@apple.com>
1681 Reviewed by Geoff's rubber stamp
1683 Fix a build break on Intel hardware causes by adapting stricter
1684 compiler warnings (-Wshorten-64-to-32)
1687 (assertEqualsAsNumber): manually cast some doubles to floats
1690 2006-08-04 Sam Weinig <sam.weinig@gmail.com>
1694 - patch for http://bugs.webkit.org/show_bug.cgi?id=10192
1695 Make WebCore (and friends) compile with -Wshorten-64-to-32
1697 * Adds -Wshorten-64-to-32 flag to Xcode project.
1698 * Adds explicit casts where OK.
1702 (JSNodeList_getProperty):
1703 * JavaScriptCore.xcodeproj/project.pbxproj:
1705 2006-08-04 Adam Roben <aroben@apple.com>
1709 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Convert
1712 2006-08-03 Sam Weinig <sam.weinig@gmail.com>
1716 - patch for http://bugs.webkit.org/show_bug.cgi?id=10176
1717 Make WebCore compile with -Wundef
1719 * Adds -Wundef flag to Xcode project
1720 * Converts #ifs to #ifdef and #ifndefs where needed.
1721 * Added #define YYMAXDEPTH 10000 in kjs/grammar.y
1722 to fix a warning from within Bison.
1724 * JavaScriptCore.xcodeproj/project.pbxproj:
1725 * bindings/jni/jni_jsobject.cpp:
1726 (JavaJSObject::getSlot):
1727 (JavaJSObject::setSlot):
1729 * bindings/objc/objc_class.mm:
1730 (KJS::Bindings::ObjcClass::methodsNamed):
1731 (KJS::Bindings::ObjcClass::fieldNamed):
1732 * bindings/objc/objc_instance.mm:
1733 (ObjcInstance::invokeMethod):
1734 * bindings/objc/objc_runtime.mm:
1735 (ObjcMethod::getMethodSignature):
1741 2006-08-03 Anders Carlsson <acarlsson@apple.com>
1743 Reviewed by John Sullivan.
1747 Return *this in operator=
1749 2006-08-03 Adam Roben <aroben@apple.com>
1753 - Fixed Windows build
1755 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1756 * wtf/MathExtras.h: Implement inline versions of these functions
1760 2006-08-02 Adam Roben <aroben@apple.com>
1766 * kjs/date_object.cpp:
1769 2006-07-29 Darin Adler <darin@apple.com>
1771 - Removed tabs from these source files that still had them.
1772 We don't use them; that way source files look fine in editors
1773 that have tabs set to 8 spaces or to 4 spaces.
1774 - Removed allow-tabs Subversion property from the files too.
1776 * bindings/NP_jsobject.cpp:
1777 * bindings/c/c_utility.cpp:
1778 * bindings/jni/jni_runtime.cpp:
1779 * bindings/jni/jni_utility.cpp:
1780 * bindings/objc/objc_utility.mm:
1781 * bindings/runtime.cpp:
1782 * bindings/runtime_method.cpp:
1783 * bindings/testbindings.cpp:
1784 * bindings/testbindings.mm:
1785 * kjs/date_object.cpp:
1790 * kjs/string_object.cpp:
1793 2006-07-29 Darin Adler <darin@apple.com>
1795 * tests/mozilla/expected.html: Update test results now that regress-185165.js
1796 is succeeding. I suspect Anders fix for bug 4620655 is the reason.
1798 2006-07-29 Sam Weinig <sam.weinig@gmail.com>
1802 - patch for http://bugs.webkit.org/show_bug.cgi?id=10080
1803 Adopt pedantic changes from the Unity project to improve
1804 cross-compiler compatibility
1807 * Removing trailing semicolon from namespace braces.
1808 * Removing trailing comma from last enum declaration.
1809 * Updating to match style guidelines.
1810 * Adding missing newline to the end of the file.
1811 * Turning on gcc warning for missing newline at the end of a source file
1812 (GCC_WARN_ABOUT_MISSING_NEWLINE in Xcode, -Wnewline in gcc).
1813 * Alphabetical sorting of Xcode source list files.
1814 * Replace use of non-portable variable-size array with Vector.
1815 * Use C-style comments instead of C++ comments in files that might
1816 be included by either C or C++ files.
1818 * API/JSCallbackConstructor.cpp:
1819 (KJS::JSCallbackConstructor::construct):
1820 * API/JSCallbackFunction.cpp:
1821 (KJS::JSCallbackFunction::callAsFunction):
1822 * API/JSCallbackObject.cpp:
1823 (KJS::JSCallbackObject::construct):
1824 (KJS::JSCallbackObject::callAsFunction):
1825 * JavaScriptCore.xcodeproj/project.pbxproj:
1826 * JavaScriptCorePrefix.h:
1827 * bindings/jni/jni_class.cpp:
1828 (JavaClass::fieldNamed):
1829 * bindings/jni/jni_class.h:
1830 * bindings/jni/jni_instance.cpp:
1831 (JavaInstance::JavaInstance):
1832 (JavaInstance::valueOf):
1833 * bindings/jni/jni_objc.mm:
1834 (KJS::Bindings::dispatchJNICall):
1835 * bindings/jni/jni_runtime.cpp:
1836 (JavaParameter::JavaParameter):
1837 (JavaArray::JavaArray):
1838 * bindings/jni/jni_runtime.h:
1839 * bindings/jni/jni_utility.h:
1840 * bindings/objc/objc_instance.h:
1841 * bindings/runtime_array.h:
1847 2006-07-29 Mike Emmel <mike.emmel@gmail.com>
1851 - fixes for Linux build
1853 * JavaScriptCoreSources.bkl: Added new files to build, kjs/PropertyNameArray.cpp
1854 and kjs/testkjs.cpp, and removed old files.
1856 2006-07-24 Dan Waylonis <waylonis@google.com>
1858 Reviewed and tweaked a bit by Darin.
1860 - fix http://bugs.webkit.org/show_bug.cgi?id=9902
1861 jsNull and NSNull not properly converted between JS and ObjC
1863 * bindings/objc/objc_utility.mm: (KJS::Bindings::convertObjcValueToValue):
1864 Added case for converting NSNull to jsNull.
1866 2006-07-24 Rob Buis <buis@kde.org>
1870 http://bugs.webkit.org/show_bug.cgi?id=4258
1871 Date().toString() only includes GMT offset, not timezone string
1873 Use the info in tm_zone to append timezone abbreviation
1874 to Date().toString().
1876 * kjs/date_object.cpp:
1879 2006-07-24 Rob Buis <buis@kde.org>
1883 http://bugs.webkit.org/show_bug.cgi?id=5257
1884 setYear() does not match FireFox/IE behavior
1886 Make sure the right values end up in tm_year.
1888 * kjs/date_object.cpp:
1891 2006-07-23 Mark Rowe <opendarwin.org@bdash.net.nz>
1895 Bug 9686: [Drosera] Need the ability to break into Drosera on Javascript exceptions
1896 http://bugs.webkit.org/show_bug.cgi?id=9686
1898 JavaScriptCore portion of the fix.
1900 * JavaScriptCore.exp: Update symbol for change in argument type.
1902 (Debugger::detach): Clear map of recent exceptions.
1903 (Debugger::hasHandledException): Track the most recent exception
1904 thrown by an interpreter.
1905 (Debugger::exception): Change exception argument to a JSValue.
1908 (Node::debugExceptionIfNeeded): Notify the debugger of an exception
1909 if it hasn't seen it before.
1910 (ThrowNode::execute): Notify the debugger that an exception is being thrown.
1913 2006-07-23 Geoffrey Garen <ggaren@apple.com>
1915 Patch by Eric Albert, reviewed by Darin and me.
1917 - Fixed <rdar://problem/4645931> JavaScriptCore stack-scanning code
1918 crashes (Collector::markStackObjectsConservatively)
1920 * bindings/jni/jni_jsobject.cpp: On 64bit systems, jint is a long, not an
1922 (JavaJSObject::getSlot):
1923 (JavaJSObject::setSlot):
1924 * kjs/collector.cpp:
1925 (KJS::Collector::markCurrentThreadConservatively): Use a pointer instead of
1926 an int as 'dummy,' because on LP64 systems, an int is not pointer-aligned,
1927 and we want to scan the stack for pointers.
1928 * JavaScriptCore.xcodeproj/project.pbxproj: After a tense cease-fire, the
1929 XCode war has started up again!
1931 === Safari-521.20 ===
1933 2006-07-21 Geoffrey Garen <ggaren@apple.com>
1937 <rdar://problem/4507265> REGRESSION: overlays don't work on HousingMaps.com (Google Maps-based site)
1939 - Added support for strings that masquerade as undefined. Currently used
1940 by WebCore to implement undetectable style.filter.
1942 The name is a little long, but it's only used in one line of code, so I
1943 thought clarity should win over brevity.
1945 * JavaScriptCore.exp:
1946 * JavaScriptCore.xcodeproj/project.pbxproj:
1948 * kjs/string_object.h:
1949 (KJS::StringInstanceThatMasqueradesAsUndefined::StringInstanceThatMasqueradesAsUndefined):
1950 (KJS::StringInstanceThatMasqueradesAsUndefined::masqueradeAsUndefined):
1951 (KJS::StringInstanceThatMasqueradesAsUndefined::toBoolean):
1953 === Safari-521.19 ===
1955 2006-07-20 Steve Falkenburg <sfalken@apple.com>
1960 (KJS::escapeStringForPrettyPrinting):
1962 2006-07-19 Anders Carlsson <acarlsson@apple.com>
1966 <rdar://problem/4620655> REGRESSION(10.4.7-10.5): preview button for a blogger.com post doesn't work
1968 * kjs/nodes2string.cpp:
1969 (StringNode::streamTo):
1970 Return the escaped string.
1972 (RegExpNode::streamTo):
1973 Use the correct syntax.
1976 (KJS::escapeStringForPrettyPrinting):
1978 Add escape function which escapes a string for pretty-printing so it can be parsed again.
1980 * wtf/unicode/icu/UnicodeIcu.h:
1981 (WTF::Unicode::isPrintableChar):
1984 2006-07-18 Maciej Stachowiak <mjs@apple.com>
1986 Reviewed by Adele Peterson.
1988 <rdar://problem/4589530> REGRESSION: null character in JS string causes parse error (works in Tiger and in other browsers)
1994 (Lexer::scanRegExp):
1997 2006-07-18 Tim Omernick <timo@apple.com>
1999 Reviewed by Tim Hatcher.
2001 Removed a misleading comment; we recently added support for the NPNVPluginElementNPObject
2006 === Safari-521.18 ===
2008 2006-07-18 Timothy Hatcher <timothy@apple.com>
2010 Made the following headers public:
2019 * JavaScriptCore.xcodeproj/project.pbxproj:
2021 2006-07-17 Geoffrey Garen <ggaren@apple.com>
2025 - Added automatic prototype creation for classes.
2027 A class stores a weak reference to a prototype, which is cleared when
2028 the prototype is garbage collected, to avoid a reference cycle.
2030 We now have an attributes field in JSClassDefinition, that currently is
2031 used only to override automatic prototype creation when you want to manage your
2032 own prototypes, but can be extended in the future for other nefarious purposes.
2034 Similarly, we have JSObjectMake and JSObjectMakeWithPrototype, the latter
2035 allowing you to manage your own prototypes.
2037 JSObjectMakeConstructor is more interesting now, able to make a constructor
2038 on your behalf if you just give it a class.
2040 - Removed bogus old code from minidom.js.
2042 - Tweaked the headerdocs.
2044 - Added more GC testing, which caught some leaks, and tested more funny
2045 edge cases in lookup, which caught a lookup bug. Removed some testing
2046 we used to do with MyObject because it was redundant with the new, cool
2049 While fixing the lookup bug I retracted this change:
2051 "If a static setProperty callback returns 'false', to indicate that the
2052 property was not set, we no longer forward the set request up the class
2053 chain, because that's almost certainly not what the programmer expected."
2055 Returning false when setting a static property is a little silly, but you can see
2056 it being useful when shadowing a base class's static properties, and, regardless
2057 of usefullness, this is the defined behavior of the setProperty callback.
2059 - Plus a little ASCII art, for the kids.
2061 2006-07-17 Timothy Hatcher <timothy@apple.com>
2065 <rdar://problem/4634874> WebScriptObject and WebUndefined are no longer defined by WebKit
2067 Moves WebScriptObject and WebUndefined up to WebCore.
2068 This change does create an upwards-dependancy on WebScriptObject existing
2069 in the loaded process, but this code path in JavaScriptCore does not get used
2070 unless it is through WebKit/WebCore. Moving all of the binding code out of
2071 JavaScriptCore might make sense in the future.
2073 * JavaScriptCore.exp:
2074 * JavaScriptCore.xcodeproj/project.pbxproj:
2075 * bindings/objc/WebScriptObject.h: Replaced.
2076 * bindings/objc/WebScriptObject.mm: Removed.
2077 * bindings/objc/WebScriptObjectPrivate.h: Removed.
2078 * bindings/objc/objc_class.h:
2079 * bindings/objc/objc_instance.h:
2080 * bindings/objc/objc_instance.mm:
2081 (ObjcInstance::~ObjcInstance):
2082 * bindings/objc/objc_runtime.h:
2083 * bindings/objc/objc_runtime.mm:
2084 (convertValueToObjcObject):
2085 * bindings/objc/objc_utility.mm:
2086 (KJS::Bindings::convertValueToObjcValue):
2087 (KJS::Bindings::convertObjcValueToValue):
2088 (KJS::Bindings::createObjcInstanceForValue):
2090 2006-07-17 Darin Adler <darin@apple.com>
2092 * API/JSBase.h: Fix comment formatting where things used to be lined up but
2093 are now ragged. Got rid of spaces that attempted to line things up.
2094 * API/JSObjectRef.h: Ditto. Also add missing periods for a couple of comments.
2096 2006-07-17 Geoffrey Garen <ggaren@apple.com>
2100 - Removed the exception parameter from the initialize callback and, by extension,
2101 JSObjectMake. We have never had a need for exceptions when iniitializing,
2102 so the parameter seemed likely to "get in the way."
2104 Also, an exception in JavaScript is thrown in response to input --
2105 "invalid URL", "index not a number", etc., so it's the job of the
2106 constructor function, not the initialize method, to throw.
2108 If initialize *really* wants to throw, it can communicate the throw to
2109 the constructor through the constructed object's private data (e.g., set
2110 it to NULL, signaling to the consntructor that initialization failed.)
2112 - Added JSObjectMakeWithData, which enables a constructor to set private
2113 data on an object *before* it has been initialized. That way, the initialize
2114 methods can properly operate on the data.
2116 * API/JSNode.c: Moved ref into the initialize method, for better encapsulation,
2117 now that it's possible.
2118 * API/JSNodeList.c: ditto
2120 (main): Do more aggressive garbage collection to test ref/deref and
2121 initialize/finalize.
2122 * API/minidom.js: store childNodes in a temporary so it doesn't get re-created
2123 like a thousand times. This makes debugging ref/deref easier
2125 2006-07-17 Geoffrey Garen <ggaren@apple.com>
2129 - Changed the initialize callback to run from least derived class (parent
2130 class) to most derived class. This enables C++ style initialization,
2131 and derived class overriding of member data.
2133 - Added excpetion propopgation to JSObjectMake, to support initialize
2134 exceptions, and generally round out our policy of making function
2135 signatures as long as possible.
2137 * API/JSCallbackObject.h: Use ExecState instead of ContextRef, cuz we're
2140 2006-07-17 Geoffrey Garen <ggaren@apple.com>
2144 - Changed JSObjectMakeConstructor to JSObjectMakeConstructorWithCallback,
2145 to match JSObjectMakeFunctionWithCallback.
2147 - Added prototype parameter, so the generated constructor
2148 automatically works with hasInstance / instanceof
2150 - Moved hasInstance implementation from InternalFunctionImp to JSObject
2151 so that subclasses can inherit it without inheriting function-related baggage.
2152 More refactoring here would be good, but this seems like a good short-term
2155 (KJS::JSCallbackFunction::implementsHasInstance): override and return false,
2156 because callback functions aren't constructors.
2158 2006-07-17 Maciej Stachowiak <mjs@apple.com>
2162 - add a JSContextRef parameter to all JSValueRef, JSObjectRef, and JSContextRef operations;
2163 except JSObject{Get,Set}PrivateData which can be assumed to be simple pure accessors.
2165 Also renamed the parameter "context" to "ctx" because it makes the code read better with this pervasive
2166 but usually uninteresting parameter.
2170 (JSCheckScriptSyntax):
2173 * API/JSCallbackObject.cpp:
2174 (KJS::JSCallbackObject::JSCallbackObject):
2175 (KJS::JSCallbackObject::init):
2176 (KJS::JSCallbackObject::getOwnPropertySlot):
2177 (KJS::JSCallbackObject::put):
2178 (KJS::JSCallbackObject::deleteProperty):
2179 (KJS::JSCallbackObject::toNumber):
2180 (KJS::JSCallbackObject::toString):
2181 * API/JSContextRef.cpp:
2182 (JSGlobalContextCreate):
2183 (JSGlobalContextRetain):
2184 (JSGlobalContextRelease):
2185 (JSContextGetGlobalObject):
2186 * API/JSContextRef.h:
2188 (JSNodePrototype_appendChild):
2189 (JSNodePrototype_removeChild):
2190 (JSNodePrototype_replaceChild):
2191 (JSNode_getNodeType):
2192 (JSNode_getFirstChild):
2195 (JSNodeListPrototype_item):
2196 (JSNodeList_length):
2197 (JSNodeList_getProperty):
2198 (JSNodeList_prototype):
2199 * API/JSObjectRef.cpp:
2201 (JSObjectMakeFunctionWithCallback):
2202 (JSObjectMakeConstructor):
2203 (JSObjectMakeFunction):
2204 (JSObjectGetPrototype):
2205 (JSObjectSetPrototype):
2206 (JSObjectHasProperty):
2207 (JSObjectGetProperty):
2208 (JSObjectSetProperty):
2209 (JSObjectGetPropertyAtIndex):
2210 (JSObjectSetPropertyAtIndex):
2211 (JSObjectDeleteProperty):
2212 (JSObjectIsFunction):
2213 (JSObjectCallAsFunction):
2214 (JSObjectIsConstructor):
2215 (JSObjectCallAsConstructor):
2216 (JSObjectCopyPropertyNames):
2217 * API/JSObjectRef.h:
2218 * API/JSStringRef.cpp:
2219 * API/JSValueRef.cpp:
2221 (JSValueIsUndefined):
2227 (JSValueIsObjectOfClass):
2229 (JSValueIsStrictEqual):
2230 (JSValueIsInstanceOfConstructor):
2231 (JSValueMakeUndefined):
2233 (JSValueMakeBoolean):
2234 (JSValueMakeNumber):
2235 (JSValueMakeString):
2238 (JSValueToStringCopy):
2246 (MyObject_getProperty):
2247 (MyObject_deleteProperty):
2248 (MyObject_callAsFunction):
2249 (MyObject_callAsConstructor):
2250 (MyObject_convertToType):
2251 (print_callAsFunction):
2254 2006-07-16 Geoffrey Garen <ggaren@apple.com>
2256 Approved by Maciej, RS by Beth.
2258 JSObjectMakeFunction -> JSObjectMakeFunctionWithCallback
2259 JSObjectMakeFunctionWithBody -> JSObjectMakeFunction
2261 because the latter is more common, and more fundamental, than the former.
2266 * API/JSCallbackObject.cpp:
2267 (KJS::JSCallbackObject::getOwnPropertySlot):
2268 (KJS::JSCallbackObject::put):
2269 (KJS::JSCallbackObject::deleteProperty):
2270 (KJS::JSCallbackObject::getPropertyNames):
2271 (KJS::JSCallbackObject::staticValueGetter):
2272 (KJS::JSCallbackObject::staticFunctionGetter):
2273 * API/JSClassRef.cpp:
2274 (OpaqueJSClass::OpaqueJSClass):
2275 (OpaqueJSClass::~OpaqueJSClass):
2277 * API/JSObjectRef.cpp:
2279 (JSObjectMakeFunctionWithCallback):
2280 (JSObjectMakeFunction):
2281 (OpaqueJSPropertyNameArray::OpaqueJSPropertyNameArray):
2282 (JSObjectCopyPropertyNames):
2283 * API/JSObjectRef.h:
2289 * JavaScriptCore.exp:
2291 2006-07-16 Geoffrey Garen <ggaren@apple.com>
2295 Replace __JS with OpaqueJS because the former, while used by CF, is
2296 a prefix that's triply-reserved by the compiler. (_* is reserved in global
2297 names, _[A-Z] is reserved in all names, and __ is reserved in all names
2300 Opaque is an alternative used by other Mac OS X framewokrs.
2305 * API/JSCallbackObject.cpp:
2306 (KJS::JSCallbackObject::getOwnPropertySlot):
2307 (KJS::JSCallbackObject::put):
2308 (KJS::JSCallbackObject::deleteProperty):
2309 (KJS::JSCallbackObject::getPropertyNames):
2310 (KJS::JSCallbackObject::staticValueGetter):
2311 (KJS::JSCallbackObject::staticFunctionGetter):
2312 * API/JSClassRef.cpp:
2313 (OpaqueJSClass::OpaqueJSClass):
2314 (OpaqueJSClass::~OpaqueJSClass):
2316 * API/JSObjectRef.cpp:
2318 (OpaqueJSPropertyNameArray::OpaqueJSPropertyNameArray):
2319 (JSObjectCopyPropertyNames):
2321 2006-07-16 Darin Adler <darin@apple.com>
2323 - try to fix Windows build
2325 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2326 Added some recently added files, removed some recently removed.
2328 2006-07-16 Geoffrey Garen <ggaren@apple.com>
2332 - Change getProperty* to return undefined, rather than NULL, for missing
2333 properties, since that's what the spec says. Also added exception out
2334 parameters to the *Index functions, because they can call through to the
2335 regular functions, which can throw for custom objects.
2337 * API/JSObjectRef.cpp:
2338 (JSObjectGetProperty):
2339 (JSObjectGetPropertyAtIndex):
2340 (JSObjectSetPropertyAtIndex):
2341 * API/JSObjectRef.h:
2345 2006-07-16 Geoffrey Garen <ggaren@apple.com>
2349 - Properly document and handle NULL callbacks for static properties. We
2350 throw an exception in any case other than a ReadOnly property with a NULL
2351 setProperty callback, because a NULL callback almost certainly indicates
2352 a programming error. Also throw an exception if hasProperty returns true
2353 for a property that getProperty can't get.
2355 - If a static setProperty callback returns 'false', to indicate that the
2356 property was not set, we no longer forward the set request up the class
2357 chain, because that's almost certainly not what the programmer expected.
2359 * API/JSCallbackObject.cpp:
2360 (KJS::JSCallbackObject::getOwnPropertySlot):
2361 (KJS::JSCallbackObject::put):
2362 (KJS::JSCallbackObject::staticValueGetter):
2363 (KJS::JSCallbackObject::staticFunctionGetter):
2364 (KJS::JSCallbackObject::callbackGetter):
2365 * API/JSObjectRef.h:
2368 (MyObject_hasProperty):
2371 2006-07-16 Geoffrey Garen <ggaren@apple.com>
2375 - Added names to functions.
2377 - Removed GetPrivate/SetPrivate from callbackFunctions and callbackConstructors.
2378 The private data idiom is that a JS object stores its native implementation
2379 as private data. For functions and constructors, the native implementation is nothing
2380 more than the callback they already store, so supporting private data, too,
2381 confuses the idiom. If you *really* want, you can still create a custom
2382 function with private data.
2384 * API/JSCallbackConstructor.cpp:
2385 * API/JSCallbackConstructor.h:
2386 * API/JSCallbackFunction.cpp:
2387 (KJS::JSCallbackFunction::JSCallbackFunction):
2388 * API/JSCallbackFunction.h:
2389 * API/JSCallbackObject.cpp:
2390 (KJS::JSCallbackObject::staticFunctionGetter):
2391 * API/JSObjectRef.cpp:
2392 (JSObjectMakeFunction):
2393 (JSObjectMakeFunctionWithBody):
2394 (JSObjectGetPrivate):
2395 (JSObjectSetPrivate):
2396 * API/JSObjectRef.h:
2402 2006-07-15 Maciej Stachowiak <mjs@apple.com>
2406 - switch property lists to be vector+set of Identifiers instead of list of References
2408 This has the following benefits:
2410 - no duplicates in property lists
2411 - simplifies API calls
2412 - probably more efficient, since linked list is gone
2413 - entirely removed Reference, ReferenceList and ProtectedReference types from the API
2415 * kjs/PropertyNameArray.cpp: Added.
2416 (KJS::PropertyNameArray::add): Check set, if not already there, add to
2418 * kjs/PropertyNameArray.h: Added.
2419 (KJS::PropertyNameArray::PropertyNameArray): Newly added type, combines
2420 a set and a vector to make a unique but ordered list of identifiers.
2421 (KJS::PropertyNameArray::begin): ditto
2422 (KJS::PropertyNameArray::end): ditto
2423 (KJS::PropertyNameArray::size): ditto
2424 (KJS::PropertyNameArray::operator[]): ditto
2425 * kjs/array_instance.h:
2426 * kjs/array_object.cpp:
2427 (ArrayInstance::getPropertyNames): renamed from getPropertyList, updated
2428 for PropertyNameArray
2429 (ArrayInstance::setLength): updated for PropertyNameArray
2430 (ArrayInstance::pushUndefinedObjectsToEnd): ditto
2432 (ForInNode::execute): updated for PropertyNameArray
2435 (KJS::JSObject::getPropertyNames): renamed from getPropertyList, updated
2436 for PropertyNameArray
2438 * kjs/property_map.cpp:
2439 (KJS::PropertyMap::getEnumerablePropertyNames): updated for PropertyNameArray
2440 (KJS::PropertyMap::getSparseArrayPropertyNames): ditto
2441 * kjs/property_map.h:
2442 * kjs/protected_reference.h: Removed.
2443 * kjs/reference.cpp: Removed.
2444 * kjs/reference.h: Removed.
2445 * kjs/reference_list.cpp: Removed.
2446 * kjs/reference_list.h: Removed.
2447 * kjs/scope_chain.cpp:
2448 (KJS::ScopeChain::print): Use PropertyNamesArray instead of ReferenceList.
2449 * kjs/string_object.cpp:
2450 (StringInstance::getPropertyNames): Updated for new approach.
2451 * kjs/string_object.h:
2454 (toJS): Added overload for PropertyNameAccumulatorRef / PropertyNameArray*
2457 * API/JSCallbackObject.cpp:
2458 (KJS::JSCallbackObject::getPropertyNames): Fixed for new API.
2459 * API/JSCallbackObject.h:
2460 * API/JSObjectRef.cpp:
2461 (__JSPropertyNameArray::__JSPropertyNameArray): Type used for a publicly vended
2462 JSPropertyNameArrayRef.
2463 (JSObjectCopyPropertyNames): New API call - renamed / refactored from
2464 JSObjectCreatePropertyList
2465 (JSPropertyNameArrayRetain): new retain call for JSPropertyNameArray.
2466 (JSPropertyNameArrayRelease): new release call for - " -.
2467 (JSPropertyNameArrayGetCount): Instead of having to use a stateful enumerator you
2468 can now get the count and items in any order.
2469 (JSPropertyNameArrayGetNameAtIndex): See above.
2470 (JSPropertyNameAccumulatorAddName): What you add properties to is now an opaque
2472 * API/JSObjectRef.h: Prototyped new functions, removed old ones
2473 * JavaScriptCore.exp: Updated exported symbols.
2474 * JavaScriptCore.xcodeproj/project.pbxproj: Added new files, removed old.
2476 (MyObject_getPropertyNames): Renamed / fixed callback to fit new paradigm.
2477 (main): Updated for new API.
2479 2006-07-15 Darin Adler <darin@apple.com>
2481 - oops, missed a few more arrays that had to be const
2484 (JSNodePrototype_appendChild): Added const.
2485 (JSNodePrototype_removeChild): Ditto.
2486 (JSNodePrototype_replaceChild): Ditto.
2487 (JSNode_construct): Ditto.
2489 (JSNodeListPrototype_item): Ditto.
2490 * API/JSObjectRef.cpp:
2491 (JSObjectMakeFunctionWithBody): Ditto.
2492 (JSObjectCallAsFunction): Ditto.
2493 (JSObjectCallAsConstructor): Ditto.
2497 (MyObject_callAsFunction): Ditto.
2498 (MyObject_callAsConstructor): Ditto.
2499 (print_callAsFunction): Ditto.
2500 (myConstructor_callAsConstructor): Ditto.
2502 2006-07-15 Darin Adler <darin@apple.com>
2506 * API/JSNode.h: Made an array parameter const.
2507 * API/JSObjectRef.h: Made array parameters const. Fixed a comment.
2509 2006-07-15 Geoffrey Garen <ggaren@apple.com>
2513 - JSObjectMakeFunctionWithBody includes a function name and named parameters now.
2515 * API/JSObjectRef.cpp:
2516 (JSObjectMakeFunctionWithBody):
2517 * API/JSObjectRef.h:
2519 (assertEqualsAsUTF8String): More informative failure reporting.
2520 (main): Test more function cases.
2522 2006-07-15 Geoffrey Garen <ggaren@apple.com>
2526 - Moved the arguments passed to JSClassCreate into a single structure,
2527 called JSClassDefinition. This will enable easier structure
2528 migration/versioning in the future, if necessary.
2530 - Added support for class names.
2532 - kJSClassDefinitionNull replaces kJSObjectCallbacksNone.
2534 - JSClass is becoming a fairly complex struct, so I migrated all of its
2535 implementation other than reference counting to the sruct.
2537 - Also moved JSClass* functions in the API to JSObjectRef.cpp, since they're
2538 declared in JSObjectRef.h
2540 - Also added some more informative explanation to the class structure doc.
2542 2006-07-15 Darin Adler <darin@apple.com>
2546 - fix http://bugs.webkit.org/show_bug.cgi?id=8395
2547 <rdar://problem/4613467>
2548 REGRESSION: RegEx seems broken for hex escaped non breaking space
2550 Test: fast/js/regexp-extended-characters-more.html
2553 (match): Got rid of utf16Length local variable to guarantee there's no
2554 extra stack usage in recursive calls. Fixed two places in the PCRE_UTF16
2555 code that were using the length variable, which is the UTF-8 length of
2556 a character in the pattern, to move in the UTF-16 subject string. Instead
2557 they hardcode lengths of 1 and 2 since the code already handles BMP
2558 characters and surrogate pairs separately. Also fixed some DPRINTF so
2559 I could compile with DEBUG on.
2560 (pcre_exec): Changed a place that was checking for multibyte characters
2561 in the subject string to use ISMIDCHAR. Instead it was using hardcoded
2562 logic that was right for UTF-8 but wrong for UTF-16.
2564 * pcre/pcre_compile.c: (pcre_compile2): Fixed a DPRINTF so I could compile
2567 2006-07-14 Geoffrey Garen <ggaren@apple.com>
2571 Global replace in the API of argc/argv with argumentCount/arguments.
2573 2006-07-14 Geoffrey Garen <ggaren@apple.com>
2577 - Finalized exception handling in the API.
2579 setProperty can throw because it throws for built-in arrays. getProperty
2580 and deleteProperty can throw because setProperty can throw and we want
2581 to be consistent, and also because they seem like "actions." callAsFunction,
2582 callAsConstructor, and hasInstance can throw, because they caan throw for
2585 toBoolean can't throw because it's defined that way in the spec.
2587 - Documented that toBoolean and toObject can't be overridden by custom
2588 objects because they're defined that way in the spec.
2590 === Safari-521.17 ===
2592 2006-07-14 Geoffrey Garen <ggaren@apple.com>
2596 - Implemented ref-counting of JSContexts by splitting into two datatypes:
2597 JSGlobalContext, which you can create/retain/release, and JSContext, which
2600 Internally, you retain a JSGlobalContext/ExecState by retaining its
2601 interpreter, which, in the case of a global ExecState, owns it.
2603 - Also made ~Interpreter() protected to catch places where Interpreter
2604 is manually deleted. (Can't make it private because some crazy fool
2605 decided it would be a good idea to subclass Interpreter in other frameworks.
2609 (toJS): Added cast for new JSGlobalContext
2610 * API/JSStringRef.h: Changed vague "you must" language to more specific
2611 (but, ultimately, equally vague) "behavior is undefined if you don't"
2613 (KJS::Interpreter::Interpreter): Factored more common initialization into
2615 * kjs/interpreter.h:
2616 (KJS::Interpreter::ref): new
2617 (KJS::Interpreter::deref): new
2618 (KJS::Interpreter::refCount): new
2620 (doIt): Ref-count the interpreter.
2622 2006-07-14 Maciej Stachowiak <mjs@apple.com>
2626 - removed bool return value from JSObjectSetProperty, since it is inefficient and
2627 also doesn't work quite right
2628 - added JSObjectGetPropertyAtIndex and JSObjectSetPropertyAtIndex
2630 * API/JSObjectRef.cpp:
2631 (JSObjectSetProperty): Removed return value and canPut stuff.
2632 (JSObjectGetPropertyAtIndex): Added.
2633 (JSObjectSetPropertyAtIndex): Added.
2634 * API/JSObjectRef.h: Prototyped and documented new functions.
2636 2006-07-14 Geoffrey Garen <ggaren@apple.com>
2640 Moved JSCheckScriptSyntax, JSEvaluateScript, and JSGarbageCollect into
2641 JSBase.h/.cpp. They don't belong in the value-specific or context-specific
2642 files because they're not part of the value or context implementations.
2645 * API/JSContextRef.cpp:
2646 (JSContextGetGlobalObject):
2647 * API/JSContextRef.h:
2648 * API/JSValueRef.cpp:
2651 * JavaScriptCore.xcodeproj/project.pbxproj:
2653 2006-07-13 Timothy Hatcher <timothy@apple.com>
2657 Moved JavaScriptCore to be a public framework.
2659 * JavaScriptCore.xcodeproj/project.pbxproj:
2661 2006-07-13 Mark Rowe <opendarwin.org@bdash.net.nz>
2663 Reviewed by Geoffrey.
2665 http://bugs.webkit.org/show_bug.cgi?id=9742
2666 Bug 9742: REGRESSION: WebKit hangs when loading <http://www.vtbook.com>
2669 (KJS::JSValue::getUInt32): Only types tagged as numeric can be converted to UInt32.
2671 2006-07-13 Geoffrey Garen <ggaren@apple.com>
2675 - Renamed JSEvaluate -> JSEvaluateScript, JSCheckSyntax -> JSCheckScriptSyntax
2676 - Added exception out parameters to JSValueTo* and JSValueIsEqual because
2678 - Removed JSObjectGetDescription because it's useless and vague, and
2679 JSValueToString/JSValueIsObjectOfClass do a better job, anyway
2680 - Clarified comments about "IsFunction/Constructor" to indicate that they
2681 are true of all functions/constructors, not just those created by JSObjectMake*
2683 2006-07-12 Geoffrey Garen <ggaren@apple.com>
2687 Finished previously approved JSInternalString -> JSString conversion
2688 by renaming the files.
2690 * API/JSCallbackObject.cpp:
2691 * API/JSInternalStringRef.cpp: Removed.
2692 * API/JSInternalStringRef.h: Removed.
2693 * API/JSStringRef.cpp: Added.
2694 * API/JSStringRef.h: Added.
2695 * API/JavaScriptCore.h:
2696 * JavaScriptCore.xcodeproj/project.pbxproj:
2698 2006-07-12 Geoffrey Garen <ggaren@apple.com>
2702 - Removed context and exception parameters from JSObjectGetPropertyEnumerator,
2703 removing the spurious use of ExecState inside JavaScriptCore that made
2704 us think this was necessary in the first place.
2706 (StringInstance::getPropertyList): Use getString instead of toString because
2707 we know we're dealing with a string -- we put it there in the first place.
2708 While we're at it, store the string's size instead of retrieving it each time
2709 through the loop, to avoid the unnecessary killing of puppies.
2710 * kjs/string_object.h:
2712 2006-07-12 Maciej Stachowiak <mjs@apple.com>
2716 - add handling of hasInstance callback for API objects
2718 * API/JSCallbackObject.cpp:
2719 (KJS::JSCallbackObject::implementsHasInstance): Check if callback is present.
2720 (KJS::JSCallbackObject::hasInstance): Invoke appropriate callback.
2721 * API/JSCallbackObject.h:
2722 * API/JSClassRef.cpp:
2723 * API/JSObjectRef.h:
2725 (MyObject_hasInstance): Test case; should match what construct would do.
2728 2006-07-11 Geoffrey Garen <ggaren@apple.com>
2732 - Implemented a vast number of renames and comment clarifications
2733 suggested during API review.
2735 JSInternalString -> JSString
2736 JS*Make -> JSValueMake*, JSObjectMake*
2737 JSTypeCode -> JSType
2738 JSValueIsInstanceOf -> JSValueIsInstanceOfConstructor (reads strangely well in client code)
2739 JSGC*Protect -> JSValue*Protect
2740 JS*Callback -> JSObject*Callback
2741 JSGetPropertyListCallback -> JSObjectAddPropertiesToListCallback
2742 JSPropertyEnumeratorGetNext -> JSPropertyEnumeratorGetNextName
2744 JSStringCreateWithUTF8CString, JSStringGetUTF8CString,
2745 JSStringGetMaximumUTF8CStringSize JSStringIsEqualToUTF8CString,
2746 JSStringCreateWithCFString, JSStringCopyCFString, JSStringCreateWithCharacters.
2748 - Changed functions taking a JSValue out arg and returning a bool indicating
2749 whether it was set to simply return a JSValue or NULL.
2751 - Removed JSStringGetCharacters because it's more documentation than code,
2752 and it's just a glorified memcpy built on existing API functionality.
2754 - Moved standard library includes into the headers that actually require them.
2756 - Standardized use of the phrase "Create Rule."
2758 - Removed JSLock from make functions that don't allocate.
2760 - Added exception handling to JSValueToBoolean, since we now allow
2761 callback objects to throw exceptions upon converting to boolean.
2763 - Renamed JSGCCollect to JSGarbageCollect.
2765 2006-07-10 Geoffrey Garen <ggaren@apple.com>
2769 - Changed public header includes to the <JavaScriptCore/ style.
2770 - Changed instances of 'buffer' to 'string' since we decided on
2771 JSInternalString instead of JSStringBuffer.
2773 * API/JSContextRef.h:
2774 * API/JSInternalStringRef.cpp:
2776 (JSInternalStringRetain):
2777 (JSInternalStringRelease):
2778 (JSValueCopyStringValue):
2779 (JSInternalStringGetLength):
2780 (JSInternalStringGetCharactersPtr):
2781 (JSInternalStringGetCharacters):
2782 (JSInternalStringGetMaxLengthUTF8):
2783 (JSInternalStringGetCharactersUTF8):
2784 (CFStringCreateWithJSInternalString):
2785 * API/JSInternalStringRef.h:
2787 (JSNodePrototype_appendChild):
2788 (JSNode_getNodeType):
2789 * API/JSObjectRef.cpp:
2790 (JSObjectCallAsConstructor):
2792 * API/JavaScriptCore.h:
2797 (MyObject_getPropertyList):
2798 (myConstructor_callAsConstructor):
2799 (main): I noticed that we were prematurely releasing some string buffers,
2800 so I moved their release calls to the end of main(). I got rid of 'Buf' in *Buf
2801 (sometimes changing to 'IString', when necessary to differentiate a variable)
2802 to match the buffer->string change.
2804 === Safari-521.16 ===
2806 2006-07-10 Darin Adler <darin@apple.com>
2808 * kjs/value.cpp: (KJS::JSValue::toInt32Inline): Added inline keyword one more place.
2811 2006-07-10 Darin Adler <darin@apple.com>
2813 - fix the release build
2817 (KJS::JSValue::toInt32Inline): Move the code here to an inline.
2818 (KJS::JSValue::toInt32): Call the inline from both overloaded toInt32 functions.
2820 2006-07-10 David Kilzer <ddkilzer@kilzer.net>
2824 - fix http://bugs.webkit.org/show_bug.cgi?id=9179
2825 Implement select.options.add() method
2827 * JavaScriptCore.exp: Added overloaded KJS::JSValue::toInt32() method.
2828 * JavaScriptCore.xcodeproj/project.pbxproj: Altered attributes metadata for
2829 kjs/value.h to make it available as a forwarded header.
2831 (KJS::lookupPut): Extracted a lookupPut() method from the existing lookupPut() method.
2832 The new method returns a boolean value if no entry is found in the lookup table.
2834 (KJS::JSValue::toInt32): Overloaded toInt32() method with boolean "Ok" argument.
2835 * kjs/value.h: Ditto.
2837 2006-07-10 Geoffrey Garen <ggaren@apple.com>
2839 No review necessary. Removed bogus file I accidentally checked in before.
2841 * API/JSInternalSringRef.h: Removed.
2843 2006-07-10 Geoffrey Garen <ggaren@apple.com>
2847 Added exception out parameter to API object callbacks, removed semi-bogus
2848 JSContext(.*)Exception functions.
2850 To make these calls syntactically simple, I added an exceptionSlot()
2851 method to the ExecState class, which provides a JSValue** slot in which to
2852 store a JSValue* exception.
2856 * API/JSCallbackConstructor.cpp:
2857 (KJS::JSCallbackConstructor::construct):
2858 * API/JSCallbackFunction.cpp:
2859 (KJS::JSCallbackFunction::callAsFunction):
2860 * API/JSCallbackObject.cpp:
2861 (KJS::JSCallbackObject::init):
2862 (KJS::JSCallbackObject::getOwnPropertySlot):
2863 (KJS::JSCallbackObject::put):
2864 (KJS::JSCallbackObject::deleteProperty):
2865 (KJS::JSCallbackObject::construct):
2866 (KJS::JSCallbackObject::callAsFunction):
2867 (KJS::JSCallbackObject::getPropertyList):
2868 (KJS::JSCallbackObject::toBoolean):
2869 (KJS::JSCallbackObject::toNumber):
2870 (KJS::JSCallbackObject::toString):
2871 (KJS::JSCallbackObject::staticValueGetter):
2872 (KJS::JSCallbackObject::callbackGetter):
2873 * API/JSContextRef.cpp:
2875 * API/JSContextRef.h:
2877 (JSNodePrototype_appendChild):
2878 (JSNodePrototype_removeChild):
2879 (JSNodePrototype_replaceChild):
2880 (JSNode_getNodeType):
2881 (JSNode_getChildNodes):
2882 (JSNode_getFirstChild):
2886 (JSNodeListPrototype_item):
2887 (JSNodeList_length):
2888 (JSNodeList_getProperty):
2889 * API/JSObjectRef.h:
2893 (MyObject_initialize):
2894 (MyObject_hasProperty):
2895 (MyObject_getProperty):
2896 (MyObject_setProperty):
2897 (MyObject_deleteProperty):
2898 (MyObject_getPropertyList):
2899 (MyObject_callAsFunction):
2900 (MyObject_callAsConstructor):
2901 (MyObject_convertToType):
2902 (print_callAsFunction):
2903 (myConstructor_callAsConstructor):
2905 * JavaScriptCore.exp:
2907 (KJS::ExecState::exceptionHandle):
2909 2006-07-10 Geoffrey Garen <ggaren@apple.com>
2913 Improved type safety by implementing opaque JSValue/JSObject typing through
2914 abuse of 'const', not void*. Also fixed an alarming number of bugs
2915 exposed by this new type safety.
2917 I made one design change in JavaScriptCore, which is that the JSObject
2918 constructor should take a JSValue* as its prototype argument, not a JSObject*,
2919 since we allow the prototype to be any JSValue*, including jsNull(), for
2925 * API/JSCallbackConstructor.cpp:
2926 (KJS::JSCallbackConstructor::construct):
2927 * API/JSCallbackFunction.cpp:
2928 (KJS::JSCallbackFunction::callAsFunction):
2929 * API/JSCallbackObject.cpp:
2930 (KJS::JSCallbackObject::JSCallbackObject):
2931 (KJS::JSCallbackObject::getOwnPropertySlot):
2932 (KJS::JSCallbackObject::put):
2933 (KJS::JSCallbackObject::construct):
2934 (KJS::JSCallbackObject::callAsFunction):
2935 (KJS::JSCallbackObject::staticFunctionGetter):
2936 * API/JSCallbackObject.h:
2937 * API/JSContextRef.cpp:
2940 (JSNodePrototype_appendChild):
2941 (JSNodePrototype_removeChild):
2942 (JSNodePrototype_replaceChild):
2943 * API/JSObjectRef.cpp:
2945 (JSFunctionMakeWithBody):
2946 (JSObjectGetProperty):
2947 (JSObjectCallAsFunction):
2948 (JSObjectCallAsConstructor):
2949 * API/JSObjectRef.h:
2954 (KJS::JSObject::JSObject):
2956 2006-07-10 Geoffrey Garen <ggaren@apple.com>
2958 Approved by Maciej, Darin.
2960 Renamed JSStringBufferRef to JSInternalStringRef. "Internal string" means the
2961 JavaScript engine's internal string representation, which is the most
2962 low-level and efficient representation to use when interfacing with JavaScript.
2968 * API/JSCallbackObject.cpp:
2969 (KJS::JSCallbackObject::getOwnPropertySlot):
2970 (KJS::JSCallbackObject::put):
2971 (KJS::JSCallbackObject::deleteProperty):
2972 (KJS::JSCallbackObject::staticValueGetter):
2973 (KJS::JSCallbackObject::callbackGetter):
2974 * API/JSContextRef.cpp:
2977 * API/JSContextRef.h:
2978 * API/JSInternalStringRef.cpp: Added.
2980 (JSInternalStringCreate):
2981 (JSInternalStringCreateUTF8):
2982 (JSInternalStringRetain):
2983 (JSInternalStringRelease):
2984 (JSValueCopyStringValue):
2985 (JSInternalStringGetLength):
2986 (JSInternalStringGetCharactersPtr):
2987 (JSInternalStringGetCharacters):
2988 (JSInternalStringGetMaxLengthUTF8):
2989 (JSInternalStringGetCharactersUTF8):
2990 (JSInternalStringIsEqual):
2991 (JSInternalStringIsEqualUTF8):
2992 (JSInternalStringCreateCF):
2993 (CFStringCreateWithJSInternalString):
2994 * API/JSInternalStringRef.h: Added.
2996 (JSNodePrototype_appendChild):
2997 (JSNode_getNodeType):
2998 (JSNode_getChildNodes):
2999 (JSNode_getFirstChild):
3001 (JSNodeList_length):
3002 (JSNodeList_getProperty):
3003 * API/JSObjectRef.cpp:
3004 (JSFunctionMakeWithBody):
3005 (JSObjectGetDescription):
3006 (JSObjectHasProperty):
3007 (JSObjectGetProperty):
3008 (JSObjectSetProperty):
3009 (JSObjectDeleteProperty):
3010 (JSPropertyEnumeratorGetNext):
3011 (JSPropertyListAdd):
3012 * API/JSObjectRef.h:
3013 * API/JSStringBufferRef.cpp: Removed.
3014 * API/JSStringBufferRef.h: Removed.
3016 * API/JavaScriptCore.h:
3021 (assertEqualsAsUTF8String):
3022 (assertEqualsAsCharactersPtr):
3023 (assertEqualsAsCharacters):
3024 (MyObject_hasProperty):
3025 (MyObject_getProperty):
3026 (MyObject_setProperty):
3027 (MyObject_deleteProperty):
3028 (MyObject_getPropertyList):
3029 (print_callAsFunction):
3030 (myConstructor_callAsConstructor):
3032 * JavaScriptCore.exp:
3033 * JavaScriptCore.xcodeproj/project.pbxproj:
3035 2006-07-08 Tim Omernick <timo@apple.com>
3039 Added an OpenGL drawing model to the Netscape Plug-in API.
3043 2006-07-08 Timothy Hatcher <timothy@apple.com>
3047 Moved KJS_GetCreatedJavaVMs to jni_utility.cpp.
3048 Switched KJS_GetCreatedJavaVMs over to use dlopen and dlsym
3049 now that NSAddImage, NSLookupSymbolInImage and NSAddressOfSymbol
3050 are deprecated in Leopard.
3052 * JavaScriptCore.exp:
3053 * JavaScriptCore.xcodeproj/project.pbxproj:
3054 * bindings/jni/jni_utility.cpp:
3055 (KJS::Bindings::KJS_GetCreatedJavaVMs):
3056 * bindings/softlinking.c: Removed.
3057 * bindings/softlinking.h: Removed.
3059 2006-07-08 Geoffrey Garen <ggaren@apple.com>
3063 - Make JSObjectGetProperty return a JSValue or NULL, like JSEvaluate does.
3065 * API/JSObjectRef.cpp:
3066 (JSObjectGetProperty):
3067 * API/JSObjectRef.h:
3071 2006-07-08 Geoffrey Garen <ggaren@apple.com>
3073 Style change -- no review necessary.
3075 Use 0 instead of NULL in API .cpp files, to match our style guidelines.
3077 * API/JSContextRef.cpp:
3079 * API/JSObjectRef.cpp:
3080 (JSFunctionMakeWithBody):
3081 (JSObjectCallAsFunction):
3082 (JSObjectCallAsConstructor):
3083 * API/JSValueRef.cpp:
3086 2006-07-08 Geoffrey Garen <ggaren@apple.com>
3090 - Added ability to pass NULL for thisObject when calling JSObjectCallAsFunction,
3091 to match JSEvaluate.
3093 * API/JSObjectRef.cpp:
3094 (JSObjectCallAsFunction):
3095 * API/JSObjectRef.h:
3099 === Safari-521.15 ===
3101 2006-07-07 Geoffrey Garen <ggaren@apple.com>
3105 - Standardized which functions take a JSContext as an argument. The rule is:
3106 if you might execute JavaScript, you take a JSContext, otherwise you don't.
3108 The FIXME in JSObjectRef.h requires refactoring some parts of Interpreter,
3109 but not API changes, so I'm putting it off until later.
3111 * API/JSCallbackObject.cpp:
3112 (KJS::JSCallbackObject::JSCallbackObject):
3113 (KJS::JSCallbackObject::init):
3114 * API/JSCallbackObject.h:
3115 * API/JSContextRef.cpp:
3117 * API/JSContextRef.h:
3118 * API/JSObjectRef.cpp:
3120 (JSPropertyEnumeratorGetNext):
3121 * API/JSObjectRef.h:
3123 (MyObject_initialize):
3125 * JavaScriptCore.exp:
3126 * kjs/array_object.cpp:
3127 (ArrayInstance::setLength):
3128 (ArrayInstance::pushUndefinedObjectsToEnd):
3130 (ForInNode::execute):
3131 * kjs/reference.cpp:
3132 (KJS::Reference::getPropertyName):
3133 (KJS::Reference::getValue):
3135 * kjs/scope_chain.cpp:
3136 (KJS::ScopeChain::print):
3138 2006-07-06 Geoffrey Garen <ggaren@apple.com>
3144 - Headerdoc finished
3147 - Added a JSContextRef argument to many functions, because you need a
3148 JSContextRef for doing virtually anything. I expect to add this argument
3149 to even more functions in a future patch.
3151 - Removed the globalObjectPrototype argument to JSContextCreate because
3152 you can't create an object until you have a context, so it's impossible
3153 to pass a prototype object to JSContextCreate. That's OK because (1) there's
3154 no reason to give the global object a prototype and (2) if you really want
3155 to, you can just use a separate call to JSObjectSetPrototype.
3157 - Removed the JSClassRef argument to JSClassCreate because it was unnecessary,
3158 and you need to be able to make the global object's class before you've
3159 created a JSContext.
3161 - Added an optional exception parameter to JSFunctionMakeWithBody because anything
3162 less would be uncivilized.
3164 - Made the return value parameter to JSObjectGetProperty optional to match
3165 all other return value parameters in the API.
3167 - Made JSObjectSetPrivate/JSObjectGetPrivate work on JSCallbackFunctions
3168 and JSCallbackConstructors. You could use an abstract base class or strategic
3169 placement of m_privateData in the class structure to implement this, but
3170 the former seemed like overkill, and the latter seemed too dangerous.
3172 - Fixed a bug where JSPropertyEnumeratorGetNext would skip the first property.
3175 - Reversed the logic of the JSChar #ifdef to avoid confusing headerdoc
3177 - Removed function names from @function declarations because headeroc
3178 can parse them automatically, and I wanted to rule out manual mismatch.
3180 - Changed Error::create to take a const UString& instead of a UString*
3181 because it was looking at me funny.
3183 - Renamed JSStringBufferCreateWithCFString to JSStringBufferCreateCF
3184 because the latter is more concise and it matches JSStringBufferCreateUTF8.
3186 * API/JSCallbackObject.cpp:
3187 (KJS::JSCallbackObject::getOwnPropertySlot):
3188 (KJS::JSCallbackObject::put):
3189 (KJS::JSCallbackObject::deleteProperty):
3190 (KJS::JSCallbackObject::getPropertyList):
3191 (KJS::JSCallbackObject::toBoolean):
3192 (KJS::JSCallbackObject::toNumber):
3193 (KJS::JSCallbackObject::toString):
3194 * API/JSClassRef.cpp:
3196 * API/JSContextRef.cpp:
3198 (JSContextSetException):
3199 * API/JSContextRef.h:
3201 (JSNodePrototype_class):
3204 (JSNodeListPrototype_class):
3206 * API/JSObjectRef.cpp:
3207 (JSObjectGetProperty):
3208 (JSObjectGetPrivate):
3209 (JSObjectSetPrivate):
3210 (JSObjectCallAsFunction):
3211 (JSObjectCallAsConstructor):
3212 (JSPropertyEnumeratorGetNext):
3213 * API/JSObjectRef.h:
3214 * API/JSStringBufferRef.cpp:
3215 (JSStringBufferCreateCF):
3216 * API/JSStringBufferRef.h:
3217 * API/JSValueRef.cpp:
3218 (JSValueIsInstanceOf):
3224 (MyObject_hasProperty):
3225 (MyObject_setProperty):
3226 (MyObject_deleteProperty):
3227 (MyObject_getPropertyList):
3228 (MyObject_convertToType):
3231 * JavaScriptCore.exp:
3233 2006-07-07 Geoffrey Garen <ggaren@apple.com>
3237 - Fixed a few crashes resulting from NULL parameters to JSClassCreate.
3239 * API/JSClassRef.cpp:
3242 * API/testapi.c: Added test for NULL parameters.
3245 2006-07-07 Geoffrey Garen <ggaren@apple.com>
3247 Reviewed by John, mocked by Darin.
3249 - Changed JSEvaluate to take a JSObjectRef instead of a JSValueRef as
3250 "this," since "this" must be an object.
3252 * API/JSContextRef.cpp:
3254 * API/JSContextRef.h:
3256 2006-07-07 Geoffrey Garen <ggaren@apple.com>
3263 * JavaScriptCore.xcodeproj/project.pbxproj:
3265 2006-07-05 Geoffrey Garen <ggaren@apple.com>
3269 Renamed JSCharBufferRef, which was universally unpopular, to JSStringBufferRef,
3270 which, hopefully, will be less unpopular.
3276 * API/JSCallbackObject.cpp:
3277 (KJS::JSCallbackObject::getOwnPropertySlot):
3278 (KJS::JSCallbackObject::put):
3279 (KJS::JSCallbackObject::deleteProperty):
3280 (KJS::JSCallbackObject::staticValueGetter):
3281 (KJS::JSCallbackObject::callbackGetter):
3282 * API/JSCharBufferRef.cpp: Removed.
3283 * API/JSCharBufferRef.h: Removed.
3284 * API/JSContextRef.cpp:
3287 * API/JSContextRef.h:
3289 (JSNodePrototype_appendChild):
3290 (JSNode_getNodeType):
3291 (JSNode_getChildNodes):
3292 (JSNode_getFirstChild):
3294 (JSNodeList_length):
3295 (JSNodeList_getProperty):
3296 * API/JSObjectRef.cpp:
3297 (JSFunctionMakeWithBody):
3298 (JSObjectGetDescription):
3299 (JSObjectHasProperty):
3300 (JSObjectGetProperty):
3301 (JSObjectSetProperty):
3302 (JSObjectDeleteProperty):
3303 (JSPropertyEnumeratorGetNext):
3304 (JSPropertyListAdd):
3305 * API/JSObjectRef.h:
3306 * API/JSStringBufferRef.cpp: Added.
3308 (JSStringBufferCreate):
3309 (JSStringBufferCreateUTF8):
3310 (JSStringBufferRetain):
3311 (JSStringBufferRelease):
3312 (JSValueCopyStringValue):
3313 (JSStringBufferGetLength):
3314 (JSStringBufferGetCharactersPtr):
3315 (JSStringBufferGetCharacters):
3316 (JSStringBufferGetMaxLengthUTF8):
3317 (JSStringBufferGetCharactersUTF8):
3318 (JSStringBufferIsEqual):
3319 (JSStringBufferIsEqualUTF8):
3320 (JSStringBufferCreateWithCFString):
3321 (CFStringCreateWithJSStringBuffer):
3322 * API/JSStringBufferRef.h: Added.
3324 * API/JavaScriptCore.h:
3329 (assertEqualsAsUTF8String):
3330 (assertEqualsAsCharactersPtr):
3331 (assertEqualsAsCharacters):
3332 (MyObject_hasProperty):
3333 (MyObject_getProperty):
3334 (MyObject_setProperty):
3335 (MyObject_deleteProperty):
3336 (MyObject_getPropertyList):
3337 (print_callAsFunction):
3338 (myConstructor_callAsConstructor):
3340 * JavaScriptCore.exp:
3341 * JavaScriptCore.xcodeproj/project.pbxproj:
3343 2006-07-05 Geoffrey Garen <ggaren@apple.com>
3347 Moved some code around for more logical file separation.
3350 * API/JSContextRef.h:
3351 * API/JSObjectRef.cpp:
3352 * API/JSValueRef.cpp:
3356 2006-07-03 Geoffrey Garen <ggaren@apple.com>
3360 Implemented JSFunctionMakeWithBody, which parses a script as a function body
3361 in the global scope, and returns the resulting anonymous function.
3363 I also removed private data from JSCallbackFunction. It never worked,
3364 since JSCallbackFunction doesn't inherit from JSCallbackObject.
3366 * API/JSCallbackConstructor.cpp: Removed.
3367 * API/JSCallbackConstructor.h: Removed.
3368 * API/JSCallbackFunction.cpp:
3369 (KJS::JSCallbackFunction::JSCallbackFunction):
3370 (KJS::JSCallbackFunction::implementsConstruct):
3371 (KJS::JSCallbackFunction::construct):
3372 (KJS::JSCallbackFunction::implementsCall):
3373 (KJS::JSCallbackFunction::callAsFunction):
3374 * API/JSCallbackFunction.h:
3375 * API/JSCallbackObject.cpp:
3376 (KJS::JSCallbackObject::staticFunctionGetter):
3377 * API/JSObjectRef.cpp:
3379 (JSFunctionMakeWithCallbacks):
3380 * API/JSObjectRef.h:
3386 * JavaScriptCore.exp: Programmatically added all symbols exported by
3387 API object files, and sorted results
3388 * JavaScriptCore.xcodeproj/project.pbxproj:
3390 2006-07-03 Geoffrey Garen <ggaren@apple.com>
3394 - Return syntax error in JSCheckSyntax through a JSValueRef* exception
3398 * API/JSContextRef.cpp:
3402 * JavaScriptCore.exp:
3403 * kjs/interpreter.cpp:
3404 (KJS::Interpreter::checkSyntax):
3405 * kjs/interpreter.h:
3407 2006-07-04 Darin Adler <darin@apple.com>
3411 * wtf/MathExtras.h: Oops. Added missing #endif.
3413 2006-07-04 Bjoern Graf <bjoern.graf@gmail.com>
3416 Tweaked a bit by Darin.
3418 - http://bugs.webkit.org/show_bug.cgi?id=9678
3419 work around MSVCRT's fmod function returning NaN for fmod(x, infinity) instead of x
3421 * wtf/MathExtras.h: Added include of <float.h>.
3422 (isinf): Fix to return false for NAN.
3423 (wtf_fmod): Added. An inline that works around the bug.
3426 * kjs/number_object.cpp:
3427 * kjs/operations.cpp:
3429 Added includes of MathExtras.h to all files using fmod.
3431 * JavaScriptCore.xcodeproj/project.pbxproj: Let Xcode 2.3 have its way with
3434 2006-07-01 Geoffrey Garen <ggaren@apple.com>
3438 - Refined value conversions in the API:
3439 - failed toNumber returns NaN
3440 - failed toObject returns NULL
3441 - failed toString returns empty string
3443 - Refined excpetion handling in the API:
3444 - failed value conversions do not throw exceptions
3445 - uncaught exceptions in JSEvaluate, JSObjectCallAsFunction, and
3446 JSObjectCallAsConstructor are returned through a JSValueRef* exception
3448 - removed JSContextHasException, because JSContextGetException does
3452 * API/JSCharBufferRef.cpp:
3453 (JSValueCopyStringValue):
3454 * API/JSContextRef.cpp:
3456 * API/JSContextRef.h:
3457 * API/JSNodeList.c: Added test code demonstrating how you would use
3458 toNumber, and why you probably don't need toUInt32, etc.
3459 (JSNodeListPrototype_item):
3460 (JSNodeList_getProperty):
3461 * API/JSObjectRef.cpp:
3463 (JSObjectCallAsFunction):
3464 (JSObjectCallAsConstructor):
3465 * API/JSObjectRef.h:
3466 * API/JSValueRef.cpp:
3472 (main): Added tests for new rules, and call to JSGCProtect to fix Intel
3474 * JavaScriptCore.exp:
3476 2006-07-03 Darin Adler <darin@apple.com>
3478 - Rolled out HashMap implementation of NPRuntime, at least temporarily.
3480 Fixes hang in the bindings section of layout tests seen on the
3483 This code was using HashMap<const char*, PrivateIdentifier*>.
3484 But that hashes based on pointer identity, not string value.
3485 The default hash for any pointer type is to hash based on the pointer.
3486 And WTF doesn't currently have a string hash for char*.
3487 We'll need to fix that before re-landing this patch.
3489 (Formatting was also incorrect -- extra spaces in parentheses.)
3491 * bindings/npruntime.cpp: Rolled out last change.
3493 2006-07-02 Justin Haygood <jhaygood@spsu.edu>
3495 Reviewed, tweaked, landed by ggaren.
3497 - Port NPRuntime from CFDictionary to HashMap.
3499 * bindings/npruntime.cpp:
3500 (getStringIdentifierDictionary):
3501 (getIntIdentifierDictionary):
3502 (_NPN_GetStringIdentifier):
3503 (_NPN_GetIntIdentifier):
3504 * bindings/npruntime.h:
3506 2006-07-01 Geoffrey Garen <ggaren@apple.com>
3510 - Fixed <rdar://problem/4611197> REGRESSION: Liveconnect with Java test
3511 fails at http://www-sor.inria.fr/~dedieu/notes/liveconnect/simple_example.html
3513 * JavaScriptCore.exp: Export symbols used by liveconnect
3515 2006-06-29 Geoffrey Garen <ggaren@apple.com>
3519 - Phase 2 in the JS API.
3521 - Added support for specifying static tables of values -- this should
3522 obviate the need for using complicated callbacks for most lookups.
3524 - API objects are now created with classes (JSClassRef) -- in order to support
3525 static values, and in order to prevent API objects from storing their
3526 data inline, and thus falling into the oversized (read: slow and prone to
3527 giving Maciej the frowny face) heap.
3529 - Added two specialized JSObject subclasses -- JSCallbackFunction and JSCallbackConstructor --
3530 to allow JSFunctionMake and JSConstructorMake to continue to work with
3531 the new class model. Another solution to this problem would be to create
3532 a custom class object for each function and constructor you make. This
3533 solution is more code but also more efficient.
3535 - Substantially beefed up the minidom example to demonstrate and test a
3536 lot of these techniques. Its output is still pretty haphazard, though.
3538 - Gave the <kjs/ preface to some includes -- I'm told this matters to
3539 building on some versions of Linux.
3541 - Implemented JSValueIsInstanceOf and JSValueIsObjectOfClass
3543 - Removed GetDescription callback. Something in the class datastructure
3544 should take care of this.
3547 * API/JSCallbackConstructor.cpp: Added.
3549 (KJS::JSCallbackConstructor::JSCallbackConstructor):
3550 (KJS::JSCallbackConstructor::implementsConstruct):
3551 (KJS::JSCallbackConstructor::construct):
3552 (KJS::JSCallbackConstructor::setPrivate):
3553 (KJS::JSCallbackConstructor::getPrivate):
3554 * API/JSCallbackConstructor.h: Added.
3555 (KJS::JSCallbackConstructor::classInfo):
3556 * API/JSCallbackFunction.cpp: Added.
3558 (KJS::JSCallbackFunction::JSCallbackFunction):
3559 (KJS::JSCallbackFunction::implementsCall):
3560 (KJS::JSCallbackFunction::callAsFunction):
3561 (KJS::JSCallbackFunction::setPrivate):
3562 (KJS::JSCallbackFunction::getPrivate):
3563 * API/JSCallbackFunction.h: Added.
3564 (KJS::JSCallbackFunction::classInfo):
3565 * API/JSCallbackObject.cpp:
3567 (KJS::JSCallbackObject::JSCallbackObject):
3568 (KJS::JSCallbackObject::init):
3569 (KJS::JSCallbackObject::~JSCallbackObject):
3570 (KJS::JSCallbackObject::className):
3571 (KJS::JSCallbackObject::getOwnPropertySlot):
3572 (KJS::JSCallbackObject::put):
3573 (KJS::JSCallbackObject::deleteProperty):
3574 (KJS::JSCallbackObject::implementsConstruct):
3575 (KJS::JSCallbackObject::construct):
3576 (KJS::JSCallbackObject::implementsCall):
3577 (KJS::JSCallbackObject::callAsFunction):
3578 (KJS::JSCallbackObject::getPropertyList):
3579 (KJS::JSCallbackObject::toBoolean):
3580 (KJS::JSCallbackObject::toNumber):
3581 (KJS::JSCallbackObject::toString):
3582 (KJS::JSCallbackObject::inherits):
3583 (KJS::JSCallbackObject::staticValueGetter):
3584 (KJS::JSCallbackObject::staticFunctionGetter):
3585 (KJS::JSCallbackObject::callbackGetter):
3586 * API/JSCallbackObject.h:
3587 * API/JSCharBufferRef.cpp:
3588 * API/JSClassRef.cpp: Added.