1 2006-11-17 Anders Carlsson <acarlsson@apple.com>
5 Make sure that we always use std::min and std::max instead of macros.
7 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
13 2006-11-12 Geoffrey Garen <ggaren@apple.com>
15 Reviewed by Beth Dakin.
17 Added project-wide setting to disable Microsoft's made-up deprecation
18 warnings related to std:: functions. (Doesn't have any affect yet,
19 since we currently disable all deprecation warnings.)
21 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
23 2006-11-12 Mark Rowe <bdash@webkit.org>
27 Clean up of JavaScriptCore bakefiles.
29 * JavaScriptCoreSources.bkl:
32 2006-11-11 Alexey Proskuryakov <ap@webkit.org>
36 http://bugs.webkit.org/show_bug.cgi?id=11508
37 Undisable some warnings for JSImmediate.h
39 Fix suggested by Don Gibson.
42 Re-enable all MSVC warnings, move the remaining runtime checks
45 2006-11-10 Zalan Bujtas <zalan.bujtas@nokia.com>
49 Added s60/symbian platform defines.
50 http://bugs.webkit.org/show_bug.cgi?id=11540
56 2006-11-08 Ada Chan <adachan@apple.com>
60 Added a method to delete all the keys in a HashMap.
63 (WTF::deleteAllPairFirsts):
66 2006-11-07 Anders Carlsson <acarlsson@apple.com>
71 (OpaqueJSClass::OpaqueJSClass):
72 Initialize cachedPrototype to 0.
74 2006-11-06 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
78 Remove warning about garbage after #else. #else clause applies for all
79 non-mac platforms, not only win.
81 * kjs/date_object.cpp:
83 2006-11-06 Mark Rowe <bdash@webkit.org>
85 Reviewed by the wonderful Mitz Pettel.
87 http://bugs.webkit.org/show_bug.cgi?id=11524
88 Bug 11524: REGRESSION(r9842): Array.prototype.join should use ToString operator rather than calling toString on each element
90 * kjs/array_object.cpp:
91 (ArrayProtoFunc::callAsFunction): Use ToString operator on each element rather than calling their toString method.
93 2006-11-03 Steve Falkenburg <sfalken@apple.com>
99 2006-11-03 Alexey Proskuryakov <ap@nypop.com>
103 http://bugs.webkit.org/show_bug.cgi?id=11504
104 Fix warnings on non 32 bit platforms
107 (KJS::JSImmediate::NanAsBits):
108 (KJS::JSImmediate::oneAsBits):
109 Rewrite in a way that moves runtime checks to compile-time.
112 (KJS::JSImmediate::fromDouble):
113 (KJS::JSImmediate::toDouble):
115 2006-11-02 George Staikos <staikos@kde.org>
120 Remove a deprecated pthreads call.
122 2006-11-02 Anders Carlsson <acarlsson@apple.com>
124 Reviewed by Maciej, landed by Anders.
127 Make KDE support optional.
129 2006-11-01 Kevin McCullough <KMcCullough@apple.com>
133 - 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.
136 (KJS::equivalentYearForDST):
137 (KJS::getDSTOffsetSimple):
140 2006-10-31 Geoffrey Garen <ggaren@apple.com>
144 Fixed http://bugs.webkit.org/show_bug.cgi?id=11477
145 REGRESSION: GMail crashes in KJS::FunctionImp::callerGetter
148 (KJS::FunctionImp::argumentsGetter): Removed unnecessary braces.
149 (KJS::FunctionImp::callerGetter): More logical NULL checking.
151 2006-10-31 Oliver Hunt <oliver@apple.com>
155 Adding definition for PLATFORM(CI)
159 2006-10-31 Vladimir Olexa <vladimir.olexa@gmail.com>
163 http://bugs.webkit.org/show_bug.cgi?id=4166
164 Function object does not support caller property
166 Test: fast/js/caller-property.html
169 (KJS::FunctionImp::callerGetter): added
170 (KJS::FunctionImp::getOwnPropertySlot): added if statement to handle callerGetter()
171 * kjs/function.h: added callerGetter() declaration
172 * kjs/identifier.h: added caller property macro
173 * tests/mozilla/expected.html:
175 2006-10-30 Kevin McCullough <KMcCullough@apple.com>
179 - Fix some timezone issues and JavaScriptCore date tests. Addresses bugzilla 4930.
182 (KJS::GregorianDateTime::GregorianDateTime): Here's the fix, to add parenthesis for order of precedence.
183 * kjs/date_object.cpp:
184 (KJS::DateProtoFunc::callAsFunction):
185 (KJS::DateObjectImp::construct): memset not needed as GregorianDateTime initializes itself.
187 2006-10-30 Darin Adler <darin@apple.com>
189 Reviewed by John Sullivan.
191 * kjs/SavedBuiltins.h: Added needed include.
192 * wtf/OwnPtr.h: (WTF::OwnPtr::set): Fixed mistake in assertion.
194 2006-10-28 Darin Adler <darin@apple.com>
198 - renamed PassRefPtr::release to releaseRef to make it clearer that
199 it's the counterpart of adoptRef, and to make it harder to confuse
200 it with the safer-to-use RefPtr::release
202 * kjs/identifier.cpp:
203 (KJS::CStringTranslator::translate):
204 (KJS::UCharBufferTranslator::translate):
206 (KJS::UString::Rep::create):
208 (WTF::PassRefPtr::PassRefPtr):
209 (WTF::PassRefPtr::~PassRefPtr):
210 (WTF::PassRefPtr::get):
211 (WTF::PassRefPtr::releaseRef):
212 (WTF::PassRefPtr::operator->):
213 (WTF::PassRefPtr::operator=):
215 (WTF::static_pointer_cast):
216 (WTF::const_pointer_cast):
218 (WTF::RefPtr::RefPtr):
219 (WTF::RefPtr::operator=):
221 2006-10-28 Darin Adler <darin@apple.com>
225 * kjs/grammar.y: Add definitions of YYMALLOC and YYFREE to fix
226 a warning some people see (not sure why others don't see it).
228 * JavaScriptCore.vcproj/JavaScriptCore/grammarWrapper.cpp: Touch
229 this file to force it to re-build grammar.cpp.
231 2006-10-28 Darin Adler <darin@apple.com>
235 - made changes so the code compiles with the highest warning level
236 under MSVC (disabling some warnings, making some code fixes)
238 * API/JSCallbackConstructor.cpp:
239 (KJS::JSCallbackConstructor::construct):
240 * API/JSCallbackFunction.cpp:
241 (KJS::JSCallbackFunction::callAsFunction):
242 * API/JSCallbackObject.cpp:
243 (KJS::JSCallbackObject::init):
244 (KJS::JSCallbackObject::construct):
245 (KJS::JSCallbackObject::callAsFunction):
246 * API/JSObjectRef.cpp:
247 (JSPropertyNameArrayGetNameAtIndex):
248 * API/JSStringRef.cpp:
249 (JSStringCreateWithCharacters):
250 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
251 * bindings/c/c_utility.cpp:
252 (KJS::Bindings::convertUTF8ToUTF16):
253 (KJS::Bindings::coerceValueToNPVariantStringType):
254 (KJS::Bindings::convertValueToNPVariant):
256 (KJS::GregorianDateTime::GregorianDateTime):
258 (KJS::ExecState::hadException):
260 (KJS::JSImmediate::fromDouble):
261 (KJS::JSImmediate::toDouble):
262 (KJS::JSImmediate::NanAsBits):
263 (KJS::JSImmediate::oneAsBits):
265 * kjs/PropertyNameArray.h:
266 (KJS::PropertyNameArray::size):
267 * kjs/array_object.cpp:
268 (ArrayObjectImp::callAsFunction):
269 * kjs/bool_object.cpp:
270 (BooleanObjectImp::callAsFunction):
272 (KJS::Collector::allocate):
273 (KJS::Collector::markCurrentThreadConservatively):
274 (KJS::Collector::collect):
276 (KJS::Completion::isValueCompletion):
277 * kjs/date_object.cpp:
280 (Debugger::sourceParsed):
281 (Debugger::sourceUnused):
282 (Debugger::exception):
283 (Debugger::atStatement):
284 (Debugger::callEvent):
285 (Debugger::returnEvent):
287 * kjs/error_object.cpp:
288 (ErrorObjectImp::callAsFunction):
289 (NativeErrorImp::callAsFunction):
291 (KJS::FunctionImp::processVarDecls):
292 (KJS::GlobalFuncImp::callAsFunction):
293 * kjs/function_object.cpp:
294 (FunctionPrototype::callAsFunction):
296 * kjs/identifier.cpp:
297 (KJS::CStringTranslator::translate):
298 (KJS::Identifier::add):
302 (Lexer::isIdentStart):
303 (Lexer::isIdentPart):
306 (Lexer::isOctalDigit):
307 (Lexer::matchPunctuator):
308 (Lexer::singleEscape):
309 (Lexer::convertOctal):
311 (Lexer::convertUnicode):
314 * kjs/math_object.cpp:
315 (MathFuncImp::callAsFunction):
316 * kjs/number_object.cpp:
317 (integer_part_noexp):
319 (NumberProtoFunc::callAsFunction):
320 (NumberObjectImp::callAsFunction):
322 (KJS::JSObject::deleteProperty):
323 (KJS::JSObject::callAsFunction):
324 (KJS::JSObject::toBoolean):
325 (KJS::JSObject::toObject):
327 (KJS::JSObject::getPropertySlot):
328 * kjs/property_map.cpp:
330 (KJS::PropertyMap::put):
331 (KJS::PropertyMap::insert):
332 (KJS::PropertyMap::containsGettersOrSetters):
333 * kjs/property_map.h:
334 (KJS::PropertyMap::hasGetterSetterProperties):
335 * kjs/property_slot.h:
336 * kjs/string_object.cpp:
337 (StringInstance::getPropertyNames):
338 (StringObjectImp::callAsFunction):
339 (StringObjectFuncImp::callAsFunction):
341 (KJS::UString::Rep::computeHash):
342 (KJS::UString::UString):
343 (KJS::UString::from):
344 (KJS::UString::append):
345 (KJS::UString::ascii):
346 (KJS::UString::operator=):
347 (KJS::UString::find):
348 (KJS::UString::rfind):
352 (KJS::UCharReference::low):
353 (KJS::UCharReference::high):
355 (KJS::JSValue::toUInt16):
357 * pcre/pcre_compile.c:
358 (get_othercase_range):
361 * pcre/pcre_internal.h:
362 * wtf/HashFunctions.h:
364 (WTF::PtrHash::hash):
369 * wtf/StringExtras.h:
371 * wtf/unicode/icu/UnicodeIcu.h:
372 (WTF::Unicode::isPrintableChar):
374 2006-10-26 W. Andy Carrel <wac@google.com>
378 - Fix http://bugs.webkit.org/show_bug.cgi?id=7445 /
379 <rdar://problem/4614195> (and 7253 / <rdar://4694011>) by changing
380 inline regexps so that they can have \u escaped Unicode sequences and
386 (Lexer::shift): Looking ahead one additional character for the benefit
388 (Lexer::scanRegExp): Change code to support unicode escapes in inline
390 * kjs/lexer.h: Extra lookahead added.
392 === Safari-521.29 ===
394 2006-10-26 Nikolas Zimmermann <zimmermann@kde.org>
398 Fix build with older gcc 3.3.4.
400 * kjs/DateMath.cpp: Remove inline prefix.
401 (KJS::equivalentYearForDST):
403 2006-10-26 Darin Adler <darin@apple.com>
407 - fix iteration of properties of string objects (found because of a warning
408 emitted by the MSVC compiler)
410 * kjs/string_object.cpp: (StringInstance::getPropertyNames): Change code that
411 wants to format a number as a string to use UString::from. Before it was using
412 the UString constructor that makes a string from a character!
415 * kjs/ustring.cpp: Remove the dangerous and not all that helpful UString(char)
418 * kjs/grammar.y: Change code to not depend on the UString(char) constructor.
419 This is potentially more efficient anyway because we could overload the + operator
420 some day to handle char* directly instead of creating a UString.
422 * kjs/nodes2string.cpp: (SourceStream::operator<<): Change code to not depend on
423 the UString(char) constructor.
425 2006-10-25 Kevin McCullough <KMcCullough@apple.com>
427 Reviewed by Steve (rubber stamp).
429 - Link against your local build of JavaScriptCore.lib first, this fixes some errors on release builds of testkjs.
431 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
433 2006-10-25 Geoffrey Garen <ggaren@apple.com>
437 Removed duplicate symbol declaration.
439 * JavaScriptCore.xcodeproj/project.pbxproj:
442 2006-10-24 Steve Falkenburg <sfalken@apple.com>
446 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
448 2006-10-24 Kevin McCullough <KMcCullough@apple.com>
452 - 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.
454 * kjs/date_object.cpp:
456 (KJS::formatLocaleDate):
457 (KJS::DateProtoFunc::callAsFunction):
459 2006-10-23 Kevin McCullough <KMcCullough@apple.com>
465 * JavaScriptCore.xcodeproj/project.pbxproj:
468 2006-10-23 Kevin McCullough <KMcCullough@apple.com>
472 - Makes the toTM function an operator. Was going to piggy back on a patch but the patch needs more work.
475 (KJS::equivalentYearForDST):
477 (KJS::GregorianDateTime::operator tm):
478 * kjs/date_object.cpp:
480 (KJS::DateProtoFunc::callAsFunction):
482 2006-10-23 Kevin McCullough <KMcCullough@apple.com>
486 - 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).
491 2006-10-21 Steve Falkenburg <sfalken@apple.com>
495 Add minimal compatibility with MSVCRT leak checker
499 2006-10-23 Kevin McCullough <KMcCullough@apple.com>
503 - Sets the lowercase range correctly in the test and consolidates a variable to make the test more readable.
505 * tests/mozilla/ecma/String/15.5.4.11-2.js:
507 2006-10-21 Darin Adler <darin@apple.com>
511 - http://bugs.webkit.org/show_bug.cgi?id=11377
512 swap(Vector, Vector) should be O(1) instead of O(n)
515 (WTF::VectorBuffer::swap): Added.
516 (WTF::Vector::swap): Added.
517 (WTF::swap): Added overload that takes two Vector objects.
519 2006-10-21 Darin Adler <darin@apple.com>
523 - http://bugs.webkit.org/show_bug.cgi?id=11376
524 build scripts should invoke make with "-j" option for multiple processors
526 * JavaScriptCore.xcodeproj/project.pbxproj: Pass -j `sysctl -n hw.ncpu` to make.
528 2006-10-19 Kevin McCullough <KMcCullough@apple.com>
532 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.
533 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.
535 * tests/mozilla/ecma/String/15.5.4.11-2.js:
537 2006-10-18 Maciej Stachowiak <mjs@apple.com>
541 - remove vestiges of KXMLCore name (former name of WTF).
549 * wtf/FastMallocInternal.h:
552 * wtf/HashCountedSet.h:
553 * wtf/HashFunctions.h:
566 * wtf/StringExtras.h:
570 * wtf/VectorTraits.h:
572 2006-10-17 Steve Falkenburg <sfalken@apple.com>
578 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
580 2006-10-17 Kevin McCullough <KMcCullough@apple.com>
584 Fixed a date issue where the UTC offset was not set in win.
587 (KJS::getDSTOffsetSimple):
589 (KJS::msToGregorianDateTime):
592 (KJS::GregorianDateTime::GregorianDateTime):
594 2006-10-17 Kevin McCullough <KMcCullough@apple.com>
598 Fixes a JavaScriptCore math issue on win.
600 * kjs/math_object.cpp:
601 (MathFuncImp::callAsFunction):
605 2006-10-16 Kevin McCullough <kmccullough@apple.com>
609 Removed unecessary global specifiers.
611 * kjs/math_object.cpp:
612 (MathFuncImp::callAsFunction):
614 2006-10-16 Kevin McCullough <KMcCullough@apple.com>
618 Fixes a compile order issue for testkjs on win.
620 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
622 2006-10-15 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
626 Remove junk (as gcc calls it) after #else clause.
628 * wtf/FastMalloc.cpp:
631 2006-10-14 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
635 Define KXMLCORE_USE_CURL for platforms that wish to use CURL as
636 networking, and set it for GDK build
640 2006-10-13 Marvin Decker <marv.decker@gmail.com>
642 Reviewed by Kevin McCullough.
644 Fixes http://bugs.webkit.org/show_bug.cgi?id=11283
645 Fixes Qt/Linux and Windows build
649 * kjs/date_object.cpp:
650 (KJS::DateProtoFunc::callAsFunction):
652 2006-10-13 Kevin McCullough <KMcCullough@apple.com>
654 Reviewed by Adam, Geoff, Darin.
656 Fixed displaying the UTC offset and time zone string, as well as renamed the GregorianDateTime structure and clean up.
661 (KJS::getDSTOffsetSimple):
662 (KJS::gregorianDateTimeToMS):
663 (KJS::msToGregorianDateTime):
665 (KJS::GregorianDateTime::GregorianDateTime):
666 (KJS::GregorianDateTime::~GregorianDateTime):
667 (KJS::GregorianDateTime::toTM):
668 * kjs/date_object.cpp:
671 (KJS::formatDateUTCVariant):
673 (KJS::fillStructuresUsingTimeArgs):
674 (KJS::fillStructuresUsingDateArgs):
675 (KJS::DateInstance::getTime):
676 (KJS::DateInstance::getUTCTime):
677 (KJS::DateProtoFunc::callAsFunction):
678 (KJS::DateObjectImp::construct):
679 (KJS::DateObjectImp::callAsFunction):
680 (KJS::DateObjectFuncImp::callAsFunction):
684 2006-10-13 Kevin McCullough <KMcCullough@apple.com>
688 Gets JavaScripCore tests running on windows.
690 * Scripts/run-javascriptcore-tests:
691 * Scripts/webkitdirs.pm:
693 2006-10-12 Geoffrey Garen <ggaren@apple.com>
697 Removed JSObjectMakeWithPrototype, clarified some comments. We really
698 don't want people to manage their own prototypes, so we don't want an
699 extra function in the API devoted to just that. People can still manage
700 their own prototypes if they really want by using JSObjectSetPrototype.
702 * API/JSClassRef.cpp:
703 (OpaqueJSClass::createNoAutomaticPrototype):
704 (OpaqueJSClass::create):
706 * API/JSObjectRef.cpp:
712 * JavaScriptCore.exp:
714 2006-10-12 Kevin McCullough <KMcCullough@apple.com>
722 * kjs/date_object.cpp:
725 2006-10-11 Kevin McCullough <KMcCullough@apple.com>
729 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.
734 (KJS::getDSTOffsetSimple):
740 * kjs/date_object.cpp:
743 (KJS::DateProtoFunc::callAsFunction):
744 (KJS::DateObjectImp::construct):
745 (KJS::DateObjectImp::callAsFunction):
746 (KJS::DateObjectFuncImp::callAsFunction):
750 2006-10-09 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
754 Improve gdk build compiler flags (show warning, no rtti and exceptions).
758 2006-10-06 Kevin McCullough <KMcCullough@apple.com>
762 DST and TimeZones were wrong in some cases, specifically on some of the dates where DST changes.
765 (KJS::equivalentYearForDST):
767 (KJS::getDSTOffsetSimple):
769 (KJS::dateToMseconds):
772 * kjs/date_object.cpp:
775 2006-10-05 Darin Adler <darin@apple.com>
777 Reviewed by Kevin McCullough.
779 * wtf/Assertions.cpp: Fix build when _DEBUG is not defined.
781 2006-10-04 Kevin McCullough <KMcCullough@apple.com>
785 - 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.
790 * kjs/date_object.cpp:
794 2006-10-04 Geoffrey Garen <ggaren@apple.com>
796 Patch by Darin and me, reviewed by Maciej.
798 Fixed <rdar://problem/4518397> REGRESSION(?): Oft-seen but unrepro crash
799 in JavaScript garbage collection (KJS::Collector::collect())
800 <rdar://problem/4752492> Crash in KJS::collect
802 The issue here was allocating one garbage-collected object in the midst
803 of allocating a second garbage-collected object. In such a case, the
804 zeroIfFree word lies.
807 (KJS::Collector::allocate):
808 (KJS::Collector::collect):
810 2006-10-04 Kevin McCullough <KMcCullough@apple.com>
817 (KJS::dateToDayInYear): accept and correctly handle negative months
819 2006-10-05 Kevin McCullough <KMcCullough@apple.com>
824 (KJS::dateToDayInYear):
826 2006-10-05 Mark Rowe <bdash@webkit.org>
828 Reviewed by maculloch.
832 * JavaScriptCoreSources.bkl: Add DateMath.cpp to file list.
834 2006-10-05 Kevin McCullough <KMcCullough@apple.com>
840 * JavaScriptCore.xcodeproj/project.pbxproj:
842 2006-10-04 Nikolas Zimmermann <zimmermann@kde.org>
846 Fix Qt/Linux build by adding DateMath.cpp to compilation.
848 * CMakeLists.txt: Also replace tabs with spaces.
850 2006-10-04 Kevin McCullough <KMcCullough@apple.com>
852 Reviewed by DethBakin.
854 - 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.
859 (KJS::dateToDayInYear):
861 2006-10-05 Darin Adler <darin@apple.com>
865 * wtf/Assertions.cpp: Changed assertion formatting to omit the "======"
866 lines so you can see more assertions in less space. Also improved format
867 of file/line information so it works with more development environments.
869 2006-10-04 Kevin McCullough <KMcCullough@apple.com>
873 - The build machine is more sensitive about automatic conversions. These fixes exp
874 licitly cast or change the input and return types of functions to avoid conversions.
876 * JavaScriptCore.xcodeproj/project.pbxproj:
882 (KJS::monthToDayInYear):
883 (KJS::dateToDayInYear):
884 (KJS::getDSTOffsetSimple):
886 (KJS::dateToMseconds):
889 2006-10-04 Kevin McCullough <KMcCullough@apple.com>
893 - 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.
895 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
896 * JavaScriptCore.xcodeproj/project.pbxproj:
897 * kjs/DateMath.cpp: Added.
900 (KJS::daysFrom1970ToYear):
901 (KJS::msFrom1970ToYear):
907 (KJS::msToMilliseconds):
913 (KJS::msToDayInMonth):
914 (KJS::monthToDayInYear):
915 (KJS::timeToMseconds):
916 (KJS::dateToDayInYear):
917 (KJS::equivalentYearForDST):
919 (KJS::getDSTOffsetSimple):
921 (KJS::localTimeToUTC):
922 (KJS::UTCToLocalTime):
923 (KJS::dateToMseconds):
926 * kjs/DateMath.h: Added.
928 * kjs/date_object.cpp:
931 (KJS::DateInstance::getTime):
932 (KJS::DateInstance::getUTCTime):
933 (KJS::DateProtoFunc::callAsFunction):
934 (KJS::DateObjectImp::construct):
935 (KJS::DateObjectFuncImp::callAsFunction):
940 2006-10-02 Nikolas Zimmermann <zimmermann@kde.org>
942 Reviewed/landed by Adam.
944 Build testkjs on Qt/Linux.
948 2006-10-02 Nikolas Zimmermann <zimmermann@kde.org>
950 Reviewed by eseidel. Landed by eseidel.
952 Fix win32 build, which has no inttypes.h
956 2006-10-02 Nikolas Zimmermann <zimmermann@kde.org>
958 Reviewed by eseidel & mjs. Landed by eseidel.
960 Fix Qt/Linux build with older gcc 3.3.4.
961 http://bugs.webkit.org/show_bug.cgi?id=11116
963 * kjs/lookup.h: Move cacheGlobalObject into KJS namespace.
964 (KJS::cacheGlobalObject): Also remove GCC_ROOT_NS_HACK.
965 * wtf/Assertions.h: Include inttypes.h for uintptr_t.
967 2006-09-28 Steve Falkenburg <sfalken@apple.com>
971 Use $(ConfigSuffix) set via vsprops files to add _debug
972 to end of debug filenames.
974 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
975 * JavaScriptCore.vcproj/debug.vsprops: Added.
976 * JavaScriptCore.vcproj/dftables/dftables.vcproj:
977 * JavaScriptCore.vcproj/release.vsprops: Added.
978 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
980 2006-09-28 Darin Adler <darin@apple.com>
984 - support for change that should fix <rdar://problem/4733044>
985 REGRESSION: XML iBench shows 10% perf. regression (copying
986 strings while decoding)
988 * wtf/Vector.h: Changed VectorBuffer so that the general case
989 contains an instance of the 0 case, since deriving from it
990 was violating the Liskov Substitution Principle.
991 (WTF::VectorBuffer::releaseBuffer): Added. Releases the buffer so it can
992 be adopted by another data structure that uses the FastMalloc.h allocator.
993 Returns 0 if the internal buffer was being used.
994 (WTF::Vector::releaseBuffer): Added. Releases the buffer as above or creates
995 a new one in the case where the internal buffer was being used.
997 2006-09-28 Maciej Stachowiak <mjs@apple.com>
1001 - change garbage collection to happen at increments proportional to number of live objects, not always
1002 every 1000 allocations
1004 * kjs/collector.cpp:
1005 (KJS::Collector::allocate):
1007 2006-09-28 Maciej Stachowiak <mjs@apple.com>
1011 - fixed REGRESSION (r16606): javascriptCore Crash on website load
1015 - fixed some possible off-by-one bugs
1016 - use indexing, not iterators, for Vectors
1017 - store Vector by pointer instead of by value to avoid blowing out FunctionImp size
1020 (KJS::FunctionImp::addParameter):
1021 (KJS::FunctionImp::parameterString):
1022 (KJS::FunctionImp::processParameters):
1023 (KJS::FunctionImp::lengthGetter):
1024 (KJS::FunctionImp::getParameterName):
1027 2006-09-27 Steve Falkenburg <sfalken@apple.com>
1033 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1034 * JavaScriptCore.vcproj/JavaScriptCore/dstroot-to-sdk.cmd: Removed.
1036 2006-09-27 John Sullivan <sullivan@apple.com>
1039 (KJS::FunctionImp::getParameterName):
1040 removed assertion that displeased gcc 4.0.1 (build 5420):
1041 ASSERT(static_cast<size_t>(index) == index);
1043 2006-09-27 Kevin McCullough <KMcCullough@apple.com>
1047 Cleanup of previous fix which was to address Radar: 4752492
1050 (KJS::FunctionImp::addParameter):
1051 (KJS::FunctionImp::parameterString):
1052 (KJS::FunctionImp::processParameters):
1053 (KJS::FunctionImp::lengthGetter):
1054 (KJS::FunctionImp::getParameterName):
1057 2006-09-27 Kevin McCullough <KMcCullough@apple.com>
1061 Fixes a GC stack overflow crash.
1062 The change is to move from a linked list implementation of Parameters to a Vector.
1063 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.
1066 (KJS::Parameter::Parameter):
1067 (KJS::FunctionImp::addParameter):
1068 (KJS::FunctionImp::parameterString):
1069 (KJS::FunctionImp::processParameters):
1070 (KJS::FunctionImp::lengthGetter):
1071 (KJS::FunctionImp::getParameterName):
1074 2006-09-27 Steve Falkenburg <sfalken@apple.com>
1078 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1080 2006-09-27 Steve Falkenburg <sfalken@apple.com>
1082 Set path before build.
1084 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1086 2006-09-27 Sean Gies <seangies@apple.com>
1088 Reviewed by Adam Roben.
1090 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Debug config should link to debug runtime.
1091 * JavaScriptCore.vcproj/dftables/dftables.vcproj: Debug config should link to debug runtime.
1093 2006-09-27 Don Melton <gramps@apple.com>
1095 Reviewed by Adam Roben.
1097 Changed line ending from DOS to UNIX format so it doesn't die running
1100 * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
1102 2006-09-23 Alexey Proskuryakov <ap@nypop.com>
1106 http://bugs.webkit.org/show_bug.cgi?id=10183
1107 REGRESSION: obfuscated JS decoding breaks because of soft hyphen removal
1108 (Fanfiction.net author pages not listing stories)
1110 Rolled out the fix for bug 4139.
1115 * tests/mozilla/ecma/Array/15.4.5.1-1.js:
1116 * tests/mozilla/expected.html:
1118 2006-09-22 Steve Falkenburg <sfalken@apple.com>
1122 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1124 2006-09-22 Darin Adler <darin@apple.com>
1128 * wtf/Vector.h: Add an append that takes a pointer and length.
1129 Generalize the existing Vector append to work on vectors with
1130 any value for inlineCapacity. Change the append algorithm so
1131 it doesn't check capacity each time through the loop.
1133 2006-09-22 Steve Falkenburg <sfalken@apple.com>
1137 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1139 2006-09-21 Geoffrey Garen <ggaren@apple.com>
1143 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1144 Updated to include the right path.
1145 * wtf/FastMalloc.h: #include Platform.h, since we use Platform macros.
1147 === Safari-521.27 ===
1149 2006-09-20 Anders Carlsson <acarlsson@apple.com>
1151 Reviewed by Dave Hyatt.
1156 2006-09-20 Sean Gies <seangies@apple.com>
1158 Reviewed by Steve Falkenburg.
1160 * wtf/Assertions.cpp: Debug messages should go into debugger console.
1162 2006-09-20 David Hyatt <hyatt@apple.com>
1164 Add an implementation of lrint for Win32.
1171 2006-09-15 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
1175 http://bugs.webkit.org/show_bug.cgi?id=10864
1176 Bug 10864: Linux\GDK build fixes
1178 * JavaScriptCoreSources.bkl:
1181 2006-09-15 Adam Roben <aroben@apple.com>
1185 * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
1187 2006-09-15 Anders Carlsson <acarlsson@apple.com>
1189 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1190 Fix the release build.
1192 2006-09-15 Anders Carlsson <acarlsson@apple.com>
1196 Add JavaScriptCore API to the build.
1198 * API/JSCallbackConstructor.cpp:
1199 * API/JSCallbackFunction.cpp:
1200 * API/JSCallbackObject.cpp:
1201 * API/JSClassRef.cpp:
1202 * API/JSContextRef.cpp:
1203 * API/JSObjectRef.cpp:
1204 * API/JSStringRef.cpp:
1205 * API/JSValueRef.cpp:
1206 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1207 * os-win32/stdbool.h: Added.
1209 2006-09-12 Steve Falkenburg <sfalken@apple.com>
1213 Build tweaks (doing JavaScriptCore now since it doesn't have
1216 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1217 * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
1218 * JavaScriptCore.vcproj/JavaScriptCore/dstroot-to-sdk.cmd: Added.
1219 * JavaScriptCore.vcproj/dftables/dftables.vcproj:
1220 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
1222 2006-09-11 Brady Eidson <beidson@apple.com>
1224 Build fix - I think Tim's last checkin wasn't tested on Tiger, possibly. I simply
1225 commented out the undefined constants until he can have a chance to make the right call
1227 * bindings/objc/objc_utility.mm:
1228 (KJS::Bindings::objcValueTypeForType): Commented out undefined symbols
1230 2006-09-11 Timothy Hatcher <timothy@apple.com>
1232 Reviewed by Tim O. and Darin.
1234 Add support for more method signatures affecting ObjC methods called from JavaScript:
1235 - Added unsigned types and long long.
1236 - Allow methods that use const, oneway, bycopy and byref type modifiers.
1238 * bindings/objc/objc_instance.mm:
1239 (ObjcInstance::invokeMethod):
1240 * bindings/objc/objc_utility.h:
1242 * bindings/objc/objc_utility.mm:
1243 (KJS::Bindings::convertValueToObjcValue):
1244 (KJS::Bindings::convertObjcValueToValue):
1245 (KJS::Bindings::objcValueTypeForType):
1247 2006-09-05 Timothy Hatcher <timothy@apple.com>
1251 <rdar://problem/4715840> SEL is not char*
1253 * bindings/objc/objc_class.mm:
1254 (KJS::Bindings::ObjcClass::methodsNamed): use sel_getName instead of a char* cast.
1255 * bindings/objc/objc_runtime.mm:
1256 (ObjcFallbackObjectImp::callAsFunction): ditto
1258 2006-09-03 Alexey Proskuryakov <ap@nypop.com>
1262 http://bugs.webkit.org/show_bug.cgi?id=10693
1263 Convert JavaScript arrays to AppleScript lists
1265 * JavaScriptCore.exp: Export ArrayInstance::info and ArrayInstance::getItem().
1266 * kjs/array_instance.h:
1267 * kjs/array_object.cpp:
1268 (ArrayInstance::getItem): Added a method to access array items from C++.
1270 2006-09-02 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
1274 Bug 10454: Unix bakefile fixes
1275 http://bugs.webkit.org/show_bug.cgi?id=10454
1277 * JavaScriptCoreSources.bkl:
1279 2006-09-01 Nikolas Zimmermann <zimmermann@kde.org>
1281 Reviewed by hyatt. Landed by eseidel.
1285 * pcre/CMakeLists.txt: Add wtf/ include.
1287 2006-09-01 Nikolas Zimmermann <zimmermann@kde.org>
1289 Reviewed and landed by ap.
1291 Fix build on Linux (C89 without gcc extensions enabled).
1293 * pcre/pcre_internal.h: Use C style comments.
1294 * wtf/Assertions.h: Use C style comments.
1295 * wtf/Platform.h: Use C style comments.
1297 2006-09-01 Steve Falkenburg <sfalken@apple.com>
1301 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1302 * JavaScriptCore.vcproj/dftables/dftables.vcproj:
1304 2006-08-31 Anders Carlsson <acarlsson@apple.com>
1308 Add new portability functions to MathExtras.h and add StringExtras.h which is for
1309 string portability functions.
1311 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1312 * bindings/c/c_instance.cpp:
1313 * kjs/date_object.cpp:
1317 * wtf/StringExtras.h: Added.
1321 2006-08-31 Anders Carlsson <acarlsson@apple.com>
1327 * JavaScriptCore.vcproj/dftables/dftables.vcproj:
1328 * pcre/pcre_internal.h:
1330 2006-08-31 Timothy Hatcher <timothy@apple.com>
1334 Band-aid fix for PCRE to compile for ppc64 and x86_64 now that
1335 we use -Wshorten-64-to-32. Adds an INT_CAST macro that ASSERTs
1336 the value <= INT_MAX.
1338 I filed <rdar://problem/4712064> to track the need to verify
1339 PCRE's 64-bit compliance.
1341 * pcre/pcre_compile.c:
1350 (pcre_get_substring_list):
1351 * pcre/pcre_internal.h:
1352 * pcre/pcre_tables.c:
1353 * pcre/pcre_try_flipped.c:
1354 (_pcre_try_flipped):
1356 2006-08-30 Darin Adler <darin@apple.com>
1358 Reviewed by Tim Hatcher.
1360 - add WTF::getPtr, a function template that makes it possible to write
1361 generic code that gets a raw pointer out of any of our pointer types
1363 * JavaScriptCore.xcodeproj/project.pbxproj:
1364 * wtf/GetPtr.h: Added.
1365 * wtf/ListRefPtr.h: (WTF::getPtr): Added.
1366 * wtf/OwnArrayPtr.h: (WTF::getPtr): Added.
1367 * wtf/OwnPtr.h: (WTF::getPtr): Added.
1368 * wtf/PassRefPtr.h: (WTF::getPtr): Added.
1369 * wtf/RefPtr.h: (WTF::getPtr): Added.
1371 2006-08-29 waylonis <waylonis@google.com>
1373 Reviewed, tweaked by ggaren.
1375 - Added storage and accessor functions for ExecState as a fix for
1376 http://bugs.webkit.org/show_bug.cgi?id=10114
1378 * kjs/ExecState.cpp:
1379 (KJS::ExecState::ExecState):
1382 (KJS::Context::setExecState):
1383 (KJS::Context::execState):
1385 2006-08-30 Nikolas Zimmermann <zimmermann@kde.org>
1389 Commit KDE related tweaks, to be able to
1390 differentiate between a Qt-only or a KDE build.
1392 * CMakeLists.txt: Install wtf-unity library.
1393 * wtf/Platform.h: Add define for the KDE platform.
1395 2006-08-28 Darin Adler <darin@apple.com>
1399 * kjs/list.h: Use explicit in constructor (as appropriate).
1401 2006-08-24 Nikolas Zimmermann <zimmermann@kde.org>
1403 Reviewed, tweaked and landed by ap
1405 http://bugs.webkit.org/show_bug.cgi?id=10467
1406 WebKit should have Qt platform support (Part II)
1408 * CMakeLists.txt: Adjust to Anders' build fixes.
1409 * wtf/Platform.h: Fix define for the Qt platform (we don't use/need Cairo.)
1411 2006-08-23 David Hyatt <hyatt@apple.com>
1413 Fix Platform.h to include #defines for graphics features.
1417 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1420 2006-08-23 Anders Carlsson <acarlsson@apple.com>
1424 Make the bindings compile without CoreFoundation.
1426 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1427 * bindings/c/c_instance.cpp:
1428 * bindings/c/c_utility.cpp:
1429 (KJS::Bindings::convertUTF8ToUTF16):
1431 * bindings/runtime.cpp:
1432 (KJS::Bindings::Instance::createBindingForLanguageInstance):
1433 (KJS::Bindings::Instance::createLanguageInstanceForValue):
1434 * bindings/runtime_root.cpp:
1435 * bindings/runtime_root.h:
1436 * kjs/interpreter.cpp:
1437 (KJS::Interpreter::createLanguageInstanceForValue):
1438 * kjs/interpreter.h:
1440 2006-08-22 Anders Carlsson <acarlsson@apple.com>
1444 Move the npruntime code over to using HashMap and the runtime_root code over to using
1445 HashMap and HashCountedSet.
1447 * bindings/NP_jsobject.cpp:
1448 * bindings/c/c_utility.cpp:
1449 (KJS::Bindings::identifierFromNPIdentifier):
1450 * bindings/c/c_utility.h:
1451 * bindings/jni/jni_jsobject.cpp:
1452 (JavaJSObject::invoke):
1453 * bindings/npruntime.cpp:
1454 (getStringIdentifierMap):
1455 (getIntIdentifierMap):
1456 (_NPN_GetStringIdentifier):
1457 (_NPN_GetIntIdentifier):
1458 * bindings/runtime_root.cpp:
1459 (getReferencesByRootMap):
1461 (KJS::Bindings::findReferenceSet):
1462 (KJS::Bindings::rootForImp):
1463 (KJS::Bindings::rootForInterpreter):
1464 (KJS::Bindings::addNativeReference):
1465 (KJS::Bindings::removeNativeReference):
1466 (RootObject::removeAllNativeReferences):
1467 * bindings/runtime_root.h:
1469 2006-08-22 Anders Carlsson <acarlsson@apple.com>
1473 Switch over the NPAPI and Java bindings to using HashMaps instead of dictionaries.
1475 * JavaScriptCore.xcodeproj/project.pbxproj:
1476 * bindings/c/c_class.cpp:
1477 (KJS::Bindings::CClass::CClass):
1478 (KJS::Bindings::CClass::~CClass):
1479 (KJS::Bindings::CClass::classForIsA):
1480 (KJS::Bindings::CClass::methodsNamed):
1481 (KJS::Bindings::CClass::fieldNamed):
1482 * bindings/c/c_class.h:
1483 * bindings/jni/jni_class.cpp:
1484 (JavaClass::JavaClass):
1485 (JavaClass::~JavaClass):
1486 (JavaClass::methodsNamed):
1487 (JavaClass::fieldNamed):
1488 * bindings/jni/jni_class.h:
1489 * bindings/objc/objc_class.h:
1490 * bindings/objc/objc_class.mm:
1491 (KJS::Bindings::deleteMethod):
1492 (KJS::Bindings::deleteField):
1494 (KJS::Bindings::ObjcClass::methodsNamed):
1495 (KJS::Bindings::ObjcClass::fieldNamed):
1496 * bindings/runtime.cpp:
1497 * bindings/runtime.h:
1498 * bindings/runtime_object.cpp:
1499 (RuntimeObjectImp::fieldGetter):
1500 (RuntimeObjectImp::getOwnPropertySlot):
1501 (RuntimeObjectImp::put):
1502 (RuntimeObjectImp::canPut):
1504 2006-08-21 Vladimir Olexa <vladimir.olexa@gmail.com>
1508 http://bugs.webkit.org/show_bug.cgi?id=6252
1509 JavaScript 1.6 Array.lastIndexOf
1511 Test: fast/js/array-lastIndexOf.html
1513 * kjs/array_object.cpp:
1514 (ArrayProtoFunc::callAsFunction): Added a LastIndexOf case.
1515 * kjs/array_object.h:
1516 (KJS::ArrayProtoFunc::): Added LastIndexOf to enum.
1517 * tests/mozilla/expected.html: Two more tests now pass.
1519 2006-08-20 Nikolas Zimmermann <zimmermann@kde.org>
1521 Reviewed by Maciej. Landed by rwlbuis.
1523 Fixes parts of: http://bugs.webkit.org/show_bug.cgi?id=10463
1524 WebKit should have Qt platform support
1526 Removing obsolete QConstString/QString constructors in kjs code.
1531 2006-08-17 Nikolas Zimmermann <zimmermann@kde.org>
1533 Reviewed by Maciej. Landed by rwlbuis.
1535 Fixes: http://bugs.webkit.org/show_bug.cgi?id=10463
1536 WTF Changes needed for Qt platform code.
1539 * wtf/unicode/UnicodeDecomposition.h: Added.
1541 * wtf/unicode/UnicodeDirection.h: Added.
1543 * wtf/unicode/qt4/UnicodeQt4.cpp: Added.
1544 (WTF::Unicode::direction):
1545 (WTF::Unicode::category):
1546 (WTF::Unicode::decomposition):
1547 * wtf/unicode/qt4/UnicodeQt4.h:
1548 (WTF::Unicode::toLower):
1549 (WTF::Unicode::toUpper):
1550 (WTF::Unicode::isPrintableChar):
1551 (WTF::Unicode::isSpace):
1552 (WTF::Unicode::isPunct):
1553 (WTF::Unicode::isDigit):
1554 (WTF::Unicode::mirroredChar):
1555 (WTF::Unicode::compare):
1557 2006-08-17 Nikolas Zimmermann <zimmermann@kde.org>
1559 Reviewed by Eric. Landed by rwlbuis.
1561 Fixes: http://bugs.webkit.org/show_bug.cgi?id=10464
1562 Offer a cmake build system for Qt platform.
1564 * CMakeLists.txt: Added.
1565 * pcre/CMakeLists.txt: Added.
1567 2006-08-17 Anders Carlsson <acarlsson@apple.com>
1574 2006-08-15 Steve Falkenburg <sfalken@apple.com>
1580 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1583 2006-08-15 Mark Rowe <opendarwin.org@bdash.net.nz>
1587 Build fix: DWARF and -gfull are incompatible with symbol separation.
1589 * JavaScriptCore.xcodeproj/project.pbxproj:
1591 2006-08-15 Mark Rowe <opendarwin.org@bdash.net.nz>
1595 http://bugs.webkit.org/show_bug.cgi?id=10394
1596 Bug 10394: WebKit Release and Production configurations should enable dead code stripping
1598 * JavaScriptCore.xcodeproj/project.pbxproj:
1600 2006-08-15 Mark Rowe <opendarwin.org@bdash.net.nz>
1604 http://bugs.webkit.org/show_bug.cgi?id=10384
1605 Bug 10384: Switch to DWARF for Release configuration
1607 * JavaScriptCore.xcodeproj/project.pbxproj:
1609 2006-08-13 Maks Orlovich <maksim@kde.org>
1611 Reviewed (and tweaked a little) by Maciej.
1613 - shrank the size of JSObject by 8 bytes and made the corresponding reduction to the cell size, resulting
1614 in a 1.2% speed improvement on JS iBench (and probably overall memory savings).
1616 This was done by removing _scope and _internalValue data members
1617 from JSObject and moving them only to the subclasses that actually
1621 (KJS::JSObject::mark): No need to mark scope or internal value here.
1623 (KJS::JSObject::JSObject): Don't initialize them.
1624 * kjs/JSWrapperObject.cpp: Added. New base class for object types that
1625 wrap primitive values (Number, String, Boolean, Date).
1626 (KJS::JSWrapperObject::mark):
1627 * kjs/JSWrapperObject.h: Added.
1628 (KJS::JSWrapperObject::JSWrapperObject):
1629 (KJS::JSWrapperObject::internalValue):
1630 (KJS::JSWrapperObject::setInternalValue):
1631 * kjs/array_object.cpp:
1632 (ArrayPrototype::ArrayPrototype): Don't set useless internal value.
1633 * kjs/bool_object.cpp:
1634 (BooleanInstance::BooleanInstance): Inherit from JSWrapperObject.
1635 (BooleanProtoFunc::callAsFunction): Fixed to account for fact that not all
1636 JSObjects have an internal value.
1637 (BooleanObjectImp::construct): ditto.
1638 * kjs/bool_object.h:
1639 * kjs/collector.cpp: Lowered cell size to 48.
1640 (KJS::Collector::allocate): meaningless whitespace change
1641 * kjs/date_object.cpp:
1642 (KJS::DateInstance::DateInstance): Inherit from JSWrapperObject.
1643 (KJS::DateProtoFunc::callAsFunction): adjusted for move of internalValue
1644 (KJS::DateObjectImp::construct): ditto
1645 * kjs/date_object.h:
1646 * kjs/error_object.cpp:
1647 (ErrorPrototype::ErrorPrototype): don't set internal value
1648 * kjs/function.cpp: move _scope and related handling here
1649 (KJS::FunctionImp::mark): mark scope
1651 (KJS::FunctionImp::scope): moved here from JSObject
1652 (KJS::FunctionImp::setScope): ditto
1653 * kjs/number_object.cpp:
1654 (NumberInstance::NumberInstance): inherit from JSWrapperObject
1655 (NumberProtoFunc::callAsFunction): adjusted
1656 (NumberObjectImp::construct): adjusted
1657 * kjs/number_object.h: shring RegExp-related objects a little
1658 * kjs/regexp_object.cpp:
1659 (RegExpPrototype::RegExpPrototype): Adjust for size tweaks
1660 (RegExpObjectImp::RegExpObjectImp): ditto
1661 * kjs/regexp_object.h:
1662 * kjs/string_object.cpp:
1663 (StringInstance::StringInstance): inherit from JSWrapperObject
1664 (StringProtoFunc::callAsFunction): adjusted
1665 * kjs/string_object.h:
1666 * JavaScriptCore.exp: Exported new methods as needed.
1667 * JavaScriptCore.xcodeproj/project.pbxproj: Added new files to build.
1669 2006-08-04 Brady Eidson <beidson@apple.com>
1671 Reviewed by Geoff's rubber stamp
1673 Fix a build break on Intel hardware causes by adapting stricter
1674 compiler warnings (-Wshorten-64-to-32)
1677 (assertEqualsAsNumber): manually cast some doubles to floats
1680 2006-08-04 Sam Weinig <sam.weinig@gmail.com>
1684 - patch for http://bugs.webkit.org/show_bug.cgi?id=10192
1685 Make WebCore (and friends) compile with -Wshorten-64-to-32
1687 * Adds -Wshorten-64-to-32 flag to Xcode project.
1688 * Adds explicit casts where OK.
1692 (JSNodeList_getProperty):
1693 * JavaScriptCore.xcodeproj/project.pbxproj:
1695 2006-08-04 Adam Roben <aroben@apple.com>
1699 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Convert
1702 2006-08-03 Sam Weinig <sam.weinig@gmail.com>
1706 - patch for http://bugs.webkit.org/show_bug.cgi?id=10176
1707 Make WebCore compile with -Wundef
1709 * Adds -Wundef flag to Xcode project
1710 * Converts #ifs to #ifdef and #ifndefs where needed.
1711 * Added #define YYMAXDEPTH 10000 in kjs/grammar.y
1712 to fix a warning from within Bison.
1714 * JavaScriptCore.xcodeproj/project.pbxproj:
1715 * bindings/jni/jni_jsobject.cpp:
1716 (JavaJSObject::getSlot):
1717 (JavaJSObject::setSlot):
1719 * bindings/objc/objc_class.mm:
1720 (KJS::Bindings::ObjcClass::methodsNamed):
1721 (KJS::Bindings::ObjcClass::fieldNamed):
1722 * bindings/objc/objc_instance.mm:
1723 (ObjcInstance::invokeMethod):
1724 * bindings/objc/objc_runtime.mm:
1725 (ObjcMethod::getMethodSignature):
1731 2006-08-03 Anders Carlsson <acarlsson@apple.com>
1733 Reviewed by John Sullivan.
1737 Return *this in operator=
1739 2006-08-03 Adam Roben <aroben@apple.com>
1743 - Fixed Windows build
1745 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1746 * wtf/MathExtras.h: Implement inline versions of these functions
1750 2006-08-02 Adam Roben <aroben@apple.com>
1756 * kjs/date_object.cpp:
1759 2006-07-29 Darin Adler <darin@apple.com>
1761 - Removed tabs from these source files that still had them.
1762 We don't use them; that way source files look fine in editors
1763 that have tabs set to 8 spaces or to 4 spaces.
1764 - Removed allow-tabs Subversion property from the files too.
1766 * bindings/NP_jsobject.cpp:
1767 * bindings/c/c_utility.cpp:
1768 * bindings/jni/jni_runtime.cpp:
1769 * bindings/jni/jni_utility.cpp:
1770 * bindings/objc/objc_utility.mm:
1771 * bindings/runtime.cpp:
1772 * bindings/runtime_method.cpp:
1773 * bindings/testbindings.cpp:
1774 * bindings/testbindings.mm:
1775 * kjs/date_object.cpp:
1780 * kjs/string_object.cpp:
1783 2006-07-29 Darin Adler <darin@apple.com>
1785 * tests/mozilla/expected.html: Update test results now that regress-185165.js
1786 is succeeding. I suspect Anders fix for bug 4620655 is the reason.
1788 2006-07-29 Sam Weinig <sam.weinig@gmail.com>
1792 - patch for http://bugs.webkit.org/show_bug.cgi?id=10080
1793 Adopt pedantic changes from the Unity project to improve
1794 cross-compiler compatibility
1797 * Removing trailing semicolon from namespace braces.
1798 * Removing trailing comma from last enum declaration.
1799 * Updating to match style guidelines.
1800 * Adding missing newline to the end of the file.
1801 * Turning on gcc warning for missing newline at the end of a source file
1802 (GCC_WARN_ABOUT_MISSING_NEWLINE in Xcode, -Wnewline in gcc).
1803 * Alphabetical sorting of Xcode source list files.
1804 * Replace use of non-portable variable-size array with Vector.
1805 * Use C-style comments instead of C++ comments in files that might
1806 be included by either C or C++ files.
1808 * API/JSCallbackConstructor.cpp:
1809 (KJS::JSCallbackConstructor::construct):
1810 * API/JSCallbackFunction.cpp:
1811 (KJS::JSCallbackFunction::callAsFunction):
1812 * API/JSCallbackObject.cpp:
1813 (KJS::JSCallbackObject::construct):
1814 (KJS::JSCallbackObject::callAsFunction):
1815 * JavaScriptCore.xcodeproj/project.pbxproj:
1816 * JavaScriptCorePrefix.h:
1817 * bindings/jni/jni_class.cpp:
1818 (JavaClass::fieldNamed):
1819 * bindings/jni/jni_class.h:
1820 * bindings/jni/jni_instance.cpp:
1821 (JavaInstance::JavaInstance):
1822 (JavaInstance::valueOf):
1823 * bindings/jni/jni_objc.mm:
1824 (KJS::Bindings::dispatchJNICall):
1825 * bindings/jni/jni_runtime.cpp:
1826 (JavaParameter::JavaParameter):
1827 (JavaArray::JavaArray):
1828 * bindings/jni/jni_runtime.h:
1829 * bindings/jni/jni_utility.h:
1830 * bindings/objc/objc_instance.h:
1831 * bindings/runtime_array.h:
1837 2006-07-29 Mike Emmel <mike.emmel@gmail.com>
1841 - fixes for Linux build
1843 * JavaScriptCoreSources.bkl: Added new files to build, kjs/PropertyNameArray.cpp
1844 and kjs/testkjs.cpp, and removed old files.
1846 2006-07-24 Dan Waylonis <waylonis@google.com>
1848 Reviewed and tweaked a bit by Darin.
1850 - fix http://bugs.webkit.org/show_bug.cgi?id=9902
1851 jsNull and NSNull not properly converted between JS and ObjC
1853 * bindings/objc/objc_utility.mm: (KJS::Bindings::convertObjcValueToValue):
1854 Added case for converting NSNull to jsNull.
1856 2006-07-24 Rob Buis <buis@kde.org>
1860 http://bugs.webkit.org/show_bug.cgi?id=4258
1861 Date().toString() only includes GMT offset, not timezone string
1863 Use the info in tm_zone to append timezone abbreviation
1864 to Date().toString().
1866 * kjs/date_object.cpp:
1869 2006-07-24 Rob Buis <buis@kde.org>
1873 http://bugs.webkit.org/show_bug.cgi?id=5257
1874 setYear() does not match FireFox/IE behavior
1876 Make sure the right values end up in tm_year.
1878 * kjs/date_object.cpp:
1881 2006-07-23 Mark Rowe <opendarwin.org@bdash.net.nz>
1885 Bug 9686: [Drosera] Need the ability to break into Drosera on Javascript exceptions
1886 http://bugs.webkit.org/show_bug.cgi?id=9686
1888 JavaScriptCore portion of the fix.
1890 * JavaScriptCore.exp: Update symbol for change in argument type.
1892 (Debugger::detach): Clear map of recent exceptions.
1893 (Debugger::hasHandledException): Track the most recent exception
1894 thrown by an interpreter.
1895 (Debugger::exception): Change exception argument to a JSValue.
1898 (Node::debugExceptionIfNeeded): Notify the debugger of an exception
1899 if it hasn't seen it before.
1900 (ThrowNode::execute): Notify the debugger that an exception is being thrown.
1903 2006-07-23 Geoffrey Garen <ggaren@apple.com>
1905 Patch by Eric Albert, reviewed by Darin and me.
1907 - Fixed <rdar://problem/4645931> JavaScriptCore stack-scanning code
1908 crashes (Collector::markStackObjectsConservatively)
1910 * bindings/jni/jni_jsobject.cpp: On 64bit systems, jint is a long, not an
1912 (JavaJSObject::getSlot):
1913 (JavaJSObject::setSlot):
1914 * kjs/collector.cpp:
1915 (KJS::Collector::markCurrentThreadConservatively): Use a pointer instead of
1916 an int as 'dummy,' because on LP64 systems, an int is not pointer-aligned,
1917 and we want to scan the stack for pointers.
1918 * JavaScriptCore.xcodeproj/project.pbxproj: After a tense cease-fire, the
1919 XCode war has started up again!
1921 === Safari-521.20 ===
1923 2006-07-21 Geoffrey Garen <ggaren@apple.com>
1927 <rdar://problem/4507265> REGRESSION: overlays don't work on HousingMaps.com (Google Maps-based site)
1929 - Added support for strings that masquerade as undefined. Currently used
1930 by WebCore to implement undetectable style.filter.
1932 The name is a little long, but it's only used in one line of code, so I
1933 thought clarity should win over brevity.
1935 * JavaScriptCore.exp:
1936 * JavaScriptCore.xcodeproj/project.pbxproj:
1938 * kjs/string_object.h:
1939 (KJS::StringInstanceThatMasqueradesAsUndefined::StringInstanceThatMasqueradesAsUndefined):
1940 (KJS::StringInstanceThatMasqueradesAsUndefined::masqueradeAsUndefined):
1941 (KJS::StringInstanceThatMasqueradesAsUndefined::toBoolean):
1943 === Safari-521.19 ===
1945 2006-07-20 Steve Falkenburg <sfalken@apple.com>
1950 (KJS::escapeStringForPrettyPrinting):
1952 2006-07-19 Anders Carlsson <acarlsson@apple.com>
1956 <rdar://problem/4620655> REGRESSION(10.4.7-10.5): preview button for a blogger.com post doesn't work
1958 * kjs/nodes2string.cpp:
1959 (StringNode::streamTo):
1960 Return the escaped string.
1962 (RegExpNode::streamTo):
1963 Use the correct syntax.
1966 (KJS::escapeStringForPrettyPrinting):
1968 Add escape function which escapes a string for pretty-printing so it can be parsed again.
1970 * wtf/unicode/icu/UnicodeIcu.h:
1971 (WTF::Unicode::isPrintableChar):
1974 2006-07-18 Maciej Stachowiak <mjs@apple.com>
1976 Reviewed by Adele Peterson.
1978 <rdar://problem/4589530> REGRESSION: null character in JS string causes parse error (works in Tiger and in other browsers)
1984 (Lexer::scanRegExp):
1987 2006-07-18 Tim Omernick <timo@apple.com>
1989 Reviewed by Tim Hatcher.
1991 Removed a misleading comment; we recently added support for the NPNVPluginElementNPObject
1996 === Safari-521.18 ===
1998 2006-07-18 Timothy Hatcher <timothy@apple.com>
2000 Made the following headers public:
2009 * JavaScriptCore.xcodeproj/project.pbxproj:
2011 2006-07-17 Geoffrey Garen <ggaren@apple.com>
2015 - Added automatic prototype creation for classes.
2017 A class stores a weak reference to a prototype, which is cleared when
2018 the prototype is garbage collected, to avoid a reference cycle.
2020 We now have an attributes field in JSClassDefinition, that currently is
2021 used only to override automatic prototype creation when you want to manage your
2022 own prototypes, but can be extended in the future for other nefarious purposes.
2024 Similarly, we have JSObjectMake and JSObjectMakeWithPrototype, the latter
2025 allowing you to manage your own prototypes.
2027 JSObjectMakeConstructor is more interesting now, able to make a constructor
2028 on your behalf if you just give it a class.
2030 - Removed bogus old code from minidom.js.
2032 - Tweaked the headerdocs.
2034 - Added more GC testing, which caught some leaks, and tested more funny
2035 edge cases in lookup, which caught a lookup bug. Removed some testing
2036 we used to do with MyObject because it was redundant with the new, cool
2039 While fixing the lookup bug I retracted this change:
2041 "If a static setProperty callback returns 'false', to indicate that the
2042 property was not set, we no longer forward the set request up the class
2043 chain, because that's almost certainly not what the programmer expected."
2045 Returning false when setting a static property is a little silly, but you can see
2046 it being useful when shadowing a base class's static properties, and, regardless
2047 of usefullness, this is the defined behavior of the setProperty callback.
2049 - Plus a little ASCII art, for the kids.
2051 2006-07-17 Timothy Hatcher <timothy@apple.com>
2055 <rdar://problem/4634874> WebScriptObject and WebUndefined are no longer defined by WebKit
2057 Moves WebScriptObject and WebUndefined up to WebCore.
2058 This change does create an upwards-dependancy on WebScriptObject existing
2059 in the loaded process, but this code path in JavaScriptCore does not get used
2060 unless it is through WebKit/WebCore. Moving all of the binding code out of
2061 JavaScriptCore might make sense in the future.
2063 * JavaScriptCore.exp:
2064 * JavaScriptCore.xcodeproj/project.pbxproj:
2065 * bindings/objc/WebScriptObject.h: Replaced.
2066 * bindings/objc/WebScriptObject.mm: Removed.
2067 * bindings/objc/WebScriptObjectPrivate.h: Removed.
2068 * bindings/objc/objc_class.h:
2069 * bindings/objc/objc_instance.h:
2070 * bindings/objc/objc_instance.mm:
2071 (ObjcInstance::~ObjcInstance):
2072 * bindings/objc/objc_runtime.h:
2073 * bindings/objc/objc_runtime.mm:
2074 (convertValueToObjcObject):
2075 * bindings/objc/objc_utility.mm:
2076 (KJS::Bindings::convertValueToObjcValue):
2077 (KJS::Bindings::convertObjcValueToValue):
2078 (KJS::Bindings::createObjcInstanceForValue):
2080 2006-07-17 Darin Adler <darin@apple.com>
2082 * API/JSBase.h: Fix comment formatting where things used to be lined up but
2083 are now ragged. Got rid of spaces that attempted to line things up.
2084 * API/JSObjectRef.h: Ditto. Also add missing periods for a couple of comments.
2086 2006-07-17 Geoffrey Garen <ggaren@apple.com>
2090 - Removed the exception parameter from the initialize callback and, by extension,
2091 JSObjectMake. We have never had a need for exceptions when iniitializing,
2092 so the parameter seemed likely to "get in the way."
2094 Also, an exception in JavaScript is thrown in response to input --
2095 "invalid URL", "index not a number", etc., so it's the job of the
2096 constructor function, not the initialize method, to throw.
2098 If initialize *really* wants to throw, it can communicate the throw to
2099 the constructor through the constructed object's private data (e.g., set
2100 it to NULL, signaling to the consntructor that initialization failed.)
2102 - Added JSObjectMakeWithData, which enables a constructor to set private
2103 data on an object *before* it has been initialized. That way, the initialize
2104 methods can properly operate on the data.
2106 * API/JSNode.c: Moved ref into the initialize method, for better encapsulation,
2107 now that it's possible.
2108 * API/JSNodeList.c: ditto
2110 (main): Do more aggressive garbage collection to test ref/deref and
2111 initialize/finalize.
2112 * API/minidom.js: store childNodes in a temporary so it doesn't get re-created
2113 like a thousand times. This makes debugging ref/deref easier
2115 2006-07-17 Geoffrey Garen <ggaren@apple.com>
2119 - Changed the initialize callback to run from least derived class (parent
2120 class) to most derived class. This enables C++ style initialization,
2121 and derived class overriding of member data.
2123 - Added excpetion propopgation to JSObjectMake, to support initialize
2124 exceptions, and generally round out our policy of making function
2125 signatures as long as possible.
2127 * API/JSCallbackObject.h: Use ExecState instead of ContextRef, cuz we're
2130 2006-07-17 Geoffrey Garen <ggaren@apple.com>
2134 - Changed JSObjectMakeConstructor to JSObjectMakeConstructorWithCallback,
2135 to match JSObjectMakeFunctionWithCallback.
2137 - Added prototype parameter, so the generated constructor
2138 automatically works with hasInstance / instanceof
2140 - Moved hasInstance implementation from InternalFunctionImp to JSObject
2141 so that subclasses can inherit it without inheriting function-related baggage.
2142 More refactoring here would be good, but this seems like a good short-term
2145 (KJS::JSCallbackFunction::implementsHasInstance): override and return false,
2146 because callback functions aren't constructors.
2148 2006-07-17 Maciej Stachowiak <mjs@apple.com>
2152 - add a JSContextRef parameter to all JSValueRef, JSObjectRef, and JSContextRef operations;
2153 except JSObject{Get,Set}PrivateData which can be assumed to be simple pure accessors.
2155 Also renamed the parameter "context" to "ctx" because it makes the code read better with this pervasive
2156 but usually uninteresting parameter.
2160 (JSCheckScriptSyntax):
2163 * API/JSCallbackObject.cpp:
2164 (KJS::JSCallbackObject::JSCallbackObject):
2165 (KJS::JSCallbackObject::init):
2166 (KJS::JSCallbackObject::getOwnPropertySlot):
2167 (KJS::JSCallbackObject::put):
2168 (KJS::JSCallbackObject::deleteProperty):
2169 (KJS::JSCallbackObject::toNumber):
2170 (KJS::JSCallbackObject::toString):
2171 * API/JSContextRef.cpp:
2172 (JSGlobalContextCreate):
2173 (JSGlobalContextRetain):
2174 (JSGlobalContextRelease):
2175 (JSContextGetGlobalObject):
2176 * API/JSContextRef.h:
2178 (JSNodePrototype_appendChild):
2179 (JSNodePrototype_removeChild):
2180 (JSNodePrototype_replaceChild):
2181 (JSNode_getNodeType):
2182 (JSNode_getFirstChild):
2185 (JSNodeListPrototype_item):
2186 (JSNodeList_length):
2187 (JSNodeList_getProperty):
2188 (JSNodeList_prototype):
2189 * API/JSObjectRef.cpp:
2191 (JSObjectMakeFunctionWithCallback):
2192 (JSObjectMakeConstructor):
2193 (JSObjectMakeFunction):
2194 (JSObjectGetPrototype):
2195 (JSObjectSetPrototype):
2196 (JSObjectHasProperty):
2197 (JSObjectGetProperty):
2198 (JSObjectSetProperty):
2199 (JSObjectGetPropertyAtIndex):
2200 (JSObjectSetPropertyAtIndex):
2201 (JSObjectDeleteProperty):
2202 (JSObjectIsFunction):
2203 (JSObjectCallAsFunction):
2204 (JSObjectIsConstructor):
2205 (JSObjectCallAsConstructor):
2206 (JSObjectCopyPropertyNames):
2207 * API/JSObjectRef.h:
2208 * API/JSStringRef.cpp:
2209 * API/JSValueRef.cpp:
2211 (JSValueIsUndefined):
2217 (JSValueIsObjectOfClass):
2219 (JSValueIsStrictEqual):
2220 (JSValueIsInstanceOfConstructor):
2221 (JSValueMakeUndefined):
2223 (JSValueMakeBoolean):
2224 (JSValueMakeNumber):
2225 (JSValueMakeString):
2228 (JSValueToStringCopy):
2236 (MyObject_getProperty):
2237 (MyObject_deleteProperty):
2238 (MyObject_callAsFunction):
2239 (MyObject_callAsConstructor):
2240 (MyObject_convertToType):
2241 (print_callAsFunction):
2244 2006-07-16 Geoffrey Garen <ggaren@apple.com>
2246 Approved by Maciej, RS by Beth.
2248 JSObjectMakeFunction -> JSObjectMakeFunctionWithCallback
2249 JSObjectMakeFunctionWithBody -> JSObjectMakeFunction
2251 because the latter is more common, and more fundamental, than the former.
2256 * API/JSCallbackObject.cpp:
2257 (KJS::JSCallbackObject::getOwnPropertySlot):
2258 (KJS::JSCallbackObject::put):
2259 (KJS::JSCallbackObject::deleteProperty):
2260 (KJS::JSCallbackObject::getPropertyNames):
2261 (KJS::JSCallbackObject::staticValueGetter):
2262 (KJS::JSCallbackObject::staticFunctionGetter):
2263 * API/JSClassRef.cpp:
2264 (OpaqueJSClass::OpaqueJSClass):
2265 (OpaqueJSClass::~OpaqueJSClass):
2267 * API/JSObjectRef.cpp:
2269 (JSObjectMakeFunctionWithCallback):
2270 (JSObjectMakeFunction):
2271 (OpaqueJSPropertyNameArray::OpaqueJSPropertyNameArray):
2272 (JSObjectCopyPropertyNames):
2273 * API/JSObjectRef.h:
2279 * JavaScriptCore.exp:
2281 2006-07-16 Geoffrey Garen <ggaren@apple.com>
2285 Replace __JS with OpaqueJS because the former, while used by CF, is
2286 a prefix that's triply-reserved by the compiler. (_* is reserved in global
2287 names, _[A-Z] is reserved in all names, and __ is reserved in all names
2290 Opaque is an alternative used by other Mac OS X framewokrs.
2295 * API/JSCallbackObject.cpp:
2296 (KJS::JSCallbackObject::getOwnPropertySlot):
2297 (KJS::JSCallbackObject::put):
2298 (KJS::JSCallbackObject::deleteProperty):
2299 (KJS::JSCallbackObject::getPropertyNames):
2300 (KJS::JSCallbackObject::staticValueGetter):
2301 (KJS::JSCallbackObject::staticFunctionGetter):
2302 * API/JSClassRef.cpp:
2303 (OpaqueJSClass::OpaqueJSClass):
2304 (OpaqueJSClass::~OpaqueJSClass):
2306 * API/JSObjectRef.cpp:
2308 (OpaqueJSPropertyNameArray::OpaqueJSPropertyNameArray):
2309 (JSObjectCopyPropertyNames):
2311 2006-07-16 Darin Adler <darin@apple.com>
2313 - try to fix Windows build
2315 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2316 Added some recently added files, removed some recently removed.
2318 2006-07-16 Geoffrey Garen <ggaren@apple.com>
2322 - Change getProperty* to return undefined, rather than NULL, for missing
2323 properties, since that's what the spec says. Also added exception out
2324 parameters to the *Index functions, because they can call through to the
2325 regular functions, which can throw for custom objects.
2327 * API/JSObjectRef.cpp:
2328 (JSObjectGetProperty):
2329 (JSObjectGetPropertyAtIndex):
2330 (JSObjectSetPropertyAtIndex):
2331 * API/JSObjectRef.h:
2335 2006-07-16 Geoffrey Garen <ggaren@apple.com>
2339 - Properly document and handle NULL callbacks for static properties. We
2340 throw an exception in any case other than a ReadOnly property with a NULL
2341 setProperty callback, because a NULL callback almost certainly indicates
2342 a programming error. Also throw an exception if hasProperty returns true
2343 for a property that getProperty can't get.
2345 - If a static setProperty callback returns 'false', to indicate that the
2346 property was not set, we no longer forward the set request up the class
2347 chain, because that's almost certainly not what the programmer expected.
2349 * API/JSCallbackObject.cpp:
2350 (KJS::JSCallbackObject::getOwnPropertySlot):
2351 (KJS::JSCallbackObject::put):
2352 (KJS::JSCallbackObject::staticValueGetter):
2353 (KJS::JSCallbackObject::staticFunctionGetter):
2354 (KJS::JSCallbackObject::callbackGetter):
2355 * API/JSObjectRef.h:
2358 (MyObject_hasProperty):
2361 2006-07-16 Geoffrey Garen <ggaren@apple.com>
2365 - Added names to functions.
2367 - Removed GetPrivate/SetPrivate from callbackFunctions and callbackConstructors.
2368 The private data idiom is that a JS object stores its native implementation
2369 as private data. For functions and constructors, the native implementation is nothing
2370 more than the callback they already store, so supporting private data, too,
2371 confuses the idiom. If you *really* want, you can still create a custom
2372 function with private data.
2374 * API/JSCallbackConstructor.cpp:
2375 * API/JSCallbackConstructor.h:
2376 * API/JSCallbackFunction.cpp:
2377 (KJS::JSCallbackFunction::JSCallbackFunction):
2378 * API/JSCallbackFunction.h:
2379 * API/JSCallbackObject.cpp:
2380 (KJS::JSCallbackObject::staticFunctionGetter):
2381 * API/JSObjectRef.cpp:
2382 (JSObjectMakeFunction):
2383 (JSObjectMakeFunctionWithBody):
2384 (JSObjectGetPrivate):
2385 (JSObjectSetPrivate):
2386 * API/JSObjectRef.h:
2392 2006-07-15 Maciej Stachowiak <mjs@apple.com>
2396 - switch property lists to be vector+set of Identifiers instead of list of References
2398 This has the following benefits:
2400 - no duplicates in property lists
2401 - simplifies API calls
2402 - probably more efficient, since linked list is gone
2403 - entirely removed Reference, ReferenceList and ProtectedReference types from the API
2405 * kjs/PropertyNameArray.cpp: Added.
2406 (KJS::PropertyNameArray::add): Check set, if not already there, add to
2408 * kjs/PropertyNameArray.h: Added.
2409 (KJS::PropertyNameArray::PropertyNameArray): Newly added type, combines
2410 a set and a vector to make a unique but ordered list of identifiers.
2411 (KJS::PropertyNameArray::begin): ditto
2412 (KJS::PropertyNameArray::end): ditto
2413 (KJS::PropertyNameArray::size): ditto
2414 (KJS::PropertyNameArray::operator[]): ditto
2415 * kjs/array_instance.h:
2416 * kjs/array_object.cpp:
2417 (ArrayInstance::getPropertyNames): renamed from getPropertyList, updated
2418 for PropertyNameArray
2419 (ArrayInstance::setLength): updated for PropertyNameArray
2420 (ArrayInstance::pushUndefinedObjectsToEnd): ditto
2422 (ForInNode::execute): updated for PropertyNameArray
2425 (KJS::JSObject::getPropertyNames): renamed from getPropertyList, updated
2426 for PropertyNameArray
2428 * kjs/property_map.cpp:
2429 (KJS::PropertyMap::getEnumerablePropertyNames): updated for PropertyNameArray
2430 (KJS::PropertyMap::getSparseArrayPropertyNames): ditto
2431 * kjs/property_map.h:
2432 * kjs/protected_reference.h: Removed.
2433 * kjs/reference.cpp: Removed.
2434 * kjs/reference.h: Removed.
2435 * kjs/reference_list.cpp: Removed.
2436 * kjs/reference_list.h: Removed.
2437 * kjs/scope_chain.cpp:
2438 (KJS::ScopeChain::print): Use PropertyNamesArray instead of ReferenceList.
2439 * kjs/string_object.cpp:
2440 (StringInstance::getPropertyNames): Updated for new approach.
2441 * kjs/string_object.h:
2444 (toJS): Added overload for PropertyNameAccumulatorRef / PropertyNameArray*
2447 * API/JSCallbackObject.cpp:
2448 (KJS::JSCallbackObject::getPropertyNames): Fixed for new API.
2449 * API/JSCallbackObject.h:
2450 * API/JSObjectRef.cpp:
2451 (__JSPropertyNameArray::__JSPropertyNameArray): Type used for a publicly vended
2452 JSPropertyNameArrayRef.
2453 (JSObjectCopyPropertyNames): New API call - renamed / refactored from
2454 JSObjectCreatePropertyList
2455 (JSPropertyNameArrayRetain): new retain call for JSPropertyNameArray.
2456 (JSPropertyNameArrayRelease): new release call for - " -.
2457 (JSPropertyNameArrayGetCount): Instead of having to use a stateful enumerator you
2458 can now get the count and items in any order.
2459 (JSPropertyNameArrayGetNameAtIndex): See above.
2460 (JSPropertyNameAccumulatorAddName): What you add properties to is now an opaque
2462 * API/JSObjectRef.h: Prototyped new functions, removed old ones
2463 * JavaScriptCore.exp: Updated exported symbols.
2464 * JavaScriptCore.xcodeproj/project.pbxproj: Added new files, removed old.
2466 (MyObject_getPropertyNames): Renamed / fixed callback to fit new paradigm.
2467 (main): Updated for new API.
2469 2006-07-15 Darin Adler <darin@apple.com>
2471 - oops, missed a few more arrays that had to be const
2474 (JSNodePrototype_appendChild): Added const.
2475 (JSNodePrototype_removeChild): Ditto.
2476 (JSNodePrototype_replaceChild): Ditto.
2477 (JSNode_construct): Ditto.
2479 (JSNodeListPrototype_item): Ditto.
2480 * API/JSObjectRef.cpp:
2481 (JSObjectMakeFunctionWithBody): Ditto.
2482 (JSObjectCallAsFunction): Ditto.
2483 (JSObjectCallAsConstructor): Ditto.
2487 (MyObject_callAsFunction): Ditto.
2488 (MyObject_callAsConstructor): Ditto.
2489 (print_callAsFunction): Ditto.
2490 (myConstructor_callAsConstructor): Ditto.
2492 2006-07-15 Darin Adler <darin@apple.com>
2496 * API/JSNode.h: Made an array parameter const.
2497 * API/JSObjectRef.h: Made array parameters const. Fixed a comment.
2499 2006-07-15 Geoffrey Garen <ggaren@apple.com>
2503 - JSObjectMakeFunctionWithBody includes a function name and named parameters now.
2505 * API/JSObjectRef.cpp:
2506 (JSObjectMakeFunctionWithBody):
2507 * API/JSObjectRef.h:
2509 (assertEqualsAsUTF8String): More informative failure reporting.
2510 (main): Test more function cases.
2512 2006-07-15 Geoffrey Garen <ggaren@apple.com>
2516 - Moved the arguments passed to JSClassCreate into a single structure,
2517 called JSClassDefinition. This will enable easier structure
2518 migration/versioning in the future, if necessary.
2520 - Added support for class names.
2522 - kJSClassDefinitionNull replaces kJSObjectCallbacksNone.
2524 - JSClass is becoming a fairly complex struct, so I migrated all of its
2525 implementation other than reference counting to the sruct.
2527 - Also moved JSClass* functions in the API to JSObjectRef.cpp, since they're
2528 declared in JSObjectRef.h
2530 - Also added some more informative explanation to the class structure doc.
2532 2006-07-15 Darin Adler <darin@apple.com>
2536 - fix http://bugs.webkit.org/show_bug.cgi?id=8395
2537 <rdar://problem/4613467>
2538 REGRESSION: RegEx seems broken for hex escaped non breaking space
2540 Test: fast/js/regexp-extended-characters-more.html
2543 (match): Got rid of utf16Length local variable to guarantee there's no
2544 extra stack usage in recursive calls. Fixed two places in the PCRE_UTF16
2545 code that were using the length variable, which is the UTF-8 length of
2546 a character in the pattern, to move in the UTF-16 subject string. Instead
2547 they hardcode lengths of 1 and 2 since the code already handles BMP
2548 characters and surrogate pairs separately. Also fixed some DPRINTF so
2549 I could compile with DEBUG on.
2550 (pcre_exec): Changed a place that was checking for multibyte characters
2551 in the subject string to use ISMIDCHAR. Instead it was using hardcoded
2552 logic that was right for UTF-8 but wrong for UTF-16.
2554 * pcre/pcre_compile.c: (pcre_compile2): Fixed a DPRINTF so I could compile
2557 2006-07-14 Geoffrey Garen <ggaren@apple.com>
2561 Global replace in the API of argc/argv with argumentCount/arguments.
2563 2006-07-14 Geoffrey Garen <ggaren@apple.com>
2567 - Finalized exception handling in the API.
2569 setProperty can throw because it throws for built-in arrays. getProperty
2570 and deleteProperty can throw because setProperty can throw and we want
2571 to be consistent, and also because they seem like "actions." callAsFunction,
2572 callAsConstructor, and hasInstance can throw, because they caan throw for
2575 toBoolean can't throw because it's defined that way in the spec.
2577 - Documented that toBoolean and toObject can't be overridden by custom
2578 objects because they're defined that way in the spec.
2580 === Safari-521.17 ===
2582 2006-07-14 Geoffrey Garen <ggaren@apple.com>
2586 - Implemented ref-counting of JSContexts by splitting into two datatypes:
2587 JSGlobalContext, which you can create/retain/release, and JSContext, which
2590 Internally, you retain a JSGlobalContext/ExecState by retaining its
2591 interpreter, which, in the case of a global ExecState, owns it.
2593 - Also made ~Interpreter() protected to catch places where Interpreter
2594 is manually deleted. (Can't make it private because some crazy fool
2595 decided it would be a good idea to subclass Interpreter in other frameworks.
2599 (toJS): Added cast for new JSGlobalContext
2600 * API/JSStringRef.h: Changed vague "you must" language to more specific
2601 (but, ultimately, equally vague) "behavior is undefined if you don't"
2603 (KJS::Interpreter::Interpreter): Factored more common initialization into
2605 * kjs/interpreter.h:
2606 (KJS::Interpreter::ref): new
2607 (KJS::Interpreter::deref): new
2608 (KJS::Interpreter::refCount): new
2610 (doIt): Ref-count the interpreter.
2612 2006-07-14 Maciej Stachowiak <mjs@apple.com>
2616 - removed bool return value from JSObjectSetProperty, since it is inefficient and
2617 also doesn't work quite right
2618 - added JSObjectGetPropertyAtIndex and JSObjectSetPropertyAtIndex
2620 * API/JSObjectRef.cpp:
2621 (JSObjectSetProperty): Removed return value and canPut stuff.
2622 (JSObjectGetPropertyAtIndex): Added.
2623 (JSObjectSetPropertyAtIndex): Added.
2624 * API/JSObjectRef.h: Prototyped and documented new functions.
2626 2006-07-14 Geoffrey Garen <ggaren@apple.com>
2630 Moved JSCheckScriptSyntax, JSEvaluateScript, and JSGarbageCollect into
2631 JSBase.h/.cpp. They don't belong in the value-specific or context-specific
2632 files because they're not part of the value or context implementations.
2635 * API/JSContextRef.cpp:
2636 (JSContextGetGlobalObject):
2637 * API/JSContextRef.h:
2638 * API/JSValueRef.cpp:
2641 * JavaScriptCore.xcodeproj/project.pbxproj:
2643 2006-07-13 Timothy Hatcher <timothy@apple.com>
2647 Moved JavaScriptCore to be a public framework.
2649 * JavaScriptCore.xcodeproj/project.pbxproj:
2651 2006-07-13 Mark Rowe <opendarwin.org@bdash.net.nz>
2653 Reviewed by Geoffrey.
2655 http://bugs.webkit.org/show_bug.cgi?id=9742
2656 Bug 9742: REGRESSION: WebKit hangs when loading <http://www.vtbook.com>
2659 (KJS::JSValue::getUInt32): Only types tagged as numeric can be converted to UInt32.
2661 2006-07-13 Geoffrey Garen <ggaren@apple.com>
2665 - Renamed JSEvaluate -> JSEvaluateScript, JSCheckSyntax -> JSCheckScriptSyntax
2666 - Added exception out parameters to JSValueTo* and JSValueIsEqual because
2668 - Removed JSObjectGetDescription because it's useless and vague, and
2669 JSValueToString/JSValueIsObjectOfClass do a better job, anyway
2670 - Clarified comments about "IsFunction/Constructor" to indicate that they
2671 are true of all functions/constructors, not just those created by JSObjectMake*
2673 2006-07-12 Geoffrey Garen <ggaren@apple.com>
2677 Finished previously approved JSInternalString -> JSString conversion
2678 by renaming the files.
2680 * API/JSCallbackObject.cpp:
2681 * API/JSInternalStringRef.cpp: Removed.
2682 * API/JSInternalStringRef.h: Removed.
2683 * API/JSStringRef.cpp: Added.
2684 * API/JSStringRef.h: Added.
2685 * API/JavaScriptCore.h:
2686 * JavaScriptCore.xcodeproj/project.pbxproj:
2688 2006-07-12 Geoffrey Garen <ggaren@apple.com>
2692 - Removed context and exception parameters from JSObjectGetPropertyEnumerator,
2693 removing the spurious use of ExecState inside JavaScriptCore that made
2694 us think this was necessary in the first place.
2696 (StringInstance::getPropertyList): Use getString instead of toString because
2697 we know we're dealing with a string -- we put it there in the first place.
2698 While we're at it, store the string's size instead of retrieving it each time
2699 through the loop, to avoid the unnecessary killing of puppies.
2700 * kjs/string_object.h:
2702 2006-07-12 Maciej Stachowiak <mjs@apple.com>
2706 - add handling of hasInstance callback for API objects
2708 * API/JSCallbackObject.cpp:
2709 (KJS::JSCallbackObject::implementsHasInstance): Check if callback is present.
2710 (KJS::JSCallbackObject::hasInstance): Invoke appropriate callback.
2711 * API/JSCallbackObject.h:
2712 * API/JSClassRef.cpp:
2713 * API/JSObjectRef.h:
2715 (MyObject_hasInstance): Test case; should match what construct would do.
2718 2006-07-11 Geoffrey Garen <ggaren@apple.com>
2722 - Implemented a vast number of renames and comment clarifications
2723 suggested during API review.
2725 JSInternalString -> JSString
2726 JS*Make -> JSValueMake*, JSObjectMake*
2727 JSTypeCode -> JSType
2728 JSValueIsInstanceOf -> JSValueIsInstanceOfConstructor (reads strangely well in client code)
2729 JSGC*Protect -> JSValue*Protect
2730 JS*Callback -> JSObject*Callback
2731 JSGetPropertyListCallback -> JSObjectAddPropertiesToListCallback
2732 JSPropertyEnumeratorGetNext -> JSPropertyEnumeratorGetNextName
2734 JSStringCreateWithUTF8CString, JSStringGetUTF8CString,
2735 JSStringGetMaximumUTF8CStringSize JSStringIsEqualToUTF8CString,
2736 JSStringCreateWithCFString, JSStringCopyCFString, JSStringCreateWithCharacters.
2738 - Changed functions taking a JSValue out arg and returning a bool indicating
2739 whether it was set to simply return a JSValue or NULL.
2741 - Removed JSStringGetCharacters because it's more documentation than code,
2742 and it's just a glorified memcpy built on existing API functionality.
2744 - Moved standard library includes into the headers that actually require them.
2746 - Standardized use of the phrase "Create Rule."
2748 - Removed JSLock from make functions that don't allocate.
2750 - Added exception handling to JSValueToBoolean, since we now allow
2751 callback objects to throw exceptions upon converting to boolean.
2753 - Renamed JSGCCollect to JSGarbageCollect.
2755 2006-07-10 Geoffrey Garen <ggaren@apple.com>
2759 - Changed public header includes to the <JavaScriptCore/ style.
2760 - Changed instances of 'buffer' to 'string' since we decided on
2761 JSInternalString instead of JSStringBuffer.
2763 * API/JSContextRef.h:
2764 * API/JSInternalStringRef.cpp:
2766 (JSInternalStringRetain):
2767 (JSInternalStringRelease):
2768 (JSValueCopyStringValue):
2769 (JSInternalStringGetLength):
2770 (JSInternalStringGetCharactersPtr):
2771 (JSInternalStringGetCharacters):
2772 (JSInternalStringGetMaxLengthUTF8):
2773 (JSInternalStringGetCharactersUTF8):
2774 (CFStringCreateWithJSInternalString):
2775 * API/JSInternalStringRef.h:
2777 (JSNodePrototype_appendChild):
2778 (JSNode_getNodeType):
2779 * API/JSObjectRef.cpp:
2780 (JSObjectCallAsConstructor):
2782 * API/JavaScriptCore.h:
2787 (MyObject_getPropertyList):
2788 (myConstructor_callAsConstructor):
2789 (main): I noticed that we were prematurely releasing some string buffers,
2790 so I moved their release calls to the end of main(). I got rid of 'Buf' in *Buf
2791 (sometimes changing to 'IString', when necessary to differentiate a variable)
2792 to match the buffer->string change.
2794 === Safari-521.16 ===
2796 2006-07-10 Darin Adler <darin@apple.com>
2798 * kjs/value.cpp: (KJS::JSValue::toInt32Inline): Added inline keyword one more place.
2801 2006-07-10 Darin Adler <darin@apple.com>
2803 - fix the release build
2807 (KJS::JSValue::toInt32Inline): Move the code here to an inline.
2808 (KJS::JSValue::toInt32): Call the inline from both overloaded toInt32 functions.
2810 2006-07-10 David Kilzer <ddkilzer@kilzer.net>
2814 - fix http://bugs.webkit.org/show_bug.cgi?id=9179
2815 Implement select.options.add() method
2817 * JavaScriptCore.exp: Added overloaded KJS::JSValue::toInt32() method.
2818 * JavaScriptCore.xcodeproj/project.pbxproj: Altered attributes metadata for
2819 kjs/value.h to make it available as a forwarded header.
2821 (KJS::lookupPut): Extracted a lookupPut() method from the existing lookupPut() method.
2822 The new method returns a boolean value if no entry is found in the lookup table.
2824 (KJS::JSValue::toInt32): Overloaded toInt32() method with boolean "Ok" argument.
2825 * kjs/value.h: Ditto.
2827 2006-07-10 Geoffrey Garen <ggaren@apple.com>
2829 No review necessary. Removed bogus file I accidentally checked in before.
2831 * API/JSInternalSringRef.h: Removed.
2833 2006-07-10 Geoffrey Garen <ggaren@apple.com>
2837 Added exception out parameter to API object callbacks, removed semi-bogus
2838 JSContext(.*)Exception functions.
2840 To make these calls syntactically simple, I added an exceptionSlot()
2841 method to the ExecState class, which provides a JSValue** slot in which to
2842 store a JSValue* exception.
2846 * API/JSCallbackConstructor.cpp:
2847 (KJS::JSCallbackConstructor::construct):
2848 * API/JSCallbackFunction.cpp:
2849 (KJS::JSCallbackFunction::callAsFunction):
2850 * API/JSCallbackObject.cpp:
2851 (KJS::JSCallbackObject::init):
2852 (KJS::JSCallbackObject::getOwnPropertySlot):
2853 (KJS::JSCallbackObject::put):
2854 (KJS::JSCallbackObject::deleteProperty):
2855 (KJS::JSCallbackObject::construct):
2856 (KJS::JSCallbackObject::callAsFunction):
2857 (KJS::JSCallbackObject::getPropertyList):
2858 (KJS::JSCallbackObject::toBoolean):
2859 (KJS::JSCallbackObject::toNumber):
2860 (KJS::JSCallbackObject::toString):
2861 (KJS::JSCallbackObject::staticValueGetter):
2862 (KJS::JSCallbackObject::callbackGetter):
2863 * API/JSContextRef.cpp:
2865 * API/JSContextRef.h:
2867 (JSNodePrototype_appendChild):
2868 (JSNodePrototype_removeChild):
2869 (JSNodePrototype_replaceChild):
2870 (JSNode_getNodeType):
2871 (JSNode_getChildNodes):
2872 (JSNode_getFirstChild):
2876 (JSNodeListPrototype_item):
2877 (JSNodeList_length):
2878 (JSNodeList_getProperty):
2879 * API/JSObjectRef.h:
2883 (MyObject_initialize):
2884 (MyObject_hasProperty):
2885 (MyObject_getProperty):
2886 (MyObject_setProperty):
2887 (MyObject_deleteProperty):
2888 (MyObject_getPropertyList):
2889 (MyObject_callAsFunction):
2890 (MyObject_callAsConstructor):
2891 (MyObject_convertToType):
2892 (print_callAsFunction):
2893 (myConstructor_callAsConstructor):
2895 * JavaScriptCore.exp:
2897 (KJS::ExecState::exceptionHandle):
2899 2006-07-10 Geoffrey Garen <ggaren@apple.com>
2903 Improved type safety by implementing opaque JSValue/JSObject typing through
2904 abuse of 'const', not void*. Also fixed an alarming number of bugs
2905 exposed by this new type safety.
2907 I made one design change in JavaScriptCore, which is that the JSObject
2908 constructor should take a JSValue* as its prototype argument, not a JSObject*,
2909 since we allow the prototype to be any JSValue*, including jsNull(), for
2915 * API/JSCallbackConstructor.cpp:
2916 (KJS::JSCallbackConstructor::construct):
2917 * API/JSCallbackFunction.cpp:
2918 (KJS::JSCallbackFunction::callAsFunction):
2919 * API/JSCallbackObject.cpp:
2920 (KJS::JSCallbackObject::JSCallbackObject):
2921 (KJS::JSCallbackObject::getOwnPropertySlot):
2922 (KJS::JSCallbackObject::put):
2923 (KJS::JSCallbackObject::construct):
2924 (KJS::JSCallbackObject::callAsFunction):
2925 (KJS::JSCallbackObject::staticFunctionGetter):
2926 * API/JSCallbackObject.h:
2927 * API/JSContextRef.cpp:
2930 (JSNodePrototype_appendChild):
2931 (JSNodePrototype_removeChild):
2932 (JSNodePrototype_replaceChild):
2933 * API/JSObjectRef.cpp:
2935 (JSFunctionMakeWithBody):
2936 (JSObjectGetProperty):
2937 (JSObjectCallAsFunction):
2938 (JSObjectCallAsConstructor):
2939 * API/JSObjectRef.h:
2944 (KJS::JSObject::JSObject):
2946 2006-07-10 Geoffrey Garen <ggaren@apple.com>
2948 Approved by Maciej, Darin.
2950 Renamed JSStringBufferRef to JSInternalStringRef. "Internal string" means the
2951 JavaScript engine's internal string representation, which is the most
2952 low-level and efficient representation to use when interfacing with JavaScript.
2958 * API/JSCallbackObject.cpp:
2959 (KJS::JSCallbackObject::getOwnPropertySlot):
2960 (KJS::JSCallbackObject::put):
2961 (KJS::JSCallbackObject::deleteProperty):
2962 (KJS::JSCallbackObject::staticValueGetter):
2963 (KJS::JSCallbackObject::callbackGetter):
2964 * API/JSContextRef.cpp:
2967 * API/JSContextRef.h:
2968 * API/JSInternalStringRef.cpp: Added.
2970 (JSInternalStringCreate):
2971 (JSInternalStringCreateUTF8):
2972 (JSInternalStringRetain):
2973 (JSInternalStringRelease):
2974 (JSValueCopyStringValue):
2975 (JSInternalStringGetLength):
2976 (JSInternalStringGetCharactersPtr):
2977 (JSInternalStringGetCharacters):
2978 (JSInternalStringGetMaxLengthUTF8):
2979 (JSInternalStringGetCharactersUTF8):
2980 (JSInternalStringIsEqual):
2981 (JSInternalStringIsEqualUTF8):
2982 (JSInternalStringCreateCF):
2983 (CFStringCreateWithJSInternalString):
2984 * API/JSInternalStringRef.h: Added.
2986 (JSNodePrototype_appendChild):
2987 (JSNode_getNodeType):
2988 (JSNode_getChildNodes):
2989 (JSNode_getFirstChild):
2991 (JSNodeList_length):
2992 (JSNodeList_getProperty):
2993 * API/JSObjectRef.cpp:
2994 (JSFunctionMakeWithBody):
2995 (JSObjectGetDescription):
2996 (JSObjectHasProperty):
2997 (JSObjectGetProperty):
2998 (JSObjectSetProperty):
2999 (JSObjectDeleteProperty):
3000 (JSPropertyEnumeratorGetNext):
3001 (JSPropertyListAdd):
3002 * API/JSObjectRef.h:
3003 * API/JSStringBufferRef.cpp: Removed.
3004 * API/JSStringBufferRef.h: Removed.
3006 * API/JavaScriptCore.h:
3011 (assertEqualsAsUTF8String):
3012 (assertEqualsAsCharactersPtr):
3013 (assertEqualsAsCharacters):
3014 (MyObject_hasProperty):
3015 (MyObject_getProperty):
3016 (MyObject_setProperty):
3017 (MyObject_deleteProperty):
3018 (MyObject_getPropertyList):
3019 (print_callAsFunction):
3020 (myConstructor_callAsConstructor):
3022 * JavaScriptCore.exp:
3023 * JavaScriptCore.xcodeproj/project.pbxproj:
3025 2006-07-08 Tim Omernick <timo@apple.com>
3029 Added an OpenGL drawing model to the Netscape Plug-in API.
3033 2006-07-08 Timothy Hatcher <timothy@apple.com>
3037 Moved KJS_GetCreatedJavaVMs to jni_utility.cpp.
3038 Switched KJS_GetCreatedJavaVMs over to use dlopen and dlsym
3039 now that NSAddImage, NSLookupSymbolInImage and NSAddressOfSymbol
3040 are deprecated in Leopard.
3042 * JavaScriptCore.exp:
3043 * JavaScriptCore.xcodeproj/project.pbxproj:
3044 * bindings/jni/jni_utility.cpp:
3045 (KJS::Bindings::KJS_GetCreatedJavaVMs):
3046 * bindings/softlinking.c: Removed.
3047 * bindings/softlinking.h: Removed.
3049 2006-07-08 Geoffrey Garen <ggaren@apple.com>
3053 - Make JSObjectGetProperty return a JSValue or NULL, like JSEvaluate does.
3055 * API/JSObjectRef.cpp:
3056 (JSObjectGetProperty):
3057 * API/JSObjectRef.h:
3061 2006-07-08 Geoffrey Garen <ggaren@apple.com>
3063 Style change -- no review necessary.
3065 Use 0 instead of NULL in API .cpp files, to match our style guidelines.
3067 * API/JSContextRef.cpp:
3069 * API/JSObjectRef.cpp:
3070 (JSFunctionMakeWithBody):
3071 (JSObjectCallAsFunction):
3072 (JSObjectCallAsConstructor):
3073 * API/JSValueRef.cpp:
3076 2006-07-08 Geoffrey Garen <ggaren@apple.com>
3080 - Added ability to pass NULL for thisObject when calling JSObjectCallAsFunction,
3081 to match JSEvaluate.
3083 * API/JSObjectRef.cpp:
3084 (JSObjectCallAsFunction):
3085 * API/JSObjectRef.h:
3089 === Safari-521.15 ===
3091 2006-07-07 Geoffrey Garen <ggaren@apple.com>
3095 - Standardized which functions take a JSContext as an argument. The rule is:
3096 if you might execute JavaScript, you take a JSContext, otherwise you don't.
3098 The FIXME in JSObjectRef.h requires refactoring some parts of Interpreter,
3099 but not API changes, so I'm putting it off until later.
3101 * API/JSCallbackObject.cpp:
3102 (KJS::JSCallbackObject::JSCallbackObject):
3103 (KJS::JSCallbackObject::init):
3104 * API/JSCallbackObject.h:
3105 * API/JSContextRef.cpp:
3107 * API/JSContextRef.h:
3108 * API/JSObjectRef.cpp:
3110 (JSPropertyEnumeratorGetNext):
3111 * API/JSObjectRef.h:
3113 (MyObject_initialize):
3115 * JavaScriptCore.exp:
3116 * kjs/array_object.cpp:
3117 (ArrayInstance::setLength):
3118 (ArrayInstance::pushUndefinedObjectsToEnd):
3120 (ForInNode::execute):
3121 * kjs/reference.cpp:
3122 (KJS::Reference::getPropertyName):
3123 (KJS::Reference::getValue):
3125 * kjs/scope_chain.cpp:
3126 (KJS::ScopeChain::print):
3128 2006-07-06 Geoffrey Garen <ggaren@apple.com>
3134 - Headerdoc finished
3137 - Added a JSContextRef argument to many functions, because you need a
3138 JSContextRef for doing virtually anything. I expect to add this argument
3139 to even more functions in a future patch.
3141 - Removed the globalObjectPrototype argument to JSContextCreate because
3142 you can't create an object until you have a context, so it's impossible
3143 to pass a prototype object to JSContextCreate. That's OK because (1) there's
3144 no reason to give the global object a prototype and (2) if you really want
3145 to, you can just use a separate call to JSObjectSetPrototype.
3147 - Removed the JSClassRef argument to JSClassCreate because it was unnecessary,
3148 and you need to be able to make the global object's class before you've
3149 created a JSContext.
3151 - Added an optional exception parameter to JSFunctionMakeWithBody because anything
3152 less would be uncivilized.
3154 - Made the return value parameter to JSObjectGetProperty optional to match
3155 all other return value parameters in the API.
3157 - Made JSObjectSetPrivate/JSObjectGetPrivate work on JSCallbackFunctions
3158 and JSCallbackConstructors. You could use an abstract base class or strategic
3159 placement of m_privateData in the class structure to implement this, but
3160 the former seemed like overkill, and the latter seemed too dangerous.
3162 - Fixed a bug where JSPropertyEnumeratorGetNext would skip the first property.
3165 - Reversed the logic of the JSChar #ifdef to avoid confusing headerdoc
3167 - Removed function names from @function declarations because headeroc
3168 can parse them automatically, and I wanted to rule out manual mismatch.
3170 - Changed Error::create to take a const UString& instead of a UString*
3171 because it was looking at me funny.
3173 - Renamed JSStringBufferCreateWithCFString to JSStringBufferCreateCF
3174 because the latter is more concise and it matches JSStringBufferCreateUTF8.
3176 * API/JSCallbackObject.cpp:
3177 (KJS::JSCallbackObject::getOwnPropertySlot):
3178 (KJS::JSCallbackObject::put):
3179 (KJS::JSCallbackObject::deleteProperty):
3180 (KJS::JSCallbackObject::getPropertyList):
3181 (KJS::JSCallbackObject::toBoolean):
3182 (KJS::JSCallbackObject::toNumber):
3183 (KJS::JSCallbackObject::toString):
3184 * API/JSClassRef.cpp:
3186 * API/JSContextRef.cpp:
3188 (JSContextSetException):
3189 * API/JSContextRef.h:
3191 (JSNodePrototype_class):
3194 (JSNodeListPrototype_class):
3196 * API/JSObjectRef.cpp:
3197 (JSObjectGetProperty):
3198 (JSObjectGetPrivate):
3199 (JSObjectSetPrivate):
3200 (JSObjectCallAsFunction):
3201 (JSObjectCallAsConstructor):
3202 (JSPropertyEnumeratorGetNext):
3203 * API/JSObjectRef.h:
3204 * API/JSStringBufferRef.cpp:
3205 (JSStringBufferCreateCF):
3206 * API/JSStringBufferRef.h:
3207 * API/JSValueRef.cpp:
3208 (JSValueIsInstanceOf):
3214 (MyObject_hasProperty):
3215 (MyObject_setProperty):
3216 (MyObject_deleteProperty):
3217 (MyObject_getPropertyList):
3218 (MyObject_convertToType):
3221 * JavaScriptCore.exp:
3223 2006-07-07 Geoffrey Garen <ggaren@apple.com>
3227 - Fixed a few crashes resulting from NULL parameters to JSClassCreate.
3229 * API/JSClassRef.cpp:
3232 * API/testapi.c: Added test for NULL parameters.
3235 2006-07-07 Geoffrey Garen <ggaren@apple.com>
3237 Reviewed by John, mocked by Darin.
3239 - Changed JSEvaluate to take a JSObjectRef instead of a JSValueRef as
3240 "this," since "this" must be an object.
3242 * API/JSContextRef.cpp:
3244 * API/JSContextRef.h:
3246 2006-07-07 Geoffrey Garen <ggaren@apple.com>
3253 * JavaScriptCore.xcodeproj/project.pbxproj:
3255 2006-07-05 Geoffrey Garen <ggaren@apple.com>
3259 Renamed JSCharBufferRef, which was universally unpopular, to JSStringBufferRef,
3260 which, hopefully, will be less unpopular.
3266 * API/JSCallbackObject.cpp:
3267 (KJS::JSCallbackObject::getOwnPropertySlot):
3268 (KJS::JSCallbackObject::put):
3269 (KJS::JSCallbackObject::deleteProperty):
3270 (KJS::JSCallbackObject::staticValueGetter):
3271 (KJS::JSCallbackObject::callbackGetter):
3272 * API/JSCharBufferRef.cpp: Removed.
3273 * API/JSCharBufferRef.h: Removed.
3274 * API/JSContextRef.cpp:
3277 * API/JSContextRef.h:
3279 (JSNodePrototype_appendChild):
3280 (JSNode_getNodeType):
3281 (JSNode_getChildNodes):
3282 (JSNode_getFirstChild):
3284 (JSNodeList_length):
3285 (JSNodeList_getProperty):
3286 * API/JSObjectRef.cpp:
3287 (JSFunctionMakeWithBody):
3288 (JSObjectGetDescription):
3289 (JSObjectHasProperty):
3290 (JSObjectGetProperty):
3291 (JSObjectSetProperty):
3292 (JSObjectDeleteProperty):
3293 (JSPropertyEnumeratorGetNext):
3294 (JSPropertyListAdd):
3295 * API/JSObjectRef.h:
3296 * API/JSStringBufferRef.cpp: Added.
3298 (JSStringBufferCreate):
3299 (JSStringBufferCreateUTF8):
3300 (JSStringBufferRetain):
3301 (JSStringBufferRelease):
3302 (JSValueCopyStringValue):
3303 (JSStringBufferGetLength):
3304 (JSStringBufferGetCharactersPtr):
3305 (JSStringBufferGetCharacters):
3306 (JSStringBufferGetMaxLengthUTF8):
3307 (JSStringBufferGetCharactersUTF8):
3308 (JSStringBufferIsEqual):
3309 (JSStringBufferIsEqualUTF8):
3310 (JSStringBufferCreateWithCFString):
3311 (CFStringCreateWithJSStringBuffer):
3312 * API/JSStringBufferRef.h: Added.
3314 * API/JavaScriptCore.h:
3319 (assertEqualsAsUTF8String):
3320 (assertEqualsAsCharactersPtr):
3321 (assertEqualsAsCharacters):
3322 (MyObject_hasProperty):
3323 (MyObject_getProperty):
3324 (MyObject_setProperty):
3325 (MyObject_deleteProperty):
3326 (MyObject_getPropertyList):
3327 (print_callAsFunction):
3328 (myConstructor_callAsConstructor):
3330 * JavaScriptCore.exp:
3331 * JavaScriptCore.xcodeproj/project.pbxproj:
3333 2006-07-05 Geoffrey Garen <ggaren@apple.com>
3337 Moved some code around for more logical file separation.
3340 * API/JSContextRef.h:
3341 * API/JSObjectRef.cpp:
3342 * API/JSValueRef.cpp:
3346 2006-07-03 Geoffrey Garen <ggaren@apple.com>
3350 Implemented JSFunctionMakeWithBody, which parses a script as a function body
3351 in the global scope, and returns the resulting anonymous function.
3353 I also removed private data from JSCallbackFunction. It never worked,
3354 since JSCallbackFunction doesn't inherit from JSCallbackObject.
3356 * API/JSCallbackConstructor.cpp: Removed.
3357 * API/JSCallbackConstructor.h: Removed.
3358 * API/JSCallbackFunction.cpp:
3359 (KJS::JSCallbackFunction::JSCallbackFunction):
3360 (KJS::JSCallbackFunction::implementsConstruct):
3361 (KJS::JSCallbackFunction::construct):
3362 (KJS::JSCallbackFunction::implementsCall):
3363 (KJS::JSCallbackFunction::callAsFunction):
3364 * API/JSCallbackFunction.h:
3365 * API/JSCallbackObject.cpp:
3366 (KJS::JSCallbackObject::staticFunctionGetter):
3367 * API/JSObjectRef.cpp:
3369 (JSFunctionMakeWithCallbacks):
3370 * API/JSObjectRef.h:
3376 * JavaScriptCore.exp: Programmatically added all symbols exported by
3377 API object files, and sorted results
3378 * JavaScriptCore.xcodeproj/project.pbxproj:
3380 2006-07-03 Geoffrey Garen <ggaren@apple.com>
3384 - Return syntax error in JSCheckSyntax through a JSValueRef* exception
3388 * API/JSContextRef.cpp:
3392 * JavaScriptCore.exp:
3393 * kjs/interpreter.cpp:
3394 (KJS::Interpreter::checkSyntax):
3395 * kjs/interpreter.h:
3397 2006-07-04 Darin Adler <darin@apple.com>
3401 * wtf/MathExtras.h: Oops. Added missing #endif.
3403 2006-07-04 Bjoern Graf <bjoern.graf@gmail.com>
3406 Tweaked a bit by Darin.
3408 - http://bugs.webkit.org/show_bug.cgi?id=9678
3409 work around MSVCRT's fmod function returning NaN for fmod(x, infinity) instead of x
3411 * wtf/MathExtras.h: Added include of <float.h>.
3412 (isinf): Fix to return false for NAN.
3413 (wtf_fmod): Added. An inline that works around the bug.
3416 * kjs/number_object.cpp:
3417 * kjs/operations.cpp:
3419 Added includes of MathExtras.h to all files using fmod.
3421 * JavaScriptCore.xcodeproj/project.pbxproj: Let Xcode 2.3 have its way with
3424 2006-07-01 Geoffrey Garen <ggaren@apple.com>
3428 - Refined value conversions in the API:
3429 - failed toNumber returns NaN
3430 - failed toObject returns NULL
3431 - failed toString returns empty string
3433 - Refined excpetion handling in the API:
3434 - failed value conversions do not throw exceptions
3435 - uncaught exceptions in JSEvaluate, JSObjectCallAsFunction, and
3436 JSObjectCallAsConstructor are returned through a JSValueRef* exception
3438 - removed JSContextHasException, because JSContextGetException does
3442 * API/JSCharBufferRef.cpp:
3443 (JSValueCopyStringValue):
3444 * API/JSContextRef.cpp:
3446 * API/JSContextRef.h:
3447 * API/JSNodeList.c: Added test code demonstrating how you would use
3448 toNumber, and why you probably don't need toUInt32, etc.
3449 (JSNodeListPrototype_item):
3450 (JSNodeList_getProperty):
3451 * API/JSObjectRef.cpp:
3453 (JSObjectCallAsFunction):
3454 (JSObjectCallAsConstructor):
3455 * API/JSObjectRef.h:
3456 * API/JSValueRef.cpp:
3462 (main): Added tests for new rules, and call to JSGCProtect to fix Intel
3464 * JavaScriptCore.exp:
3466 2006-07-03 Darin Adler <darin@apple.com>
3468 - Rolled out HashMap implementation of NPRuntime, at least temporarily.
3470 Fixes hang in the bindings section of layout tests seen on the
3473 This code was using HashMap<const char*, PrivateIdentifier*>.
3474 But that hashes based on pointer identity, not string value.
3475 The default hash for any pointer type is to hash based on the pointer.
3476 And WTF doesn't currently have a string hash for char*.
3477 We'll need to fix that before re-landing this patch.
3479 (Formatting was also incorrect -- extra spaces in parentheses.)
3481 * bindings/npruntime.cpp: Rolled out last change.
3483 2006-07-02 Justin Haygood <jhaygood@spsu.edu>
3485 Reviewed, tweaked, landed by ggaren.
3487 - Port NPRuntime from CFDictionary to HashMap.
3489 * bindings/npruntime.cpp:
3490 (getStringIdentifierDictionary):
3491 (getIntIdentifierDictionary):
3492 (_NPN_GetStringIdentifier):
3493 (_NPN_GetIntIdentifier):
3494 * bindings/npruntime.h:
3496 2006-07-01 Geoffrey Garen <ggaren@apple.com>
3500 - Fixed <rdar://problem/4611197> REGRESSION: Liveconnect with Java test
3501 fails at http://www-sor.inria.fr/~dedieu/notes/liveconnect/simple_example.html
3503 * JavaScriptCore.exp: Export symbols used by liveconnect
3505 2006-06-29 Geoffrey Garen <ggaren@apple.com>
3509 - Phase 2 in the JS API.
3511 - Added support for specifying static tables of values -- this should
3512 obviate the need for using complicated callbacks for most lookups.
3514 - API objects are now created with classes (JSClassRef) -- in order to support
3515 static values, and in order to prevent API objects from storing their
3516 data inline, and thus falling into the oversized (read: slow and prone to
3517 giving Maciej the frowny face) heap.
3519 - Added two specialized JSObject subclasses -- JSCallbackFunction and JSCallbackConstructor --
3520 to allow JSFunctionMake and JSConstructorMake to continue to work with
3521 the new class model. Another solution to this problem would be to create
3522 a custom class object for each function and constructor you make. This
3523 solution is more code but also more efficient.
3525 - Substantially beefed up the minidom example to demonstrate and test a
3526 lot of these techniques. Its output is still pretty haphazard, though.
3528 - Gave the <kjs/ preface to some includes -- I'm told this matters to
3529 building on some versions of Linux.
3531 - Implemented JSValueIsInstanceOf and JSValueIsObjectOfClass
3533 - Removed GetDescription callback. Something in the class datastructure
3534 should take care of this.
3537 * API/JSCallbackConstructor.cpp: Added.
3539 (KJS::JSCallbackConstructor::JSCallbackConstructor):
3540 (KJS::JSCallbackConstructor::implementsConstruct):
3541 (KJS::JSCallbackConstructor::construct):
3542 (KJS::JSCallbackConstructor::setPrivate):
3543 (KJS::JSCallbackConstructor::getPrivate):
3544 * API/JSCallbackConstructor.h: Added.
3545 (KJS::JSCallbackConstructor::classInfo):
3546 * API/JSCallbackFunction.cpp: Added.
3548 (KJS::JSCallbackFunction::JSCallbackFunction):
3549 (KJS::JSCallbackFunction::implementsCall):
3550 (KJS::JSCallbackFunction::callAsFunction):
3551 (KJS::JSCallbackFunction::setPrivate):
3552 (KJS::JSCallbackFunction::getPrivate):
3553 * API/JSCallbackFunction.h: Added.
3554 (KJS::JSCallbackFunction::classInfo):
3555 * API/JSCallbackObject.cpp:
3557 (KJS::JSCallbackObject::JSCallbackObject):
3558 (KJS::JSCallbackObject::init):
3559 (KJS::JSCallbackObject::~JSCallbackObject):
3560 (KJS::JSCallbackObject::className):
3561 (KJS::JSCallbackObject::getOwnPropertySlot):
3562 (KJS::JSCallbackObject::put):
3563 (KJS::JSCallbackObject::deleteProperty):
3564 (KJS::JSCallbackObject::implementsConstruct):
3565 (KJS::JSCallbackObject::construct):
3566 (KJS::JSCallbackObject::implementsCall):
3567 (KJS::JSCallbackObject::callAsFunction):
3568 (KJS::JSCallbackObject::getPropertyList):
3569 (KJS::JSCallbackObject::toBoolean):
3570 (KJS::JSCallbackObject::toNumber):
3571 (KJS::JSCallbackObject::toString):
3572 (KJS::JSCallbackObject::inherits):
3573 (KJS::JSCallbackObject::staticValueGetter):
3574 (KJS::JSCallbackObject::staticFunctionGetter):
3575 (KJS::JSCallbackObject::callbackGetter):
3576 * API/JSCallbackObject.h:
3577 * API/JSCharBufferRef.cpp:
3578 * API/JSClassRef.cpp: Added.
3582 * API/JSClassRef.h: Added.
3583 (StaticValueEntry::StaticValueEntry):
3584 (StaticFunctionEntry::StaticFunctionEntry):
3585 (__JSClass::__JSClass):
3586 * API/JSContextRef.cpp:
3589 * API/JSContextRef.h: