1 2006-11-20 Samuel Weinig <sam@webkit.org>
5 Fix for http://bugs.webkit.org/show_bug.cgi?id=11647
8 * kjs/config.h: define NOMINMAX instead of min/max
10 * wtf/Vector.h: put back hack to ensure that min/max
11 are not defined as macros.
13 2006-11-19 Simon Hausmann <hausmann@kde.org>
17 http://bugs.webkit.org/show_bug.cgi?id=11649
18 Fix CMake Qt-only build without KDE CMake files
21 * pcre/CMakeLists.txt:
23 2006-11-17 Anders Carlsson <acarlsson@apple.com>
27 Make sure that we always use std::min and std::max instead of macros.
29 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
35 2006-11-12 Geoffrey Garen <ggaren@apple.com>
37 Reviewed by Beth Dakin.
39 Added project-wide setting to disable Microsoft's made-up deprecation
40 warnings related to std:: functions. (Doesn't have any affect yet,
41 since we currently disable all deprecation warnings.)
43 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
45 2006-11-12 Mark Rowe <bdash@webkit.org>
49 Clean up of JavaScriptCore bakefiles.
51 * JavaScriptCoreSources.bkl:
54 2006-11-11 Alexey Proskuryakov <ap@webkit.org>
58 http://bugs.webkit.org/show_bug.cgi?id=11508
59 Undisable some warnings for JSImmediate.h
61 Fix suggested by Don Gibson.
64 Re-enable all MSVC warnings, move the remaining runtime checks
67 2006-11-10 Zalan Bujtas <zalan.bujtas@nokia.com>
71 Added s60/symbian platform defines.
72 http://bugs.webkit.org/show_bug.cgi?id=11540
78 2006-11-08 Ada Chan <adachan@apple.com>
82 Added a method to delete all the keys in a HashMap.
85 (WTF::deleteAllPairFirsts):
88 2006-11-07 Anders Carlsson <acarlsson@apple.com>
93 (OpaqueJSClass::OpaqueJSClass):
94 Initialize cachedPrototype to 0.
96 2006-11-06 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
100 Remove warning about garbage after #else. #else clause applies for all
101 non-mac platforms, not only win.
103 * kjs/date_object.cpp:
105 2006-11-06 Mark Rowe <bdash@webkit.org>
107 Reviewed by the wonderful Mitz Pettel.
109 http://bugs.webkit.org/show_bug.cgi?id=11524
110 Bug 11524: REGRESSION(r9842): Array.prototype.join should use ToString operator rather than calling toString on each element
112 * kjs/array_object.cpp:
113 (ArrayProtoFunc::callAsFunction): Use ToString operator on each element rather than calling their toString method.
115 2006-11-03 Steve Falkenburg <sfalken@apple.com>
121 2006-11-03 Alexey Proskuryakov <ap@nypop.com>
125 http://bugs.webkit.org/show_bug.cgi?id=11504
126 Fix warnings on non 32 bit platforms
129 (KJS::JSImmediate::NanAsBits):
130 (KJS::JSImmediate::oneAsBits):
131 Rewrite in a way that moves runtime checks to compile-time.
134 (KJS::JSImmediate::fromDouble):
135 (KJS::JSImmediate::toDouble):
137 2006-11-02 George Staikos <staikos@kde.org>
142 Remove a deprecated pthreads call.
144 2006-11-02 Anders Carlsson <acarlsson@apple.com>
146 Reviewed by Maciej, landed by Anders.
149 Make KDE support optional.
151 2006-11-01 Kevin McCullough <KMcCullough@apple.com>
155 - 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.
158 (KJS::equivalentYearForDST):
159 (KJS::getDSTOffsetSimple):
162 2006-10-31 Geoffrey Garen <ggaren@apple.com>
166 Fixed http://bugs.webkit.org/show_bug.cgi?id=11477
167 REGRESSION: GMail crashes in KJS::FunctionImp::callerGetter
170 (KJS::FunctionImp::argumentsGetter): Removed unnecessary braces.
171 (KJS::FunctionImp::callerGetter): More logical NULL checking.
173 2006-10-31 Oliver Hunt <oliver@apple.com>
177 Adding definition for PLATFORM(CI)
181 2006-10-31 Vladimir Olexa <vladimir.olexa@gmail.com>
185 http://bugs.webkit.org/show_bug.cgi?id=4166
186 Function object does not support caller property
188 Test: fast/js/caller-property.html
191 (KJS::FunctionImp::callerGetter): added
192 (KJS::FunctionImp::getOwnPropertySlot): added if statement to handle callerGetter()
193 * kjs/function.h: added callerGetter() declaration
194 * kjs/identifier.h: added caller property macro
195 * tests/mozilla/expected.html:
197 2006-10-30 Kevin McCullough <KMcCullough@apple.com>
201 - Fix some timezone issues and JavaScriptCore date tests. Addresses bugzilla 4930.
204 (KJS::GregorianDateTime::GregorianDateTime): Here's the fix, to add parenthesis for order of precedence.
205 * kjs/date_object.cpp:
206 (KJS::DateProtoFunc::callAsFunction):
207 (KJS::DateObjectImp::construct): memset not needed as GregorianDateTime initializes itself.
209 2006-10-30 Darin Adler <darin@apple.com>
211 Reviewed by John Sullivan.
213 * kjs/SavedBuiltins.h: Added needed include.
214 * wtf/OwnPtr.h: (WTF::OwnPtr::set): Fixed mistake in assertion.
216 2006-10-28 Darin Adler <darin@apple.com>
220 - renamed PassRefPtr::release to releaseRef to make it clearer that
221 it's the counterpart of adoptRef, and to make it harder to confuse
222 it with the safer-to-use RefPtr::release
224 * kjs/identifier.cpp:
225 (KJS::CStringTranslator::translate):
226 (KJS::UCharBufferTranslator::translate):
228 (KJS::UString::Rep::create):
230 (WTF::PassRefPtr::PassRefPtr):
231 (WTF::PassRefPtr::~PassRefPtr):
232 (WTF::PassRefPtr::get):
233 (WTF::PassRefPtr::releaseRef):
234 (WTF::PassRefPtr::operator->):
235 (WTF::PassRefPtr::operator=):
237 (WTF::static_pointer_cast):
238 (WTF::const_pointer_cast):
240 (WTF::RefPtr::RefPtr):
241 (WTF::RefPtr::operator=):
243 2006-10-28 Darin Adler <darin@apple.com>
247 * kjs/grammar.y: Add definitions of YYMALLOC and YYFREE to fix
248 a warning some people see (not sure why others don't see it).
250 * JavaScriptCore.vcproj/JavaScriptCore/grammarWrapper.cpp: Touch
251 this file to force it to re-build grammar.cpp.
253 2006-10-28 Darin Adler <darin@apple.com>
257 - made changes so the code compiles with the highest warning level
258 under MSVC (disabling some warnings, making some code fixes)
260 * API/JSCallbackConstructor.cpp:
261 (KJS::JSCallbackConstructor::construct):
262 * API/JSCallbackFunction.cpp:
263 (KJS::JSCallbackFunction::callAsFunction):
264 * API/JSCallbackObject.cpp:
265 (KJS::JSCallbackObject::init):
266 (KJS::JSCallbackObject::construct):
267 (KJS::JSCallbackObject::callAsFunction):
268 * API/JSObjectRef.cpp:
269 (JSPropertyNameArrayGetNameAtIndex):
270 * API/JSStringRef.cpp:
271 (JSStringCreateWithCharacters):
272 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
273 * bindings/c/c_utility.cpp:
274 (KJS::Bindings::convertUTF8ToUTF16):
275 (KJS::Bindings::coerceValueToNPVariantStringType):
276 (KJS::Bindings::convertValueToNPVariant):
278 (KJS::GregorianDateTime::GregorianDateTime):
280 (KJS::ExecState::hadException):
282 (KJS::JSImmediate::fromDouble):
283 (KJS::JSImmediate::toDouble):
284 (KJS::JSImmediate::NanAsBits):
285 (KJS::JSImmediate::oneAsBits):
287 * kjs/PropertyNameArray.h:
288 (KJS::PropertyNameArray::size):
289 * kjs/array_object.cpp:
290 (ArrayObjectImp::callAsFunction):
291 * kjs/bool_object.cpp:
292 (BooleanObjectImp::callAsFunction):
294 (KJS::Collector::allocate):
295 (KJS::Collector::markCurrentThreadConservatively):
296 (KJS::Collector::collect):
298 (KJS::Completion::isValueCompletion):
299 * kjs/date_object.cpp:
302 (Debugger::sourceParsed):
303 (Debugger::sourceUnused):
304 (Debugger::exception):
305 (Debugger::atStatement):
306 (Debugger::callEvent):
307 (Debugger::returnEvent):
309 * kjs/error_object.cpp:
310 (ErrorObjectImp::callAsFunction):
311 (NativeErrorImp::callAsFunction):
313 (KJS::FunctionImp::processVarDecls):
314 (KJS::GlobalFuncImp::callAsFunction):
315 * kjs/function_object.cpp:
316 (FunctionPrototype::callAsFunction):
318 * kjs/identifier.cpp:
319 (KJS::CStringTranslator::translate):
320 (KJS::Identifier::add):
324 (Lexer::isIdentStart):
325 (Lexer::isIdentPart):
328 (Lexer::isOctalDigit):
329 (Lexer::matchPunctuator):
330 (Lexer::singleEscape):
331 (Lexer::convertOctal):
333 (Lexer::convertUnicode):
336 * kjs/math_object.cpp:
337 (MathFuncImp::callAsFunction):
338 * kjs/number_object.cpp:
339 (integer_part_noexp):
341 (NumberProtoFunc::callAsFunction):
342 (NumberObjectImp::callAsFunction):
344 (KJS::JSObject::deleteProperty):
345 (KJS::JSObject::callAsFunction):
346 (KJS::JSObject::toBoolean):
347 (KJS::JSObject::toObject):
349 (KJS::JSObject::getPropertySlot):
350 * kjs/property_map.cpp:
352 (KJS::PropertyMap::put):
353 (KJS::PropertyMap::insert):
354 (KJS::PropertyMap::containsGettersOrSetters):
355 * kjs/property_map.h:
356 (KJS::PropertyMap::hasGetterSetterProperties):
357 * kjs/property_slot.h:
358 * kjs/string_object.cpp:
359 (StringInstance::getPropertyNames):
360 (StringObjectImp::callAsFunction):
361 (StringObjectFuncImp::callAsFunction):
363 (KJS::UString::Rep::computeHash):
364 (KJS::UString::UString):
365 (KJS::UString::from):
366 (KJS::UString::append):
367 (KJS::UString::ascii):
368 (KJS::UString::operator=):
369 (KJS::UString::find):
370 (KJS::UString::rfind):
374 (KJS::UCharReference::low):
375 (KJS::UCharReference::high):
377 (KJS::JSValue::toUInt16):
379 * pcre/pcre_compile.c:
380 (get_othercase_range):
383 * pcre/pcre_internal.h:
384 * wtf/HashFunctions.h:
386 (WTF::PtrHash::hash):
391 * wtf/StringExtras.h:
393 * wtf/unicode/icu/UnicodeIcu.h:
394 (WTF::Unicode::isPrintableChar):
396 2006-10-26 W. Andy Carrel <wac@google.com>
400 - Fix http://bugs.webkit.org/show_bug.cgi?id=7445 /
401 <rdar://problem/4614195> (and 7253 / <rdar://4694011>) by changing
402 inline regexps so that they can have \u escaped Unicode sequences and
408 (Lexer::shift): Looking ahead one additional character for the benefit
410 (Lexer::scanRegExp): Change code to support unicode escapes in inline
412 * kjs/lexer.h: Extra lookahead added.
414 === Safari-521.29 ===
416 2006-10-26 Nikolas Zimmermann <zimmermann@kde.org>
420 Fix build with older gcc 3.3.4.
422 * kjs/DateMath.cpp: Remove inline prefix.
423 (KJS::equivalentYearForDST):
425 2006-10-26 Darin Adler <darin@apple.com>
429 - fix iteration of properties of string objects (found because of a warning
430 emitted by the MSVC compiler)
432 * kjs/string_object.cpp: (StringInstance::getPropertyNames): Change code that
433 wants to format a number as a string to use UString::from. Before it was using
434 the UString constructor that makes a string from a character!
437 * kjs/ustring.cpp: Remove the dangerous and not all that helpful UString(char)
440 * kjs/grammar.y: Change code to not depend on the UString(char) constructor.
441 This is potentially more efficient anyway because we could overload the + operator
442 some day to handle char* directly instead of creating a UString.
444 * kjs/nodes2string.cpp: (SourceStream::operator<<): Change code to not depend on
445 the UString(char) constructor.
447 2006-10-25 Kevin McCullough <KMcCullough@apple.com>
449 Reviewed by Steve (rubber stamp).
451 - Link against your local build of JavaScriptCore.lib first, this fixes some errors on release builds of testkjs.
453 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
455 2006-10-25 Geoffrey Garen <ggaren@apple.com>
459 Removed duplicate symbol declaration.
461 * JavaScriptCore.xcodeproj/project.pbxproj:
464 2006-10-24 Steve Falkenburg <sfalken@apple.com>
468 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
470 2006-10-24 Kevin McCullough <KMcCullough@apple.com>
474 - 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.
476 * kjs/date_object.cpp:
478 (KJS::formatLocaleDate):
479 (KJS::DateProtoFunc::callAsFunction):
481 2006-10-23 Kevin McCullough <KMcCullough@apple.com>
487 * JavaScriptCore.xcodeproj/project.pbxproj:
490 2006-10-23 Kevin McCullough <KMcCullough@apple.com>
494 - Makes the toTM function an operator. Was going to piggy back on a patch but the patch needs more work.
497 (KJS::equivalentYearForDST):
499 (KJS::GregorianDateTime::operator tm):
500 * kjs/date_object.cpp:
502 (KJS::DateProtoFunc::callAsFunction):
504 2006-10-23 Kevin McCullough <KMcCullough@apple.com>
508 - 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).
513 2006-10-21 Steve Falkenburg <sfalken@apple.com>
517 Add minimal compatibility with MSVCRT leak checker
521 2006-10-23 Kevin McCullough <KMcCullough@apple.com>
525 - Sets the lowercase range correctly in the test and consolidates a variable to make the test more readable.
527 * tests/mozilla/ecma/String/15.5.4.11-2.js:
529 2006-10-21 Darin Adler <darin@apple.com>
533 - http://bugs.webkit.org/show_bug.cgi?id=11377
534 swap(Vector, Vector) should be O(1) instead of O(n)
537 (WTF::VectorBuffer::swap): Added.
538 (WTF::Vector::swap): Added.
539 (WTF::swap): Added overload that takes two Vector objects.
541 2006-10-21 Darin Adler <darin@apple.com>
545 - http://bugs.webkit.org/show_bug.cgi?id=11376
546 build scripts should invoke make with "-j" option for multiple processors
548 * JavaScriptCore.xcodeproj/project.pbxproj: Pass -j `sysctl -n hw.ncpu` to make.
550 2006-10-19 Kevin McCullough <KMcCullough@apple.com>
554 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.
555 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.
557 * tests/mozilla/ecma/String/15.5.4.11-2.js:
559 2006-10-18 Maciej Stachowiak <mjs@apple.com>
563 - remove vestiges of KXMLCore name (former name of WTF).
571 * wtf/FastMallocInternal.h:
574 * wtf/HashCountedSet.h:
575 * wtf/HashFunctions.h:
588 * wtf/StringExtras.h:
592 * wtf/VectorTraits.h:
594 2006-10-17 Steve Falkenburg <sfalken@apple.com>
600 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
602 2006-10-17 Kevin McCullough <KMcCullough@apple.com>
606 Fixed a date issue where the UTC offset was not set in win.
609 (KJS::getDSTOffsetSimple):
611 (KJS::msToGregorianDateTime):
614 (KJS::GregorianDateTime::GregorianDateTime):
616 2006-10-17 Kevin McCullough <KMcCullough@apple.com>
620 Fixes a JavaScriptCore math issue on win.
622 * kjs/math_object.cpp:
623 (MathFuncImp::callAsFunction):
627 2006-10-16 Kevin McCullough <kmccullough@apple.com>
631 Removed unecessary global specifiers.
633 * kjs/math_object.cpp:
634 (MathFuncImp::callAsFunction):
636 2006-10-16 Kevin McCullough <KMcCullough@apple.com>
640 Fixes a compile order issue for testkjs on win.
642 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
644 2006-10-15 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
648 Remove junk (as gcc calls it) after #else clause.
650 * wtf/FastMalloc.cpp:
653 2006-10-14 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
657 Define KXMLCORE_USE_CURL for platforms that wish to use CURL as
658 networking, and set it for GDK build
662 2006-10-13 Marvin Decker <marv.decker@gmail.com>
664 Reviewed by Kevin McCullough.
666 Fixes http://bugs.webkit.org/show_bug.cgi?id=11283
667 Fixes Qt/Linux and Windows build
671 * kjs/date_object.cpp:
672 (KJS::DateProtoFunc::callAsFunction):
674 2006-10-13 Kevin McCullough <KMcCullough@apple.com>
676 Reviewed by Adam, Geoff, Darin.
678 Fixed displaying the UTC offset and time zone string, as well as renamed the GregorianDateTime structure and clean up.
683 (KJS::getDSTOffsetSimple):
684 (KJS::gregorianDateTimeToMS):
685 (KJS::msToGregorianDateTime):
687 (KJS::GregorianDateTime::GregorianDateTime):
688 (KJS::GregorianDateTime::~GregorianDateTime):
689 (KJS::GregorianDateTime::toTM):
690 * kjs/date_object.cpp:
693 (KJS::formatDateUTCVariant):
695 (KJS::fillStructuresUsingTimeArgs):
696 (KJS::fillStructuresUsingDateArgs):
697 (KJS::DateInstance::getTime):
698 (KJS::DateInstance::getUTCTime):
699 (KJS::DateProtoFunc::callAsFunction):
700 (KJS::DateObjectImp::construct):
701 (KJS::DateObjectImp::callAsFunction):
702 (KJS::DateObjectFuncImp::callAsFunction):
706 2006-10-13 Kevin McCullough <KMcCullough@apple.com>
710 Gets JavaScripCore tests running on windows.
712 * Scripts/run-javascriptcore-tests:
713 * Scripts/webkitdirs.pm:
715 2006-10-12 Geoffrey Garen <ggaren@apple.com>
719 Removed JSObjectMakeWithPrototype, clarified some comments. We really
720 don't want people to manage their own prototypes, so we don't want an
721 extra function in the API devoted to just that. People can still manage
722 their own prototypes if they really want by using JSObjectSetPrototype.
724 * API/JSClassRef.cpp:
725 (OpaqueJSClass::createNoAutomaticPrototype):
726 (OpaqueJSClass::create):
728 * API/JSObjectRef.cpp:
734 * JavaScriptCore.exp:
736 2006-10-12 Kevin McCullough <KMcCullough@apple.com>
744 * kjs/date_object.cpp:
747 2006-10-11 Kevin McCullough <KMcCullough@apple.com>
751 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.
756 (KJS::getDSTOffsetSimple):
762 * kjs/date_object.cpp:
765 (KJS::DateProtoFunc::callAsFunction):
766 (KJS::DateObjectImp::construct):
767 (KJS::DateObjectImp::callAsFunction):
768 (KJS::DateObjectFuncImp::callAsFunction):
772 2006-10-09 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
776 Improve gdk build compiler flags (show warning, no rtti and exceptions).
780 2006-10-06 Kevin McCullough <KMcCullough@apple.com>
784 DST and TimeZones were wrong in some cases, specifically on some of the dates where DST changes.
787 (KJS::equivalentYearForDST):
789 (KJS::getDSTOffsetSimple):
791 (KJS::dateToMseconds):
794 * kjs/date_object.cpp:
797 2006-10-05 Darin Adler <darin@apple.com>
799 Reviewed by Kevin McCullough.
801 * wtf/Assertions.cpp: Fix build when _DEBUG is not defined.
803 2006-10-04 Kevin McCullough <KMcCullough@apple.com>
807 - 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.
812 * kjs/date_object.cpp:
816 2006-10-04 Geoffrey Garen <ggaren@apple.com>
818 Patch by Darin and me, reviewed by Maciej.
820 Fixed <rdar://problem/4518397> REGRESSION(?): Oft-seen but unrepro crash
821 in JavaScript garbage collection (KJS::Collector::collect())
822 <rdar://problem/4752492> Crash in KJS::collect
824 The issue here was allocating one garbage-collected object in the midst
825 of allocating a second garbage-collected object. In such a case, the
826 zeroIfFree word lies.
829 (KJS::Collector::allocate):
830 (KJS::Collector::collect):
832 2006-10-04 Kevin McCullough <KMcCullough@apple.com>
839 (KJS::dateToDayInYear): accept and correctly handle negative months
841 2006-10-05 Kevin McCullough <KMcCullough@apple.com>
846 (KJS::dateToDayInYear):
848 2006-10-05 Mark Rowe <bdash@webkit.org>
850 Reviewed by maculloch.
854 * JavaScriptCoreSources.bkl: Add DateMath.cpp to file list.
856 2006-10-05 Kevin McCullough <KMcCullough@apple.com>
862 * JavaScriptCore.xcodeproj/project.pbxproj:
864 2006-10-04 Nikolas Zimmermann <zimmermann@kde.org>
868 Fix Qt/Linux build by adding DateMath.cpp to compilation.
870 * CMakeLists.txt: Also replace tabs with spaces.
872 2006-10-04 Kevin McCullough <KMcCullough@apple.com>
874 Reviewed by DethBakin.
876 - 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.
881 (KJS::dateToDayInYear):
883 2006-10-05 Darin Adler <darin@apple.com>
887 * wtf/Assertions.cpp: Changed assertion formatting to omit the "======"
888 lines so you can see more assertions in less space. Also improved format
889 of file/line information so it works with more development environments.
891 2006-10-04 Kevin McCullough <KMcCullough@apple.com>
895 - The build machine is more sensitive about automatic conversions. These fixes exp
896 licitly cast or change the input and return types of functions to avoid conversions.
898 * JavaScriptCore.xcodeproj/project.pbxproj:
904 (KJS::monthToDayInYear):
905 (KJS::dateToDayInYear):
906 (KJS::getDSTOffsetSimple):
908 (KJS::dateToMseconds):
911 2006-10-04 Kevin McCullough <KMcCullough@apple.com>
915 - 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.
917 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
918 * JavaScriptCore.xcodeproj/project.pbxproj:
919 * kjs/DateMath.cpp: Added.
922 (KJS::daysFrom1970ToYear):
923 (KJS::msFrom1970ToYear):
929 (KJS::msToMilliseconds):
935 (KJS::msToDayInMonth):
936 (KJS::monthToDayInYear):
937 (KJS::timeToMseconds):
938 (KJS::dateToDayInYear):
939 (KJS::equivalentYearForDST):
941 (KJS::getDSTOffsetSimple):
943 (KJS::localTimeToUTC):
944 (KJS::UTCToLocalTime):
945 (KJS::dateToMseconds):
948 * kjs/DateMath.h: Added.
950 * kjs/date_object.cpp:
953 (KJS::DateInstance::getTime):
954 (KJS::DateInstance::getUTCTime):
955 (KJS::DateProtoFunc::callAsFunction):
956 (KJS::DateObjectImp::construct):
957 (KJS::DateObjectFuncImp::callAsFunction):
962 2006-10-02 Nikolas Zimmermann <zimmermann@kde.org>
964 Reviewed/landed by Adam.
966 Build testkjs on Qt/Linux.
970 2006-10-02 Nikolas Zimmermann <zimmermann@kde.org>
972 Reviewed by eseidel. Landed by eseidel.
974 Fix win32 build, which has no inttypes.h
978 2006-10-02 Nikolas Zimmermann <zimmermann@kde.org>
980 Reviewed by eseidel & mjs. Landed by eseidel.
982 Fix Qt/Linux build with older gcc 3.3.4.
983 http://bugs.webkit.org/show_bug.cgi?id=11116
985 * kjs/lookup.h: Move cacheGlobalObject into KJS namespace.
986 (KJS::cacheGlobalObject): Also remove GCC_ROOT_NS_HACK.
987 * wtf/Assertions.h: Include inttypes.h for uintptr_t.
989 2006-09-28 Steve Falkenburg <sfalken@apple.com>
993 Use $(ConfigSuffix) set via vsprops files to add _debug
994 to end of debug filenames.
996 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
997 * JavaScriptCore.vcproj/debug.vsprops: Added.
998 * JavaScriptCore.vcproj/dftables/dftables.vcproj:
999 * JavaScriptCore.vcproj/release.vsprops: Added.
1000 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
1002 2006-09-28 Darin Adler <darin@apple.com>
1006 - support for change that should fix <rdar://problem/4733044>
1007 REGRESSION: XML iBench shows 10% perf. regression (copying
1008 strings while decoding)
1010 * wtf/Vector.h: Changed VectorBuffer so that the general case
1011 contains an instance of the 0 case, since deriving from it
1012 was violating the Liskov Substitution Principle.
1013 (WTF::VectorBuffer::releaseBuffer): Added. Releases the buffer so it can
1014 be adopted by another data structure that uses the FastMalloc.h allocator.
1015 Returns 0 if the internal buffer was being used.
1016 (WTF::Vector::releaseBuffer): Added. Releases the buffer as above or creates
1017 a new one in the case where the internal buffer was being used.
1019 2006-09-28 Maciej Stachowiak <mjs@apple.com>
1023 - change garbage collection to happen at increments proportional to number of live objects, not always
1024 every 1000 allocations
1026 * kjs/collector.cpp:
1027 (KJS::Collector::allocate):
1029 2006-09-28 Maciej Stachowiak <mjs@apple.com>
1033 - fixed REGRESSION (r16606): javascriptCore Crash on website load
1037 - fixed some possible off-by-one bugs
1038 - use indexing, not iterators, for Vectors
1039 - store Vector by pointer instead of by value to avoid blowing out FunctionImp size
1042 (KJS::FunctionImp::addParameter):
1043 (KJS::FunctionImp::parameterString):
1044 (KJS::FunctionImp::processParameters):
1045 (KJS::FunctionImp::lengthGetter):
1046 (KJS::FunctionImp::getParameterName):
1049 2006-09-27 Steve Falkenburg <sfalken@apple.com>
1055 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1056 * JavaScriptCore.vcproj/JavaScriptCore/dstroot-to-sdk.cmd: Removed.
1058 2006-09-27 John Sullivan <sullivan@apple.com>
1061 (KJS::FunctionImp::getParameterName):
1062 removed assertion that displeased gcc 4.0.1 (build 5420):
1063 ASSERT(static_cast<size_t>(index) == index);
1065 2006-09-27 Kevin McCullough <KMcCullough@apple.com>
1069 Cleanup of previous fix which was to address Radar: 4752492
1072 (KJS::FunctionImp::addParameter):
1073 (KJS::FunctionImp::parameterString):
1074 (KJS::FunctionImp::processParameters):
1075 (KJS::FunctionImp::lengthGetter):
1076 (KJS::FunctionImp::getParameterName):
1079 2006-09-27 Kevin McCullough <KMcCullough@apple.com>
1083 Fixes a GC stack overflow crash.
1084 The change is to move from a linked list implementation of Parameters to a Vector.
1085 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.
1088 (KJS::Parameter::Parameter):
1089 (KJS::FunctionImp::addParameter):
1090 (KJS::FunctionImp::parameterString):
1091 (KJS::FunctionImp::processParameters):
1092 (KJS::FunctionImp::lengthGetter):
1093 (KJS::FunctionImp::getParameterName):
1096 2006-09-27 Steve Falkenburg <sfalken@apple.com>
1100 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1102 2006-09-27 Steve Falkenburg <sfalken@apple.com>
1104 Set path before build.
1106 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1108 2006-09-27 Sean Gies <seangies@apple.com>
1110 Reviewed by Adam Roben.
1112 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Debug config should link to debug runtime.
1113 * JavaScriptCore.vcproj/dftables/dftables.vcproj: Debug config should link to debug runtime.
1115 2006-09-27 Don Melton <gramps@apple.com>
1117 Reviewed by Adam Roben.
1119 Changed line ending from DOS to UNIX format so it doesn't die running
1122 * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
1124 2006-09-23 Alexey Proskuryakov <ap@nypop.com>
1128 http://bugs.webkit.org/show_bug.cgi?id=10183
1129 REGRESSION: obfuscated JS decoding breaks because of soft hyphen removal
1130 (Fanfiction.net author pages not listing stories)
1132 Rolled out the fix for bug 4139.
1137 * tests/mozilla/ecma/Array/15.4.5.1-1.js:
1138 * tests/mozilla/expected.html:
1140 2006-09-22 Steve Falkenburg <sfalken@apple.com>
1144 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1146 2006-09-22 Darin Adler <darin@apple.com>
1150 * wtf/Vector.h: Add an append that takes a pointer and length.
1151 Generalize the existing Vector append to work on vectors with
1152 any value for inlineCapacity. Change the append algorithm so
1153 it doesn't check capacity each time through the loop.
1155 2006-09-22 Steve Falkenburg <sfalken@apple.com>
1159 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1161 2006-09-21 Geoffrey Garen <ggaren@apple.com>
1165 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1166 Updated to include the right path.
1167 * wtf/FastMalloc.h: #include Platform.h, since we use Platform macros.
1169 === Safari-521.27 ===
1171 2006-09-20 Anders Carlsson <acarlsson@apple.com>
1173 Reviewed by Dave Hyatt.
1178 2006-09-20 Sean Gies <seangies@apple.com>
1180 Reviewed by Steve Falkenburg.
1182 * wtf/Assertions.cpp: Debug messages should go into debugger console.
1184 2006-09-20 David Hyatt <hyatt@apple.com>
1186 Add an implementation of lrint for Win32.
1193 2006-09-15 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
1197 http://bugs.webkit.org/show_bug.cgi?id=10864
1198 Bug 10864: Linux\GDK build fixes
1200 * JavaScriptCoreSources.bkl:
1203 2006-09-15 Adam Roben <aroben@apple.com>
1207 * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
1209 2006-09-15 Anders Carlsson <acarlsson@apple.com>
1211 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1212 Fix the release build.
1214 2006-09-15 Anders Carlsson <acarlsson@apple.com>
1218 Add JavaScriptCore API to the build.
1220 * API/JSCallbackConstructor.cpp:
1221 * API/JSCallbackFunction.cpp:
1222 * API/JSCallbackObject.cpp:
1223 * API/JSClassRef.cpp:
1224 * API/JSContextRef.cpp:
1225 * API/JSObjectRef.cpp:
1226 * API/JSStringRef.cpp:
1227 * API/JSValueRef.cpp:
1228 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1229 * os-win32/stdbool.h: Added.
1231 2006-09-12 Steve Falkenburg <sfalken@apple.com>
1235 Build tweaks (doing JavaScriptCore now since it doesn't have
1238 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1239 * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
1240 * JavaScriptCore.vcproj/JavaScriptCore/dstroot-to-sdk.cmd: Added.
1241 * JavaScriptCore.vcproj/dftables/dftables.vcproj:
1242 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
1244 2006-09-11 Brady Eidson <beidson@apple.com>
1246 Build fix - I think Tim's last checkin wasn't tested on Tiger, possibly. I simply
1247 commented out the undefined constants until he can have a chance to make the right call
1249 * bindings/objc/objc_utility.mm:
1250 (KJS::Bindings::objcValueTypeForType): Commented out undefined symbols
1252 2006-09-11 Timothy Hatcher <timothy@apple.com>
1254 Reviewed by Tim O. and Darin.
1256 Add support for more method signatures affecting ObjC methods called from JavaScript:
1257 - Added unsigned types and long long.
1258 - Allow methods that use const, oneway, bycopy and byref type modifiers.
1260 * bindings/objc/objc_instance.mm:
1261 (ObjcInstance::invokeMethod):
1262 * bindings/objc/objc_utility.h:
1264 * bindings/objc/objc_utility.mm:
1265 (KJS::Bindings::convertValueToObjcValue):
1266 (KJS::Bindings::convertObjcValueToValue):
1267 (KJS::Bindings::objcValueTypeForType):
1269 2006-09-05 Timothy Hatcher <timothy@apple.com>
1273 <rdar://problem/4715840> SEL is not char*
1275 * bindings/objc/objc_class.mm:
1276 (KJS::Bindings::ObjcClass::methodsNamed): use sel_getName instead of a char* cast.
1277 * bindings/objc/objc_runtime.mm:
1278 (ObjcFallbackObjectImp::callAsFunction): ditto
1280 2006-09-03 Alexey Proskuryakov <ap@nypop.com>
1284 http://bugs.webkit.org/show_bug.cgi?id=10693
1285 Convert JavaScript arrays to AppleScript lists
1287 * JavaScriptCore.exp: Export ArrayInstance::info and ArrayInstance::getItem().
1288 * kjs/array_instance.h:
1289 * kjs/array_object.cpp:
1290 (ArrayInstance::getItem): Added a method to access array items from C++.
1292 2006-09-02 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
1296 Bug 10454: Unix bakefile fixes
1297 http://bugs.webkit.org/show_bug.cgi?id=10454
1299 * JavaScriptCoreSources.bkl:
1301 2006-09-01 Nikolas Zimmermann <zimmermann@kde.org>
1303 Reviewed by hyatt. Landed by eseidel.
1307 * pcre/CMakeLists.txt: Add wtf/ include.
1309 2006-09-01 Nikolas Zimmermann <zimmermann@kde.org>
1311 Reviewed and landed by ap.
1313 Fix build on Linux (C89 without gcc extensions enabled).
1315 * pcre/pcre_internal.h: Use C style comments.
1316 * wtf/Assertions.h: Use C style comments.
1317 * wtf/Platform.h: Use C style comments.
1319 2006-09-01 Steve Falkenburg <sfalken@apple.com>
1323 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1324 * JavaScriptCore.vcproj/dftables/dftables.vcproj:
1326 2006-08-31 Anders Carlsson <acarlsson@apple.com>
1330 Add new portability functions to MathExtras.h and add StringExtras.h which is for
1331 string portability functions.
1333 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1334 * bindings/c/c_instance.cpp:
1335 * kjs/date_object.cpp:
1339 * wtf/StringExtras.h: Added.
1343 2006-08-31 Anders Carlsson <acarlsson@apple.com>
1349 * JavaScriptCore.vcproj/dftables/dftables.vcproj:
1350 * pcre/pcre_internal.h:
1352 2006-08-31 Timothy Hatcher <timothy@apple.com>
1356 Band-aid fix for PCRE to compile for ppc64 and x86_64 now that
1357 we use -Wshorten-64-to-32. Adds an INT_CAST macro that ASSERTs
1358 the value <= INT_MAX.
1360 I filed <rdar://problem/4712064> to track the need to verify
1361 PCRE's 64-bit compliance.
1363 * pcre/pcre_compile.c:
1372 (pcre_get_substring_list):
1373 * pcre/pcre_internal.h:
1374 * pcre/pcre_tables.c:
1375 * pcre/pcre_try_flipped.c:
1376 (_pcre_try_flipped):
1378 2006-08-30 Darin Adler <darin@apple.com>
1380 Reviewed by Tim Hatcher.
1382 - add WTF::getPtr, a function template that makes it possible to write
1383 generic code that gets a raw pointer out of any of our pointer types
1385 * JavaScriptCore.xcodeproj/project.pbxproj:
1386 * wtf/GetPtr.h: Added.
1387 * wtf/ListRefPtr.h: (WTF::getPtr): Added.
1388 * wtf/OwnArrayPtr.h: (WTF::getPtr): Added.
1389 * wtf/OwnPtr.h: (WTF::getPtr): Added.
1390 * wtf/PassRefPtr.h: (WTF::getPtr): Added.
1391 * wtf/RefPtr.h: (WTF::getPtr): Added.
1393 2006-08-29 waylonis <waylonis@google.com>
1395 Reviewed, tweaked by ggaren.
1397 - Added storage and accessor functions for ExecState as a fix for
1398 http://bugs.webkit.org/show_bug.cgi?id=10114
1400 * kjs/ExecState.cpp:
1401 (KJS::ExecState::ExecState):
1404 (KJS::Context::setExecState):
1405 (KJS::Context::execState):
1407 2006-08-30 Nikolas Zimmermann <zimmermann@kde.org>
1411 Commit KDE related tweaks, to be able to
1412 differentiate between a Qt-only or a KDE build.
1414 * CMakeLists.txt: Install wtf-unity library.
1415 * wtf/Platform.h: Add define for the KDE platform.
1417 2006-08-28 Darin Adler <darin@apple.com>
1421 * kjs/list.h: Use explicit in constructor (as appropriate).
1423 2006-08-24 Nikolas Zimmermann <zimmermann@kde.org>
1425 Reviewed, tweaked and landed by ap
1427 http://bugs.webkit.org/show_bug.cgi?id=10467
1428 WebKit should have Qt platform support (Part II)
1430 * CMakeLists.txt: Adjust to Anders' build fixes.
1431 * wtf/Platform.h: Fix define for the Qt platform (we don't use/need Cairo.)
1433 2006-08-23 David Hyatt <hyatt@apple.com>
1435 Fix Platform.h to include #defines for graphics features.
1439 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1442 2006-08-23 Anders Carlsson <acarlsson@apple.com>
1446 Make the bindings compile without CoreFoundation.
1448 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1449 * bindings/c/c_instance.cpp:
1450 * bindings/c/c_utility.cpp:
1451 (KJS::Bindings::convertUTF8ToUTF16):
1453 * bindings/runtime.cpp:
1454 (KJS::Bindings::Instance::createBindingForLanguageInstance):
1455 (KJS::Bindings::Instance::createLanguageInstanceForValue):
1456 * bindings/runtime_root.cpp:
1457 * bindings/runtime_root.h:
1458 * kjs/interpreter.cpp:
1459 (KJS::Interpreter::createLanguageInstanceForValue):
1460 * kjs/interpreter.h:
1462 2006-08-22 Anders Carlsson <acarlsson@apple.com>
1466 Move the npruntime code over to using HashMap and the runtime_root code over to using
1467 HashMap and HashCountedSet.
1469 * bindings/NP_jsobject.cpp:
1470 * bindings/c/c_utility.cpp:
1471 (KJS::Bindings::identifierFromNPIdentifier):
1472 * bindings/c/c_utility.h:
1473 * bindings/jni/jni_jsobject.cpp:
1474 (JavaJSObject::invoke):
1475 * bindings/npruntime.cpp:
1476 (getStringIdentifierMap):
1477 (getIntIdentifierMap):
1478 (_NPN_GetStringIdentifier):
1479 (_NPN_GetIntIdentifier):
1480 * bindings/runtime_root.cpp:
1481 (getReferencesByRootMap):
1483 (KJS::Bindings::findReferenceSet):
1484 (KJS::Bindings::rootForImp):
1485 (KJS::Bindings::rootForInterpreter):
1486 (KJS::Bindings::addNativeReference):
1487 (KJS::Bindings::removeNativeReference):
1488 (RootObject::removeAllNativeReferences):
1489 * bindings/runtime_root.h:
1491 2006-08-22 Anders Carlsson <acarlsson@apple.com>
1495 Switch over the NPAPI and Java bindings to using HashMaps instead of dictionaries.
1497 * JavaScriptCore.xcodeproj/project.pbxproj:
1498 * bindings/c/c_class.cpp:
1499 (KJS::Bindings::CClass::CClass):
1500 (KJS::Bindings::CClass::~CClass):
1501 (KJS::Bindings::CClass::classForIsA):
1502 (KJS::Bindings::CClass::methodsNamed):
1503 (KJS::Bindings::CClass::fieldNamed):
1504 * bindings/c/c_class.h:
1505 * bindings/jni/jni_class.cpp:
1506 (JavaClass::JavaClass):
1507 (JavaClass::~JavaClass):
1508 (JavaClass::methodsNamed):
1509 (JavaClass::fieldNamed):
1510 * bindings/jni/jni_class.h:
1511 * bindings/objc/objc_class.h:
1512 * bindings/objc/objc_class.mm:
1513 (KJS::Bindings::deleteMethod):
1514 (KJS::Bindings::deleteField):
1516 (KJS::Bindings::ObjcClass::methodsNamed):
1517 (KJS::Bindings::ObjcClass::fieldNamed):
1518 * bindings/runtime.cpp:
1519 * bindings/runtime.h:
1520 * bindings/runtime_object.cpp:
1521 (RuntimeObjectImp::fieldGetter):
1522 (RuntimeObjectImp::getOwnPropertySlot):
1523 (RuntimeObjectImp::put):
1524 (RuntimeObjectImp::canPut):
1526 2006-08-21 Vladimir Olexa <vladimir.olexa@gmail.com>
1530 http://bugs.webkit.org/show_bug.cgi?id=6252
1531 JavaScript 1.6 Array.lastIndexOf
1533 Test: fast/js/array-lastIndexOf.html
1535 * kjs/array_object.cpp:
1536 (ArrayProtoFunc::callAsFunction): Added a LastIndexOf case.
1537 * kjs/array_object.h:
1538 (KJS::ArrayProtoFunc::): Added LastIndexOf to enum.
1539 * tests/mozilla/expected.html: Two more tests now pass.
1541 2006-08-20 Nikolas Zimmermann <zimmermann@kde.org>
1543 Reviewed by Maciej. Landed by rwlbuis.
1545 Fixes parts of: http://bugs.webkit.org/show_bug.cgi?id=10463
1546 WebKit should have Qt platform support
1548 Removing obsolete QConstString/QString constructors in kjs code.
1553 2006-08-17 Nikolas Zimmermann <zimmermann@kde.org>
1555 Reviewed by Maciej. Landed by rwlbuis.
1557 Fixes: http://bugs.webkit.org/show_bug.cgi?id=10463
1558 WTF Changes needed for Qt platform code.
1561 * wtf/unicode/UnicodeDecomposition.h: Added.
1563 * wtf/unicode/UnicodeDirection.h: Added.
1565 * wtf/unicode/qt4/UnicodeQt4.cpp: Added.
1566 (WTF::Unicode::direction):
1567 (WTF::Unicode::category):
1568 (WTF::Unicode::decomposition):
1569 * wtf/unicode/qt4/UnicodeQt4.h:
1570 (WTF::Unicode::toLower):
1571 (WTF::Unicode::toUpper):
1572 (WTF::Unicode::isPrintableChar):
1573 (WTF::Unicode::isSpace):
1574 (WTF::Unicode::isPunct):
1575 (WTF::Unicode::isDigit):
1576 (WTF::Unicode::mirroredChar):
1577 (WTF::Unicode::compare):
1579 2006-08-17 Nikolas Zimmermann <zimmermann@kde.org>
1581 Reviewed by Eric. Landed by rwlbuis.
1583 Fixes: http://bugs.webkit.org/show_bug.cgi?id=10464
1584 Offer a cmake build system for Qt platform.
1586 * CMakeLists.txt: Added.
1587 * pcre/CMakeLists.txt: Added.
1589 2006-08-17 Anders Carlsson <acarlsson@apple.com>
1596 2006-08-15 Steve Falkenburg <sfalken@apple.com>
1602 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1605 2006-08-15 Mark Rowe <opendarwin.org@bdash.net.nz>
1609 Build fix: DWARF and -gfull are incompatible with symbol separation.
1611 * JavaScriptCore.xcodeproj/project.pbxproj:
1613 2006-08-15 Mark Rowe <opendarwin.org@bdash.net.nz>
1617 http://bugs.webkit.org/show_bug.cgi?id=10394
1618 Bug 10394: WebKit Release and Production configurations should enable dead code stripping
1620 * JavaScriptCore.xcodeproj/project.pbxproj:
1622 2006-08-15 Mark Rowe <opendarwin.org@bdash.net.nz>
1626 http://bugs.webkit.org/show_bug.cgi?id=10384
1627 Bug 10384: Switch to DWARF for Release configuration
1629 * JavaScriptCore.xcodeproj/project.pbxproj:
1631 2006-08-13 Maks Orlovich <maksim@kde.org>
1633 Reviewed (and tweaked a little) by Maciej.
1635 - shrank the size of JSObject by 8 bytes and made the corresponding reduction to the cell size, resulting
1636 in a 1.2% speed improvement on JS iBench (and probably overall memory savings).
1638 This was done by removing _scope and _internalValue data members
1639 from JSObject and moving them only to the subclasses that actually
1643 (KJS::JSObject::mark): No need to mark scope or internal value here.
1645 (KJS::JSObject::JSObject): Don't initialize them.
1646 * kjs/JSWrapperObject.cpp: Added. New base class for object types that
1647 wrap primitive values (Number, String, Boolean, Date).
1648 (KJS::JSWrapperObject::mark):
1649 * kjs/JSWrapperObject.h: Added.
1650 (KJS::JSWrapperObject::JSWrapperObject):
1651 (KJS::JSWrapperObject::internalValue):
1652 (KJS::JSWrapperObject::setInternalValue):
1653 * kjs/array_object.cpp:
1654 (ArrayPrototype::ArrayPrototype): Don't set useless internal value.
1655 * kjs/bool_object.cpp:
1656 (BooleanInstance::BooleanInstance): Inherit from JSWrapperObject.
1657 (BooleanProtoFunc::callAsFunction): Fixed to account for fact that not all
1658 JSObjects have an internal value.
1659 (BooleanObjectImp::construct): ditto.
1660 * kjs/bool_object.h:
1661 * kjs/collector.cpp: Lowered cell size to 48.
1662 (KJS::Collector::allocate): meaningless whitespace change
1663 * kjs/date_object.cpp:
1664 (KJS::DateInstance::DateInstance): Inherit from JSWrapperObject.
1665 (KJS::DateProtoFunc::callAsFunction): adjusted for move of internalValue
1666 (KJS::DateObjectImp::construct): ditto
1667 * kjs/date_object.h:
1668 * kjs/error_object.cpp:
1669 (ErrorPrototype::ErrorPrototype): don't set internal value
1670 * kjs/function.cpp: move _scope and related handling here
1671 (KJS::FunctionImp::mark): mark scope
1673 (KJS::FunctionImp::scope): moved here from JSObject
1674 (KJS::FunctionImp::setScope): ditto
1675 * kjs/number_object.cpp:
1676 (NumberInstance::NumberInstance): inherit from JSWrapperObject
1677 (NumberProtoFunc::callAsFunction): adjusted
1678 (NumberObjectImp::construct): adjusted
1679 * kjs/number_object.h: shring RegExp-related objects a little
1680 * kjs/regexp_object.cpp:
1681 (RegExpPrototype::RegExpPrototype): Adjust for size tweaks
1682 (RegExpObjectImp::RegExpObjectImp): ditto
1683 * kjs/regexp_object.h:
1684 * kjs/string_object.cpp:
1685 (StringInstance::StringInstance): inherit from JSWrapperObject
1686 (StringProtoFunc::callAsFunction): adjusted
1687 * kjs/string_object.h:
1688 * JavaScriptCore.exp: Exported new methods as needed.
1689 * JavaScriptCore.xcodeproj/project.pbxproj: Added new files to build.
1691 2006-08-04 Brady Eidson <beidson@apple.com>
1693 Reviewed by Geoff's rubber stamp
1695 Fix a build break on Intel hardware causes by adapting stricter
1696 compiler warnings (-Wshorten-64-to-32)
1699 (assertEqualsAsNumber): manually cast some doubles to floats
1702 2006-08-04 Sam Weinig <sam.weinig@gmail.com>
1706 - patch for http://bugs.webkit.org/show_bug.cgi?id=10192
1707 Make WebCore (and friends) compile with -Wshorten-64-to-32
1709 * Adds -Wshorten-64-to-32 flag to Xcode project.
1710 * Adds explicit casts where OK.
1714 (JSNodeList_getProperty):
1715 * JavaScriptCore.xcodeproj/project.pbxproj:
1717 2006-08-04 Adam Roben <aroben@apple.com>
1721 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Convert
1724 2006-08-03 Sam Weinig <sam.weinig@gmail.com>
1728 - patch for http://bugs.webkit.org/show_bug.cgi?id=10176
1729 Make WebCore compile with -Wundef
1731 * Adds -Wundef flag to Xcode project
1732 * Converts #ifs to #ifdef and #ifndefs where needed.
1733 * Added #define YYMAXDEPTH 10000 in kjs/grammar.y
1734 to fix a warning from within Bison.
1736 * JavaScriptCore.xcodeproj/project.pbxproj:
1737 * bindings/jni/jni_jsobject.cpp:
1738 (JavaJSObject::getSlot):
1739 (JavaJSObject::setSlot):
1741 * bindings/objc/objc_class.mm:
1742 (KJS::Bindings::ObjcClass::methodsNamed):
1743 (KJS::Bindings::ObjcClass::fieldNamed):
1744 * bindings/objc/objc_instance.mm:
1745 (ObjcInstance::invokeMethod):
1746 * bindings/objc/objc_runtime.mm:
1747 (ObjcMethod::getMethodSignature):
1753 2006-08-03 Anders Carlsson <acarlsson@apple.com>
1755 Reviewed by John Sullivan.
1759 Return *this in operator=
1761 2006-08-03 Adam Roben <aroben@apple.com>
1765 - Fixed Windows build
1767 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1768 * wtf/MathExtras.h: Implement inline versions of these functions
1772 2006-08-02 Adam Roben <aroben@apple.com>
1778 * kjs/date_object.cpp:
1781 2006-07-29 Darin Adler <darin@apple.com>
1783 - Removed tabs from these source files that still had them.
1784 We don't use them; that way source files look fine in editors
1785 that have tabs set to 8 spaces or to 4 spaces.
1786 - Removed allow-tabs Subversion property from the files too.
1788 * bindings/NP_jsobject.cpp:
1789 * bindings/c/c_utility.cpp:
1790 * bindings/jni/jni_runtime.cpp:
1791 * bindings/jni/jni_utility.cpp:
1792 * bindings/objc/objc_utility.mm:
1793 * bindings/runtime.cpp:
1794 * bindings/runtime_method.cpp:
1795 * bindings/testbindings.cpp:
1796 * bindings/testbindings.mm:
1797 * kjs/date_object.cpp:
1802 * kjs/string_object.cpp:
1805 2006-07-29 Darin Adler <darin@apple.com>
1807 * tests/mozilla/expected.html: Update test results now that regress-185165.js
1808 is succeeding. I suspect Anders fix for bug 4620655 is the reason.
1810 2006-07-29 Sam Weinig <sam.weinig@gmail.com>
1814 - patch for http://bugs.webkit.org/show_bug.cgi?id=10080
1815 Adopt pedantic changes from the Unity project to improve
1816 cross-compiler compatibility
1819 * Removing trailing semicolon from namespace braces.
1820 * Removing trailing comma from last enum declaration.
1821 * Updating to match style guidelines.
1822 * Adding missing newline to the end of the file.
1823 * Turning on gcc warning for missing newline at the end of a source file
1824 (GCC_WARN_ABOUT_MISSING_NEWLINE in Xcode, -Wnewline in gcc).
1825 * Alphabetical sorting of Xcode source list files.
1826 * Replace use of non-portable variable-size array with Vector.
1827 * Use C-style comments instead of C++ comments in files that might
1828 be included by either C or C++ files.
1830 * API/JSCallbackConstructor.cpp:
1831 (KJS::JSCallbackConstructor::construct):
1832 * API/JSCallbackFunction.cpp:
1833 (KJS::JSCallbackFunction::callAsFunction):
1834 * API/JSCallbackObject.cpp:
1835 (KJS::JSCallbackObject::construct):
1836 (KJS::JSCallbackObject::callAsFunction):
1837 * JavaScriptCore.xcodeproj/project.pbxproj:
1838 * JavaScriptCorePrefix.h:
1839 * bindings/jni/jni_class.cpp:
1840 (JavaClass::fieldNamed):
1841 * bindings/jni/jni_class.h:
1842 * bindings/jni/jni_instance.cpp:
1843 (JavaInstance::JavaInstance):
1844 (JavaInstance::valueOf):
1845 * bindings/jni/jni_objc.mm:
1846 (KJS::Bindings::dispatchJNICall):
1847 * bindings/jni/jni_runtime.cpp:
1848 (JavaParameter::JavaParameter):
1849 (JavaArray::JavaArray):
1850 * bindings/jni/jni_runtime.h:
1851 * bindings/jni/jni_utility.h:
1852 * bindings/objc/objc_instance.h:
1853 * bindings/runtime_array.h:
1859 2006-07-29 Mike Emmel <mike.emmel@gmail.com>
1863 - fixes for Linux build
1865 * JavaScriptCoreSources.bkl: Added new files to build, kjs/PropertyNameArray.cpp
1866 and kjs/testkjs.cpp, and removed old files.
1868 2006-07-24 Dan Waylonis <waylonis@google.com>
1870 Reviewed and tweaked a bit by Darin.
1872 - fix http://bugs.webkit.org/show_bug.cgi?id=9902
1873 jsNull and NSNull not properly converted between JS and ObjC
1875 * bindings/objc/objc_utility.mm: (KJS::Bindings::convertObjcValueToValue):
1876 Added case for converting NSNull to jsNull.
1878 2006-07-24 Rob Buis <buis@kde.org>
1882 http://bugs.webkit.org/show_bug.cgi?id=4258
1883 Date().toString() only includes GMT offset, not timezone string
1885 Use the info in tm_zone to append timezone abbreviation
1886 to Date().toString().
1888 * kjs/date_object.cpp:
1891 2006-07-24 Rob Buis <buis@kde.org>
1895 http://bugs.webkit.org/show_bug.cgi?id=5257
1896 setYear() does not match FireFox/IE behavior
1898 Make sure the right values end up in tm_year.
1900 * kjs/date_object.cpp:
1903 2006-07-23 Mark Rowe <opendarwin.org@bdash.net.nz>
1907 Bug 9686: [Drosera] Need the ability to break into Drosera on Javascript exceptions
1908 http://bugs.webkit.org/show_bug.cgi?id=9686
1910 JavaScriptCore portion of the fix.
1912 * JavaScriptCore.exp: Update symbol for change in argument type.
1914 (Debugger::detach): Clear map of recent exceptions.
1915 (Debugger::hasHandledException): Track the most recent exception
1916 thrown by an interpreter.
1917 (Debugger::exception): Change exception argument to a JSValue.
1920 (Node::debugExceptionIfNeeded): Notify the debugger of an exception
1921 if it hasn't seen it before.
1922 (ThrowNode::execute): Notify the debugger that an exception is being thrown.
1925 2006-07-23 Geoffrey Garen <ggaren@apple.com>
1927 Patch by Eric Albert, reviewed by Darin and me.
1929 - Fixed <rdar://problem/4645931> JavaScriptCore stack-scanning code
1930 crashes (Collector::markStackObjectsConservatively)
1932 * bindings/jni/jni_jsobject.cpp: On 64bit systems, jint is a long, not an
1934 (JavaJSObject::getSlot):
1935 (JavaJSObject::setSlot):
1936 * kjs/collector.cpp:
1937 (KJS::Collector::markCurrentThreadConservatively): Use a pointer instead of
1938 an int as 'dummy,' because on LP64 systems, an int is not pointer-aligned,
1939 and we want to scan the stack for pointers.
1940 * JavaScriptCore.xcodeproj/project.pbxproj: After a tense cease-fire, the
1941 XCode war has started up again!
1943 === Safari-521.20 ===
1945 2006-07-21 Geoffrey Garen <ggaren@apple.com>
1949 <rdar://problem/4507265> REGRESSION: overlays don't work on HousingMaps.com (Google Maps-based site)
1951 - Added support for strings that masquerade as undefined. Currently used
1952 by WebCore to implement undetectable style.filter.
1954 The name is a little long, but it's only used in one line of code, so I
1955 thought clarity should win over brevity.
1957 * JavaScriptCore.exp:
1958 * JavaScriptCore.xcodeproj/project.pbxproj:
1960 * kjs/string_object.h:
1961 (KJS::StringInstanceThatMasqueradesAsUndefined::StringInstanceThatMasqueradesAsUndefined):
1962 (KJS::StringInstanceThatMasqueradesAsUndefined::masqueradeAsUndefined):
1963 (KJS::StringInstanceThatMasqueradesAsUndefined::toBoolean):
1965 === Safari-521.19 ===
1967 2006-07-20 Steve Falkenburg <sfalken@apple.com>
1972 (KJS::escapeStringForPrettyPrinting):
1974 2006-07-19 Anders Carlsson <acarlsson@apple.com>
1978 <rdar://problem/4620655> REGRESSION(10.4.7-10.5): preview button for a blogger.com post doesn't work
1980 * kjs/nodes2string.cpp:
1981 (StringNode::streamTo):
1982 Return the escaped string.
1984 (RegExpNode::streamTo):
1985 Use the correct syntax.
1988 (KJS::escapeStringForPrettyPrinting):
1990 Add escape function which escapes a string for pretty-printing so it can be parsed again.
1992 * wtf/unicode/icu/UnicodeIcu.h:
1993 (WTF::Unicode::isPrintableChar):
1996 2006-07-18 Maciej Stachowiak <mjs@apple.com>
1998 Reviewed by Adele Peterson.
2000 <rdar://problem/4589530> REGRESSION: null character in JS string causes parse error (works in Tiger and in other browsers)
2006 (Lexer::scanRegExp):
2009 2006-07-18 Tim Omernick <timo@apple.com>
2011 Reviewed by Tim Hatcher.
2013 Removed a misleading comment; we recently added support for the NPNVPluginElementNPObject
2018 === Safari-521.18 ===
2020 2006-07-18 Timothy Hatcher <timothy@apple.com>
2022 Made the following headers public:
2031 * JavaScriptCore.xcodeproj/project.pbxproj:
2033 2006-07-17 Geoffrey Garen <ggaren@apple.com>
2037 - Added automatic prototype creation for classes.
2039 A class stores a weak reference to a prototype, which is cleared when
2040 the prototype is garbage collected, to avoid a reference cycle.
2042 We now have an attributes field in JSClassDefinition, that currently is
2043 used only to override automatic prototype creation when you want to manage your
2044 own prototypes, but can be extended in the future for other nefarious purposes.
2046 Similarly, we have JSObjectMake and JSObjectMakeWithPrototype, the latter
2047 allowing you to manage your own prototypes.
2049 JSObjectMakeConstructor is more interesting now, able to make a constructor
2050 on your behalf if you just give it a class.
2052 - Removed bogus old code from minidom.js.
2054 - Tweaked the headerdocs.
2056 - Added more GC testing, which caught some leaks, and tested more funny
2057 edge cases in lookup, which caught a lookup bug. Removed some testing
2058 we used to do with MyObject because it was redundant with the new, cool
2061 While fixing the lookup bug I retracted this change:
2063 "If a static setProperty callback returns 'false', to indicate that the
2064 property was not set, we no longer forward the set request up the class
2065 chain, because that's almost certainly not what the programmer expected."
2067 Returning false when setting a static property is a little silly, but you can see
2068 it being useful when shadowing a base class's static properties, and, regardless
2069 of usefullness, this is the defined behavior of the setProperty callback.
2071 - Plus a little ASCII art, for the kids.
2073 2006-07-17 Timothy Hatcher <timothy@apple.com>
2077 <rdar://problem/4634874> WebScriptObject and WebUndefined are no longer defined by WebKit
2079 Moves WebScriptObject and WebUndefined up to WebCore.
2080 This change does create an upwards-dependancy on WebScriptObject existing
2081 in the loaded process, but this code path in JavaScriptCore does not get used
2082 unless it is through WebKit/WebCore. Moving all of the binding code out of
2083 JavaScriptCore might make sense in the future.
2085 * JavaScriptCore.exp:
2086 * JavaScriptCore.xcodeproj/project.pbxproj:
2087 * bindings/objc/WebScriptObject.h: Replaced.
2088 * bindings/objc/WebScriptObject.mm: Removed.
2089 * bindings/objc/WebScriptObjectPrivate.h: Removed.
2090 * bindings/objc/objc_class.h:
2091 * bindings/objc/objc_instance.h:
2092 * bindings/objc/objc_instance.mm:
2093 (ObjcInstance::~ObjcInstance):
2094 * bindings/objc/objc_runtime.h:
2095 * bindings/objc/objc_runtime.mm:
2096 (convertValueToObjcObject):
2097 * bindings/objc/objc_utility.mm:
2098 (KJS::Bindings::convertValueToObjcValue):
2099 (KJS::Bindings::convertObjcValueToValue):
2100 (KJS::Bindings::createObjcInstanceForValue):
2102 2006-07-17 Darin Adler <darin@apple.com>
2104 * API/JSBase.h: Fix comment formatting where things used to be lined up but
2105 are now ragged. Got rid of spaces that attempted to line things up.
2106 * API/JSObjectRef.h: Ditto. Also add missing periods for a couple of comments.
2108 2006-07-17 Geoffrey Garen <ggaren@apple.com>
2112 - Removed the exception parameter from the initialize callback and, by extension,
2113 JSObjectMake. We have never had a need for exceptions when iniitializing,
2114 so the parameter seemed likely to "get in the way."
2116 Also, an exception in JavaScript is thrown in response to input --
2117 "invalid URL", "index not a number", etc., so it's the job of the
2118 constructor function, not the initialize method, to throw.
2120 If initialize *really* wants to throw, it can communicate the throw to
2121 the constructor through the constructed object's private data (e.g., set
2122 it to NULL, signaling to the consntructor that initialization failed.)
2124 - Added JSObjectMakeWithData, which enables a constructor to set private
2125 data on an object *before* it has been initialized. That way, the initialize
2126 methods can properly operate on the data.
2128 * API/JSNode.c: Moved ref into the initialize method, for better encapsulation,
2129 now that it's possible.
2130 * API/JSNodeList.c: ditto
2132 (main): Do more aggressive garbage collection to test ref/deref and
2133 initialize/finalize.
2134 * API/minidom.js: store childNodes in a temporary so it doesn't get re-created
2135 like a thousand times. This makes debugging ref/deref easier
2137 2006-07-17 Geoffrey Garen <ggaren@apple.com>
2141 - Changed the initialize callback to run from least derived class (parent
2142 class) to most derived class. This enables C++ style initialization,
2143 and derived class overriding of member data.
2145 - Added excpetion propopgation to JSObjectMake, to support initialize
2146 exceptions, and generally round out our policy of making function
2147 signatures as long as possible.
2149 * API/JSCallbackObject.h: Use ExecState instead of ContextRef, cuz we're
2152 2006-07-17 Geoffrey Garen <ggaren@apple.com>
2156 - Changed JSObjectMakeConstructor to JSObjectMakeConstructorWithCallback,
2157 to match JSObjectMakeFunctionWithCallback.
2159 - Added prototype parameter, so the generated constructor
2160 automatically works with hasInstance / instanceof
2162 - Moved hasInstance implementation from InternalFunctionImp to JSObject
2163 so that subclasses can inherit it without inheriting function-related baggage.
2164 More refactoring here would be good, but this seems like a good short-term
2167 (KJS::JSCallbackFunction::implementsHasInstance): override and return false,
2168 because callback functions aren't constructors.
2170 2006-07-17 Maciej Stachowiak <mjs@apple.com>
2174 - add a JSContextRef parameter to all JSValueRef, JSObjectRef, and JSContextRef operations;
2175 except JSObject{Get,Set}PrivateData which can be assumed to be simple pure accessors.
2177 Also renamed the parameter "context" to "ctx" because it makes the code read better with this pervasive
2178 but usually uninteresting parameter.
2182 (JSCheckScriptSyntax):
2185 * API/JSCallbackObject.cpp:
2186 (KJS::JSCallbackObject::JSCallbackObject):
2187 (KJS::JSCallbackObject::init):
2188 (KJS::JSCallbackObject::getOwnPropertySlot):
2189 (KJS::JSCallbackObject::put):
2190 (KJS::JSCallbackObject::deleteProperty):
2191 (KJS::JSCallbackObject::toNumber):
2192 (KJS::JSCallbackObject::toString):
2193 * API/JSContextRef.cpp:
2194 (JSGlobalContextCreate):
2195 (JSGlobalContextRetain):
2196 (JSGlobalContextRelease):
2197 (JSContextGetGlobalObject):
2198 * API/JSContextRef.h:
2200 (JSNodePrototype_appendChild):
2201 (JSNodePrototype_removeChild):
2202 (JSNodePrototype_replaceChild):
2203 (JSNode_getNodeType):
2204 (JSNode_getFirstChild):
2207 (JSNodeListPrototype_item):
2208 (JSNodeList_length):
2209 (JSNodeList_getProperty):
2210 (JSNodeList_prototype):
2211 * API/JSObjectRef.cpp:
2213 (JSObjectMakeFunctionWithCallback):
2214 (JSObjectMakeConstructor):
2215 (JSObjectMakeFunction):
2216 (JSObjectGetPrototype):
2217 (JSObjectSetPrototype):
2218 (JSObjectHasProperty):
2219 (JSObjectGetProperty):
2220 (JSObjectSetProperty):
2221 (JSObjectGetPropertyAtIndex):
2222 (JSObjectSetPropertyAtIndex):
2223 (JSObjectDeleteProperty):
2224 (JSObjectIsFunction):
2225 (JSObjectCallAsFunction):
2226 (JSObjectIsConstructor):
2227 (JSObjectCallAsConstructor):
2228 (JSObjectCopyPropertyNames):
2229 * API/JSObjectRef.h:
2230 * API/JSStringRef.cpp:
2231 * API/JSValueRef.cpp:
2233 (JSValueIsUndefined):
2239 (JSValueIsObjectOfClass):
2241 (JSValueIsStrictEqual):
2242 (JSValueIsInstanceOfConstructor):
2243 (JSValueMakeUndefined):
2245 (JSValueMakeBoolean):
2246 (JSValueMakeNumber):
2247 (JSValueMakeString):
2250 (JSValueToStringCopy):
2258 (MyObject_getProperty):
2259 (MyObject_deleteProperty):
2260 (MyObject_callAsFunction):
2261 (MyObject_callAsConstructor):
2262 (MyObject_convertToType):
2263 (print_callAsFunction):
2266 2006-07-16 Geoffrey Garen <ggaren@apple.com>
2268 Approved by Maciej, RS by Beth.
2270 JSObjectMakeFunction -> JSObjectMakeFunctionWithCallback
2271 JSObjectMakeFunctionWithBody -> JSObjectMakeFunction
2273 because the latter is more common, and more fundamental, than the former.
2278 * API/JSCallbackObject.cpp:
2279 (KJS::JSCallbackObject::getOwnPropertySlot):
2280 (KJS::JSCallbackObject::put):
2281 (KJS::JSCallbackObject::deleteProperty):
2282 (KJS::JSCallbackObject::getPropertyNames):
2283 (KJS::JSCallbackObject::staticValueGetter):
2284 (KJS::JSCallbackObject::staticFunctionGetter):
2285 * API/JSClassRef.cpp:
2286 (OpaqueJSClass::OpaqueJSClass):
2287 (OpaqueJSClass::~OpaqueJSClass):
2289 * API/JSObjectRef.cpp:
2291 (JSObjectMakeFunctionWithCallback):
2292 (JSObjectMakeFunction):
2293 (OpaqueJSPropertyNameArray::OpaqueJSPropertyNameArray):
2294 (JSObjectCopyPropertyNames):
2295 * API/JSObjectRef.h:
2301 * JavaScriptCore.exp:
2303 2006-07-16 Geoffrey Garen <ggaren@apple.com>
2307 Replace __JS with OpaqueJS because the former, while used by CF, is
2308 a prefix that's triply-reserved by the compiler. (_* is reserved in global
2309 names, _[A-Z] is reserved in all names, and __ is reserved in all names
2312 Opaque is an alternative used by other Mac OS X framewokrs.
2317 * API/JSCallbackObject.cpp:
2318 (KJS::JSCallbackObject::getOwnPropertySlot):
2319 (KJS::JSCallbackObject::put):
2320 (KJS::JSCallbackObject::deleteProperty):
2321 (KJS::JSCallbackObject::getPropertyNames):
2322 (KJS::JSCallbackObject::staticValueGetter):
2323 (KJS::JSCallbackObject::staticFunctionGetter):
2324 * API/JSClassRef.cpp:
2325 (OpaqueJSClass::OpaqueJSClass):
2326 (OpaqueJSClass::~OpaqueJSClass):
2328 * API/JSObjectRef.cpp:
2330 (OpaqueJSPropertyNameArray::OpaqueJSPropertyNameArray):
2331 (JSObjectCopyPropertyNames):
2333 2006-07-16 Darin Adler <darin@apple.com>
2335 - try to fix Windows build
2337 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2338 Added some recently added files, removed some recently removed.
2340 2006-07-16 Geoffrey Garen <ggaren@apple.com>
2344 - Change getProperty* to return undefined, rather than NULL, for missing
2345 properties, since that's what the spec says. Also added exception out
2346 parameters to the *Index functions, because they can call through to the
2347 regular functions, which can throw for custom objects.
2349 * API/JSObjectRef.cpp:
2350 (JSObjectGetProperty):
2351 (JSObjectGetPropertyAtIndex):
2352 (JSObjectSetPropertyAtIndex):
2353 * API/JSObjectRef.h:
2357 2006-07-16 Geoffrey Garen <ggaren@apple.com>
2361 - Properly document and handle NULL callbacks for static properties. We
2362 throw an exception in any case other than a ReadOnly property with a NULL
2363 setProperty callback, because a NULL callback almost certainly indicates
2364 a programming error. Also throw an exception if hasProperty returns true
2365 for a property that getProperty can't get.
2367 - If a static setProperty callback returns 'false', to indicate that the
2368 property was not set, we no longer forward the set request up the class
2369 chain, because that's almost certainly not what the programmer expected.
2371 * API/JSCallbackObject.cpp:
2372 (KJS::JSCallbackObject::getOwnPropertySlot):
2373 (KJS::JSCallbackObject::put):
2374 (KJS::JSCallbackObject::staticValueGetter):
2375 (KJS::JSCallbackObject::staticFunctionGetter):
2376 (KJS::JSCallbackObject::callbackGetter):
2377 * API/JSObjectRef.h:
2380 (MyObject_hasProperty):
2383 2006-07-16 Geoffrey Garen <ggaren@apple.com>
2387 - Added names to functions.
2389 - Removed GetPrivate/SetPrivate from callbackFunctions and callbackConstructors.
2390 The private data idiom is that a JS object stores its native implementation
2391 as private data. For functions and constructors, the native implementation is nothing
2392 more than the callback they already store, so supporting private data, too,
2393 confuses the idiom. If you *really* want, you can still create a custom
2394 function with private data.
2396 * API/JSCallbackConstructor.cpp:
2397 * API/JSCallbackConstructor.h:
2398 * API/JSCallbackFunction.cpp:
2399 (KJS::JSCallbackFunction::JSCallbackFunction):
2400 * API/JSCallbackFunction.h:
2401 * API/JSCallbackObject.cpp:
2402 (KJS::JSCallbackObject::staticFunctionGetter):
2403 * API/JSObjectRef.cpp:
2404 (JSObjectMakeFunction):
2405 (JSObjectMakeFunctionWithBody):
2406 (JSObjectGetPrivate):
2407 (JSObjectSetPrivate):
2408 * API/JSObjectRef.h:
2414 2006-07-15 Maciej Stachowiak <mjs@apple.com>
2418 - switch property lists to be vector+set of Identifiers instead of list of References
2420 This has the following benefits:
2422 - no duplicates in property lists
2423 - simplifies API calls
2424 - probably more efficient, since linked list is gone
2425 - entirely removed Reference, ReferenceList and ProtectedReference types from the API
2427 * kjs/PropertyNameArray.cpp: Added.
2428 (KJS::PropertyNameArray::add): Check set, if not already there, add to
2430 * kjs/PropertyNameArray.h: Added.
2431 (KJS::PropertyNameArray::PropertyNameArray): Newly added type, combines
2432 a set and a vector to make a unique but ordered list of identifiers.
2433 (KJS::PropertyNameArray::begin): ditto
2434 (KJS::PropertyNameArray::end): ditto
2435 (KJS::PropertyNameArray::size): ditto
2436 (KJS::PropertyNameArray::operator[]): ditto
2437 * kjs/array_instance.h:
2438 * kjs/array_object.cpp:
2439 (ArrayInstance::getPropertyNames): renamed from getPropertyList, updated
2440 for PropertyNameArray
2441 (ArrayInstance::setLength): updated for PropertyNameArray
2442 (ArrayInstance::pushUndefinedObjectsToEnd): ditto
2444 (ForInNode::execute): updated for PropertyNameArray
2447 (KJS::JSObject::getPropertyNames): renamed from getPropertyList, updated
2448 for PropertyNameArray
2450 * kjs/property_map.cpp:
2451 (KJS::PropertyMap::getEnumerablePropertyNames): updated for PropertyNameArray
2452 (KJS::PropertyMap::getSparseArrayPropertyNames): ditto
2453 * kjs/property_map.h:
2454 * kjs/protected_reference.h: Removed.
2455 * kjs/reference.cpp: Removed.
2456 * kjs/reference.h: Removed.
2457 * kjs/reference_list.cpp: Removed.
2458 * kjs/reference_list.h: Removed.
2459 * kjs/scope_chain.cpp:
2460 (KJS::ScopeChain::print): Use PropertyNamesArray instead of ReferenceList.
2461 * kjs/string_object.cpp:
2462 (StringInstance::getPropertyNames): Updated for new approach.
2463 * kjs/string_object.h:
2466 (toJS): Added overload for PropertyNameAccumulatorRef / PropertyNameArray*
2469 * API/JSCallbackObject.cpp:
2470 (KJS::JSCallbackObject::getPropertyNames): Fixed for new API.
2471 * API/JSCallbackObject.h:
2472 * API/JSObjectRef.cpp:
2473 (__JSPropertyNameArray::__JSPropertyNameArray): Type used for a publicly vended
2474 JSPropertyNameArrayRef.
2475 (JSObjectCopyPropertyNames): New API call - renamed / refactored from
2476 JSObjectCreatePropertyList
2477 (JSPropertyNameArrayRetain): new retain call for JSPropertyNameArray.
2478 (JSPropertyNameArrayRelease): new release call for - " -.
2479 (JSPropertyNameArrayGetCount): Instead of having to use a stateful enumerator you
2480 can now get the count and items in any order.
2481 (JSPropertyNameArrayGetNameAtIndex): See above.
2482 (JSPropertyNameAccumulatorAddName): What you add properties to is now an opaque
2484 * API/JSObjectRef.h: Prototyped new functions, removed old ones
2485 * JavaScriptCore.exp: Updated exported symbols.
2486 * JavaScriptCore.xcodeproj/project.pbxproj: Added new files, removed old.
2488 (MyObject_getPropertyNames): Renamed / fixed callback to fit new paradigm.
2489 (main): Updated for new API.
2491 2006-07-15 Darin Adler <darin@apple.com>
2493 - oops, missed a few more arrays that had to be const
2496 (JSNodePrototype_appendChild): Added const.
2497 (JSNodePrototype_removeChild): Ditto.
2498 (JSNodePrototype_replaceChild): Ditto.
2499 (JSNode_construct): Ditto.
2501 (JSNodeListPrototype_item): Ditto.
2502 * API/JSObjectRef.cpp:
2503 (JSObjectMakeFunctionWithBody): Ditto.
2504 (JSObjectCallAsFunction): Ditto.
2505 (JSObjectCallAsConstructor): Ditto.
2509 (MyObject_callAsFunction): Ditto.
2510 (MyObject_callAsConstructor): Ditto.
2511 (print_callAsFunction): Ditto.
2512 (myConstructor_callAsConstructor): Ditto.
2514 2006-07-15 Darin Adler <darin@apple.com>
2518 * API/JSNode.h: Made an array parameter const.
2519 * API/JSObjectRef.h: Made array parameters const. Fixed a comment.
2521 2006-07-15 Geoffrey Garen <ggaren@apple.com>
2525 - JSObjectMakeFunctionWithBody includes a function name and named parameters now.
2527 * API/JSObjectRef.cpp:
2528 (JSObjectMakeFunctionWithBody):
2529 * API/JSObjectRef.h:
2531 (assertEqualsAsUTF8String): More informative failure reporting.
2532 (main): Test more function cases.
2534 2006-07-15 Geoffrey Garen <ggaren@apple.com>
2538 - Moved the arguments passed to JSClassCreate into a single structure,
2539 called JSClassDefinition. This will enable easier structure
2540 migration/versioning in the future, if necessary.
2542 - Added support for class names.
2544 - kJSClassDefinitionNull replaces kJSObjectCallbacksNone.
2546 - JSClass is becoming a fairly complex struct, so I migrated all of its
2547 implementation other than reference counting to the sruct.
2549 - Also moved JSClass* functions in the API to JSObjectRef.cpp, since they're
2550 declared in JSObjectRef.h
2552 - Also added some more informative explanation to the class structure doc.
2554 2006-07-15 Darin Adler <darin@apple.com>
2558 - fix http://bugs.webkit.org/show_bug.cgi?id=8395
2559 <rdar://problem/4613467>
2560 REGRESSION: RegEx seems broken for hex escaped non breaking space
2562 Test: fast/js/regexp-extended-characters-more.html
2565 (match): Got rid of utf16Length local variable to guarantee there's no
2566 extra stack usage in recursive calls. Fixed two places in the PCRE_UTF16
2567 code that were using the length variable, which is the UTF-8 length of
2568 a character in the pattern, to move in the UTF-16 subject string. Instead
2569 they hardcode lengths of 1 and 2 since the code already handles BMP
2570 characters and surrogate pairs separately. Also fixed some DPRINTF so
2571 I could compile with DEBUG on.
2572 (pcre_exec): Changed a place that was checking for multibyte characters
2573 in the subject string to use ISMIDCHAR. Instead it was using hardcoded
2574 logic that was right for UTF-8 but wrong for UTF-16.
2576 * pcre/pcre_compile.c: (pcre_compile2): Fixed a DPRINTF so I could compile
2579 2006-07-14 Geoffrey Garen <ggaren@apple.com>
2583 Global replace in the API of argc/argv with argumentCount/arguments.
2585 2006-07-14 Geoffrey Garen <ggaren@apple.com>
2589 - Finalized exception handling in the API.
2591 setProperty can throw because it throws for built-in arrays. getProperty
2592 and deleteProperty can throw because setProperty can throw and we want
2593 to be consistent, and also because they seem like "actions." callAsFunction,
2594 callAsConstructor, and hasInstance can throw, because they caan throw for
2597 toBoolean can't throw because it's defined that way in the spec.
2599 - Documented that toBoolean and toObject can't be overridden by custom
2600 objects because they're defined that way in the spec.
2602 === Safari-521.17 ===
2604 2006-07-14 Geoffrey Garen <ggaren@apple.com>
2608 - Implemented ref-counting of JSContexts by splitting into two datatypes:
2609 JSGlobalContext, which you can create/retain/release, and JSContext, which
2612 Internally, you retain a JSGlobalContext/ExecState by retaining its
2613 interpreter, which, in the case of a global ExecState, owns it.
2615 - Also made ~Interpreter() protected to catch places where Interpreter
2616 is manually deleted. (Can't make it private because some crazy fool
2617 decided it would be a good idea to subclass Interpreter in other frameworks.
2621 (toJS): Added cast for new JSGlobalContext
2622 * API/JSStringRef.h: Changed vague "you must" language to more specific
2623 (but, ultimately, equally vague) "behavior is undefined if you don't"
2625 (KJS::Interpreter::Interpreter): Factored more common initialization into
2627 * kjs/interpreter.h:
2628 (KJS::Interpreter::ref): new
2629 (KJS::Interpreter::deref): new
2630 (KJS::Interpreter::refCount): new
2632 (doIt): Ref-count the interpreter.
2634 2006-07-14 Maciej Stachowiak <mjs@apple.com>
2638 - removed bool return value from JSObjectSetProperty, since it is inefficient and
2639 also doesn't work quite right
2640 - added JSObjectGetPropertyAtIndex and JSObjectSetPropertyAtIndex
2642 * API/JSObjectRef.cpp:
2643 (JSObjectSetProperty): Removed return value and canPut stuff.
2644 (JSObjectGetPropertyAtIndex): Added.
2645 (JSObjectSetPropertyAtIndex): Added.
2646 * API/JSObjectRef.h: Prototyped and documented new functions.
2648 2006-07-14 Geoffrey Garen <ggaren@apple.com>
2652 Moved JSCheckScriptSyntax, JSEvaluateScript, and JSGarbageCollect into
2653 JSBase.h/.cpp. They don't belong in the value-specific or context-specific
2654 files because they're not part of the value or context implementations.
2657 * API/JSContextRef.cpp:
2658 (JSContextGetGlobalObject):
2659 * API/JSContextRef.h:
2660 * API/JSValueRef.cpp:
2663 * JavaScriptCore.xcodeproj/project.pbxproj:
2665 2006-07-13 Timothy Hatcher <timothy@apple.com>
2669 Moved JavaScriptCore to be a public framework.
2671 * JavaScriptCore.xcodeproj/project.pbxproj:
2673 2006-07-13 Mark Rowe <opendarwin.org@bdash.net.nz>
2675 Reviewed by Geoffrey.
2677 http://bugs.webkit.org/show_bug.cgi?id=9742
2678 Bug 9742: REGRESSION: WebKit hangs when loading <http://www.vtbook.com>
2681 (KJS::JSValue::getUInt32): Only types tagged as numeric can be converted to UInt32.
2683 2006-07-13 Geoffrey Garen <ggaren@apple.com>
2687 - Renamed JSEvaluate -> JSEvaluateScript, JSCheckSyntax -> JSCheckScriptSyntax
2688 - Added exception out parameters to JSValueTo* and JSValueIsEqual because
2690 - Removed JSObjectGetDescription because it's useless and vague, and
2691 JSValueToString/JSValueIsObjectOfClass do a better job, anyway
2692 - Clarified comments about "IsFunction/Constructor" to indicate that they
2693 are true of all functions/constructors, not just those created by JSObjectMake*
2695 2006-07-12 Geoffrey Garen <ggaren@apple.com>
2699 Finished previously approved JSInternalString -> JSString conversion
2700 by renaming the files.
2702 * API/JSCallbackObject.cpp:
2703 * API/JSInternalStringRef.cpp: Removed.
2704 * API/JSInternalStringRef.h: Removed.
2705 * API/JSStringRef.cpp: Added.
2706 * API/JSStringRef.h: Added.
2707 * API/JavaScriptCore.h:
2708 * JavaScriptCore.xcodeproj/project.pbxproj:
2710 2006-07-12 Geoffrey Garen <ggaren@apple.com>
2714 - Removed context and exception parameters from JSObjectGetPropertyEnumerator,
2715 removing the spurious use of ExecState inside JavaScriptCore that made
2716 us think this was necessary in the first place.
2718 (StringInstance::getPropertyList): Use getString instead of toString because
2719 we know we're dealing with a string -- we put it there in the first place.
2720 While we're at it, store the string's size instead of retrieving it each time
2721 through the loop, to avoid the unnecessary killing of puppies.
2722 * kjs/string_object.h:
2724 2006-07-12 Maciej Stachowiak <mjs@apple.com>
2728 - add handling of hasInstance callback for API objects
2730 * API/JSCallbackObject.cpp:
2731 (KJS::JSCallbackObject::implementsHasInstance): Check if callback is present.
2732 (KJS::JSCallbackObject::hasInstance): Invoke appropriate callback.
2733 * API/JSCallbackObject.h:
2734 * API/JSClassRef.cpp:
2735 * API/JSObjectRef.h:
2737 (MyObject_hasInstance): Test case; should match what construct would do.
2740 2006-07-11 Geoffrey Garen <ggaren@apple.com>
2744 - Implemented a vast number of renames and comment clarifications
2745 suggested during API review.
2747 JSInternalString -> JSString
2748 JS*Make -> JSValueMake*, JSObjectMake*
2749 JSTypeCode -> JSType
2750 JSValueIsInstanceOf -> JSValueIsInstanceOfConstructor (reads strangely well in client code)
2751 JSGC*Protect -> JSValue*Protect
2752 JS*Callback -> JSObject*Callback
2753 JSGetPropertyListCallback -> JSObjectAddPropertiesToListCallback
2754 JSPropertyEnumeratorGetNext -> JSPropertyEnumeratorGetNextName
2756 JSStringCreateWithUTF8CString, JSStringGetUTF8CString,
2757 JSStringGetMaximumUTF8CStringSize JSStringIsEqualToUTF8CString,
2758 JSStringCreateWithCFString, JSStringCopyCFString, JSStringCreateWithCharacters.
2760 - Changed functions taking a JSValue out arg and returning a bool indicating
2761 whether it was set to simply return a JSValue or NULL.
2763 - Removed JSStringGetCharacters because it's more documentation than code,
2764 and it's just a glorified memcpy built on existing API functionality.
2766 - Moved standard library includes into the headers that actually require them.
2768 - Standardized use of the phrase "Create Rule."
2770 - Removed JSLock from make functions that don't allocate.
2772 - Added exception handling to JSValueToBoolean, since we now allow
2773 callback objects to throw exceptions upon converting to boolean.
2775 - Renamed JSGCCollect to JSGarbageCollect.
2777 2006-07-10 Geoffrey Garen <ggaren@apple.com>
2781 - Changed public header includes to the <JavaScriptCore/ style.
2782 - Changed instances of 'buffer' to 'string' since we decided on
2783 JSInternalString instead of JSStringBuffer.
2785 * API/JSContextRef.h:
2786 * API/JSInternalStringRef.cpp:
2788 (JSInternalStringRetain):
2789 (JSInternalStringRelease):
2790 (JSValueCopyStringValue):
2791 (JSInternalStringGetLength):
2792 (JSInternalStringGetCharactersPtr):
2793 (JSInternalStringGetCharacters):
2794 (JSInternalStringGetMaxLengthUTF8):
2795 (JSInternalStringGetCharactersUTF8):
2796 (CFStringCreateWithJSInternalString):
2797 * API/JSInternalStringRef.h:
2799 (JSNodePrototype_appendChild):
2800 (JSNode_getNodeType):
2801 * API/JSObjectRef.cpp:
2802 (JSObjectCallAsConstructor):
2804 * API/JavaScriptCore.h:
2809 (MyObject_getPropertyList):
2810 (myConstructor_callAsConstructor):
2811 (main): I noticed that we were prematurely releasing some string buffers,
2812 so I moved their release calls to the end of main(). I got rid of 'Buf' in *Buf
2813 (sometimes changing to 'IString', when necessary to differentiate a variable)
2814 to match the buffer->string change.
2816 === Safari-521.16 ===
2818 2006-07-10 Darin Adler <darin@apple.com>
2820 * kjs/value.cpp: (KJS::JSValue::toInt32Inline): Added inline keyword one more place.
2823 2006-07-10 Darin Adler <darin@apple.com>
2825 - fix the release build
2829 (KJS::JSValue::toInt32Inline): Move the code here to an inline.
2830 (KJS::JSValue::toInt32): Call the inline from both overloaded toInt32 functions.
2832 2006-07-10 David Kilzer <ddkilzer@kilzer.net>
2836 - fix http://bugs.webkit.org/show_bug.cgi?id=9179
2837 Implement select.options.add() method
2839 * JavaScriptCore.exp: Added overloaded KJS::JSValue::toInt32() method.
2840 * JavaScriptCore.xcodeproj/project.pbxproj: Altered attributes metadata for
2841 kjs/value.h to make it available as a forwarded header.
2843 (KJS::lookupPut): Extracted a lookupPut() method from the existing lookupPut() method.
2844 The new method returns a boolean value if no entry is found in the lookup table.
2846 (KJS::JSValue::toInt32): Overloaded toInt32() method with boolean "Ok" argument.
2847 * kjs/value.h: Ditto.
2849 2006-07-10 Geoffrey Garen <ggaren@apple.com>
2851 No review necessary. Removed bogus file I accidentally checked in before.
2853 * API/JSInternalSringRef.h: Removed.
2855 2006-07-10 Geoffrey Garen <ggaren@apple.com>
2859 Added exception out parameter to API object callbacks, removed semi-bogus
2860 JSContext(.*)Exception functions.
2862 To make these calls syntactically simple, I added an exceptionSlot()
2863 method to the ExecState class, which provides a JSValue** slot in which to
2864 store a JSValue* exception.
2868 * API/JSCallbackConstructor.cpp:
2869 (KJS::JSCallbackConstructor::construct):
2870 * API/JSCallbackFunction.cpp:
2871 (KJS::JSCallbackFunction::callAsFunction):
2872 * API/JSCallbackObject.cpp:
2873 (KJS::JSCallbackObject::init):
2874 (KJS::JSCallbackObject::getOwnPropertySlot):
2875 (KJS::JSCallbackObject::put):
2876 (KJS::JSCallbackObject::deleteProperty):
2877 (KJS::JSCallbackObject::construct):
2878 (KJS::JSCallbackObject::callAsFunction):
2879 (KJS::JSCallbackObject::getPropertyList):
2880 (KJS::JSCallbackObject::toBoolean):
2881 (KJS::JSCallbackObject::toNumber):
2882 (KJS::JSCallbackObject::toString):
2883 (KJS::JSCallbackObject::staticValueGetter):
2884 (KJS::JSCallbackObject::callbackGetter):
2885 * API/JSContextRef.cpp:
2887 * API/JSContextRef.h:
2889 (JSNodePrototype_appendChild):
2890 (JSNodePrototype_removeChild):
2891 (JSNodePrototype_replaceChild):
2892 (JSNode_getNodeType):
2893 (JSNode_getChildNodes):
2894 (JSNode_getFirstChild):
2898 (JSNodeListPrototype_item):
2899 (JSNodeList_length):
2900 (JSNodeList_getProperty):
2901 * API/JSObjectRef.h:
2905 (MyObject_initialize):
2906 (MyObject_hasProperty):
2907 (MyObject_getProperty):
2908 (MyObject_setProperty):
2909 (MyObject_deleteProperty):
2910 (MyObject_getPropertyList):
2911 (MyObject_callAsFunction):
2912 (MyObject_callAsConstructor):
2913 (MyObject_convertToType):
2914 (print_callAsFunction):
2915 (myConstructor_callAsConstructor):
2917 * JavaScriptCore.exp:
2919 (KJS::ExecState::exceptionHandle):
2921 2006-07-10 Geoffrey Garen <ggaren@apple.com>
2925 Improved type safety by implementing opaque JSValue/JSObject typing through
2926 abuse of 'const', not void*. Also fixed an alarming number of bugs
2927 exposed by this new type safety.
2929 I made one design change in JavaScriptCore, which is that the JSObject
2930 constructor should take a JSValue* as its prototype argument, not a JSObject*,
2931 since we allow the prototype to be any JSValue*, including jsNull(), for
2937 * API/JSCallbackConstructor.cpp:
2938 (KJS::JSCallbackConstructor::construct):
2939 * API/JSCallbackFunction.cpp:
2940 (KJS::JSCallbackFunction::callAsFunction):
2941 * API/JSCallbackObject.cpp:
2942 (KJS::JSCallbackObject::JSCallbackObject):
2943 (KJS::JSCallbackObject::getOwnPropertySlot):
2944 (KJS::JSCallbackObject::put):
2945 (KJS::JSCallbackObject::construct):
2946 (KJS::JSCallbackObject::callAsFunction):
2947 (KJS::JSCallbackObject::staticFunctionGetter):
2948 * API/JSCallbackObject.h:
2949 * API/JSContextRef.cpp:
2952 (JSNodePrototype_appendChild):
2953 (JSNodePrototype_removeChild):
2954 (JSNodePrototype_replaceChild):
2955 * API/JSObjectRef.cpp:
2957 (JSFunctionMakeWithBody):
2958 (JSObjectGetProperty):
2959 (JSObjectCallAsFunction):
2960 (JSObjectCallAsConstructor):
2961 * API/JSObjectRef.h:
2966 (KJS::JSObject::JSObject):
2968 2006-07-10 Geoffrey Garen <ggaren@apple.com>
2970 Approved by Maciej, Darin.
2972 Renamed JSStringBufferRef to JSInternalStringRef. "Internal string" means the
2973 JavaScript engine's internal string representation, which is the most
2974 low-level and efficient representation to use when interfacing with JavaScript.
2980 * API/JSCallbackObject.cpp:
2981 (KJS::JSCallbackObject::getOwnPropertySlot):
2982 (KJS::JSCallbackObject::put):
2983 (KJS::JSCallbackObject::deleteProperty):
2984 (KJS::JSCallbackObject::staticValueGetter):
2985 (KJS::JSCallbackObject::callbackGetter):
2986 * API/JSContextRef.cpp:
2989 * API/JSContextRef.h:
2990 * API/JSInternalStringRef.cpp: Added.
2992 (JSInternalStringCreate):
2993 (JSInternalStringCreateUTF8):
2994 (JSInternalStringRetain):
2995 (JSInternalStringRelease):
2996 (JSValueCopyStringValue):
2997 (JSInternalStringGetLength):
2998 (JSInternalStringGetCharactersPtr):
2999 (JSInternalStringGetCharacters):
3000 (JSInternalStringGetMaxLengthUTF8):
3001 (JSInternalStringGetCharactersUTF8):
3002 (JSInternalStringIsEqual):
3003 (JSInternalStringIsEqualUTF8):
3004 (JSInternalStringCreateCF):
3005 (CFStringCreateWithJSInternalString):
3006 * API/JSInternalStringRef.h: Added.
3008 (JSNodePrototype_appendChild):
3009 (JSNode_getNodeType):
3010 (JSNode_getChildNodes):
3011 (JSNode_getFirstChild):
3013 (JSNodeList_length):
3014 (JSNodeList_getProperty):
3015 * API/JSObjectRef.cpp:
3016 (JSFunctionMakeWithBody):
3017 (JSObjectGetDescription):
3018 (JSObjectHasProperty):
3019 (JSObjectGetProperty):
3020 (JSObjectSetProperty):
3021 (JSObjectDeleteProperty):
3022 (JSPropertyEnumeratorGetNext):
3023 (JSPropertyListAdd):
3024 * API/JSObjectRef.h:
3025 * API/JSStringBufferRef.cpp: Removed.
3026 * API/JSStringBufferRef.h: Removed.
3028 * API/JavaScriptCore.h:
3033 (assertEqualsAsUTF8String):
3034 (assertEqualsAsCharactersPtr):
3035 (assertEqualsAsCharacters):
3036 (MyObject_hasProperty):
3037 (MyObject_getProperty):
3038 (MyObject_setProperty):
3039 (MyObject_deleteProperty):
3040 (MyObject_getPropertyList):
3041 (print_callAsFunction):
3042 (myConstructor_callAsConstructor):
3044 * JavaScriptCore.exp:
3045 * JavaScriptCore.xcodeproj/project.pbxproj:
3047 2006-07-08 Tim Omernick <timo@apple.com>
3051 Added an OpenGL drawing model to the Netscape Plug-in API.
3055 2006-07-08 Timothy Hatcher <timothy@apple.com>
3059 Moved KJS_GetCreatedJavaVMs to jni_utility.cpp.
3060 Switched KJS_GetCreatedJavaVMs over to use dlopen and dlsym
3061 now that NSAddImage, NSLookupSymbolInImage and NSAddressOfSymbol
3062 are deprecated in Leopard.
3064 * JavaScriptCore.exp:
3065 * JavaScriptCore.xcodeproj/project.pbxproj:
3066 * bindings/jni/jni_utility.cpp:
3067 (KJS::Bindings::KJS_GetCreatedJavaVMs):
3068 * bindings/softlinking.c: Removed.
3069 * bindings/softlinking.h: Removed.
3071 2006-07-08 Geoffrey Garen <ggaren@apple.com>
3075 - Make JSObjectGetProperty return a JSValue or NULL, like JSEvaluate does.
3077 * API/JSObjectRef.cpp:
3078 (JSObjectGetProperty):
3079 * API/JSObjectRef.h:
3083 2006-07-08 Geoffrey Garen <ggaren@apple.com>
3085 Style change -- no review necessary.
3087 Use 0 instead of NULL in API .cpp files, to match our style guidelines.
3089 * API/JSContextRef.cpp:
3091 * API/JSObjectRef.cpp:
3092 (JSFunctionMakeWithBody):
3093 (JSObjectCallAsFunction):
3094 (JSObjectCallAsConstructor):
3095 * API/JSValueRef.cpp:
3098 2006-07-08 Geoffrey Garen <ggaren@apple.com>
3102 - Added ability to pass NULL for thisObject when calling JSObjectCallAsFunction,
3103 to match JSEvaluate.
3105 * API/JSObjectRef.cpp:
3106 (JSObjectCallAsFunction):
3107 * API/JSObjectRef.h:
3111 === Safari-521.15 ===
3113 2006-07-07 Geoffrey Garen <ggaren@apple.com>
3117 - Standardized which functions take a JSContext as an argument. The rule is:
3118 if you might execute JavaScript, you take a JSContext, otherwise you don't.
3120 The FIXME in JSObjectRef.h requires refactoring some parts of Interpreter,
3121 but not API changes, so I'm putting it off until later.
3123 * API/JSCallbackObject.cpp:
3124 (KJS::JSCallbackObject::JSCallbackObject):
3125 (KJS::JSCallbackObject::init):
3126 * API/JSCallbackObject.h:
3127 * API/JSContextRef.cpp:
3129 * API/JSContextRef.h:
3130 * API/JSObjectRef.cpp:
3132 (JSPropertyEnumeratorGetNext):
3133 * API/JSObjectRef.h:
3135 (MyObject_initialize):
3137 * JavaScriptCore.exp:
3138 * kjs/array_object.cpp:
3139 (ArrayInstance::setLength):
3140 (ArrayInstance::pushUndefinedObjectsToEnd):
3142 (ForInNode::execute):
3143 * kjs/reference.cpp:
3144 (KJS::Reference::getPropertyName):
3145 (KJS::Reference::getValue):
3147 * kjs/scope_chain.cpp:
3148 (KJS::ScopeChain::print):
3150 2006-07-06 Geoffrey Garen <ggaren@apple.com>
3156 - Headerdoc finished
3159 - Added a JSContextRef argument to many functions, because you need a
3160 JSContextRef for doing virtually anything. I expect to add this argument
3161 to even more functions in a future patch.
3163 - Removed the globalObjectPrototype argument to JSContextCreate because
3164 you can't create an object until you have a context, so it's impossible
3165 to pass a prototype object to JSContextCreate. That's OK because (1) there's
3166 no reason to give the global object a prototype and (2) if you really want
3167 to, you can just use a separate call to JSObjectSetPrototype.
3169 - Removed the JSClassRef argument to JSClassCreate because it was unnecessary,
3170 and you need to be able to make the global object's class before you've
3171 created a JSContext.
3173 - Added an optional exception parameter to JSFunctionMakeWithBody because anything
3174 less would be uncivilized.
3176 - Made the return value parameter to JSObjectGetProperty optional to match
3177 all other return value parameters in the API.
3179 - Made JSObjectSetPrivate/JSObjectGetPrivate work on JSCallbackFunctions
3180 and JSCallbackConstructors. You could use an abstract base class or strategic
3181 placement of m_privateData in the class structure to implement this, but
3182 the former seemed like overkill, and the latter seemed too dangerous.
3184 - Fixed a bug where JSPropertyEnumeratorGetNext would skip the first property.
3187 - Reversed the logic of the JSChar #ifdef to avoid confusing headerdoc
3189 - Removed function names from @function declarations because headeroc
3190 can parse them automatically, and I wanted to rule out manual mismatch.
3192 - Changed Error::create to take a const UString& instead of a UString*
3193 because it was looking at me funny.
3195 - Renamed JSStringBufferCreateWithCFString to JSStringBufferCreateCF
3196 because the latter is more concise and it matches JSStringBufferCreateUTF8.
3198 * API/JSCallbackObject.cpp:
3199 (KJS::JSCallbackObject::getOwnPropertySlot):
3200 (KJS::JSCallbackObject::put):
3201 (KJS::JSCallbackObject::deleteProperty):
3202 (KJS::JSCallbackObject::getPropertyList):
3203 (KJS::JSCallbackObject::toBoolean):
3204 (KJS::JSCallbackObject::toNumber):
3205 (KJS::JSCallbackObject::toString):
3206 * API/JSClassRef.cpp:
3208 * API/JSContextRef.cpp:
3210 (JSContextSetException):
3211 * API/JSContextRef.h:
3213 (JSNodePrototype_class):
3216 (JSNodeListPrototype_class):
3218 * API/JSObjectRef.cpp:
3219 (JSObjectGetProperty):
3220 (JSObjectGetPrivate):
3221 (JSObjectSetPrivate):
3222 (JSObjectCallAsFunction):
3223 (JSObjectCallAsConstructor):
3224 (JSPropertyEnumeratorGetNext):
3225 * API/JSObjectRef.h:
3226 * API/JSStringBufferRef.cpp:
3227 (JSStringBufferCreateCF):
3228 * API/JSStringBufferRef.h:
3229 * API/JSValueRef.cpp:
3230 (JSValueIsInstanceOf):
3236 (MyObject_hasProperty):
3237 (MyObject_setProperty):
3238 (MyObject_deleteProperty):
3239 (MyObject_getPropertyList):
3240 (MyObject_convertToType):
3243 * JavaScriptCore.exp:
3245 2006-07-07 Geoffrey Garen <ggaren@apple.com>
3249 - Fixed a few crashes resulting from NULL parameters to JSClassCreate.
3251 * API/JSClassRef.cpp:
3254 * API/testapi.c: Added test for NULL parameters.
3257 2006-07-07 Geoffrey Garen <ggaren@apple.com>
3259 Reviewed by John, mocked by Darin.
3261 - Changed JSEvaluate to take a JSObjectRef instead of a JSValueRef as
3262 "this," since "this" must be an object.
3264 * API/JSContextRef.cpp:
3266 * API/JSContextRef.h:
3268 2006-07-07 Geoffrey Garen <ggaren@apple.com>
3275 * JavaScriptCore.xcodeproj/project.pbxproj:
3277 2006-07-05 Geoffrey Garen <ggaren@apple.com>
3281 Renamed JSCharBufferRef, which was universally unpopular, to JSStringBufferRef,
3282 which, hopefully, will be less unpopular.
3288 * API/JSCallbackObject.cpp:
3289 (KJS::JSCallbackObject::getOwnPropertySlot):
3290 (KJS::JSCallbackObject::put):
3291 (KJS::JSCallbackObject::deleteProperty):
3292 (KJS::JSCallbackObject::staticValueGetter):
3293 (KJS::JSCallbackObject::callbackGetter):
3294 * API/JSCharBufferRef.cpp: Removed.
3295 * API/JSCharBufferRef.h: Removed.
3296 * API/JSContextRef.cpp:
3299 * API/JSContextRef.h:
3301 (JSNodePrototype_appendChild):
3302 (JSNode_getNodeType):
3303 (JSNode_getChildNodes):
3304 (JSNode_getFirstChild):
3306 (JSNodeList_length):
3307 (JSNodeList_getProperty):
3308 * API/JSObjectRef.cpp:
3309 (JSFunctionMakeWithBody):
3310 (JSObjectGetDescription):
3311 (JSObjectHasProperty):
3312 (JSObjectGetProperty):
3313 (JSObjectSetProperty):
3314 (JSObjectDeleteProperty):
3315 (JSPropertyEnumeratorGetNext):
3316 (JSPropertyListAdd):
3317 * API/JSObjectRef.h:
3318 * API/JSStringBufferRef.cpp: Added.
3320 (JSStringBufferCreate):
3321 (JSStringBufferCreateUTF8):
3322 (JSStringBufferRetain):
3323 (JSStringBufferRelease):
3324 (JSValueCopyStringValue):
3325 (JSStringBufferGetLength):
3326 (JSStringBufferGetCharactersPtr):
3327 (JSStringBufferGetCharacters):
3328 (JSStringBufferGetMaxLengthUTF8):
3329 (JSStringBufferGetCharactersUTF8):
3330 (JSStringBufferIsEqual):
3331 (JSStringBufferIsEqualUTF8):
3332 (JSStringBufferCreateWithCFString):
3333 (CFStringCreateWithJSStringBuffer):
3334 * API/JSStringBufferRef.h: Added.
3336 * API/JavaScriptCore.h:
3341 (assertEqualsAsUTF8String):
3342 (assertEqualsAsCharactersPtr):
3343 (assertEqualsAsCharacters):
3344 (MyObject_hasProperty):
3345 (MyObject_getProperty):
3346 (MyObject_setProperty):
3347 (MyObject_deleteProperty):
3348 (MyObject_getPropertyList):
3349 (print_callAsFunction):
3350 (myConstructor_callAsConstructor):
3352 * JavaScriptCore.exp:
3353 * JavaScriptCore.xcodeproj/project.pbxproj:
3355 2006-07-05 Geoffrey Garen <ggaren@apple.com>
3359 Moved some code around for more logical file separation.
3362 * API/JSContextRef.h:
3363 * API/JSObjectRef.cpp:
3364 * API/JSValueRef.cpp:
3368 2006-07-03 Geoffrey Garen <ggaren@apple.com>
3372 Implemented JSFunctionMakeWithBody, which parses a script as a function body
3373 in the global scope, and returns the resulting anonymous function.
3375 I also removed private data from JSCallbackFunction. It never worked,
3376 since JSCallbackFunction doesn't inherit from JSCallbackObject.
3378 * API/JSCallbackConstructor.cpp: Removed.
3379 * API/JSCallbackConstructor.h: Removed.
3380 * API/JSCallbackFunction.cpp:
3381 (KJS::JSCallbackFunction::JSCallbackFunction):
3382 (KJS::JSCallbackFunction::implementsConstruct):
3383 (KJS::JSCallbackFunction::construct):
3384 (KJS::JSCallbackFunction::implementsCall):
3385 (KJS::JSCallbackFunction::callAsFunction):
3386 * API/JSCallbackFunction.h:
3387 * API/JSCallbackObject.cpp:
3388 (KJS::JSCallbackObject::staticFunctionGetter):
3389 * API/JSObjectRef.cpp:
3391 (JSFunctionMakeWithCallbacks):
3392 * API/JSObjectRef.h:
3398 * JavaScriptCore.exp: Programmatically added all symbols exported by
3399 API object files, and sorted results
3400 * JavaScriptCore.xcodeproj/project.pbxproj:
3402 2006-07-03 Geoffrey Garen <ggaren@apple.com>
3406 - Return syntax error in JSCheckSyntax through a JSValueRef* exception
3410 * API/JSContextRef.cpp:
3414 * JavaScriptCore.exp:
3415 * kjs/interpreter.cpp:
3416 (KJS::Interpreter::checkSyntax):
3417 * kjs/interpreter.h:
3419 2006-07-04 Darin Adler <darin@apple.com>
3423 * wtf/MathExtras.h: Oops. Added missing #endif.
3425 2006-07-04 Bjoern Graf <bjoern.graf@gmail.com>
3428 Tweaked a bit by Darin.
3430 - http://bugs.webkit.org/show_bug.cgi?id=9678
3431 work around MSVCRT's fmod function returning NaN for fmod(x, infinity) instead of x
3433 * wtf/MathExtras.h: Added include of <float.h>.
3434 (isinf): Fix to return false for NAN.
3435 (wtf_fmod): Added. An inline that works around the bug.
3438 * kjs/number_object.cpp:
3439 * kjs/operations.cpp:
3441 Added includes of MathExtras.h to all files using fmod.
3443 * JavaScriptCore.xcodeproj/project.pbxproj: Let Xcode 2.3 have its way with
3446 2006-07-01 Geoffrey Garen <ggaren@apple.com>
3450 - Refined value conversions in the API:
3451 - failed toNumber returns NaN
3452 - failed toObject returns NULL
3453 - failed toString returns empty string
3455 - Refined excpetion handling in the API:
3456 - failed value conversions do not throw exceptions
3457 - uncaught exceptions in JSEvaluate, JSObjectCallAsFunction, and
3458 JSObjectCallAsConstructor are returned through a JSValueRef* exception
3460 - removed JSContextHasException, because JSContextGetException does
3464 * API/JSCharBufferRef.cpp:
3465 (JSValueCopyStringValue):
3466 * API/JSContextRef.cpp:
3468 * API/JSContextRef.h:
3469 * API/JSNodeList.c: Added test code demonstrating how you would use
3470 toNumber, and why you probably don't need toUInt32, etc.
3471 (JSNodeListPrototype_item):
3472 (JSNodeList_getProperty):
3473 * API/JSObjectRef.cpp:
3475 (JSObjectCallAsFunction):
3476 (JSObjectCallAsConstructor):
3477 * API/JSObjectRef.h:
3478 * API/JSValueRef.cpp:
3484 (main): Added tests for new rules, and call to JSGCProtect to fix Intel
3486 * JavaScriptCore.exp:
3488 2006-07-03 Darin Adler <darin@apple.com>
3490 - Rolled out HashMap implementation of NPRuntime, at least temporarily.
3492 Fixes hang in the bindings section of layout tests seen on the
3495 This code was using HashMap<const char*, PrivateIdentifier*>.
3496 But that hashes based on pointer identity, not string value.
3497 The default hash for any pointer type is to hash based on the pointer.
3498 And WTF doesn't currently have a string hash for char*.
3499 We'll need to fix that before re-landing this patch.
3501 (Formatting was also incorrect -- extra spaces in parentheses.)
3503 * bindings/npruntime.cpp: Rolled out last change.
3505 2006-07-02 Justin Haygood <jhaygood@spsu.edu>
3507 Reviewed, tweaked, landed by ggaren.
3509 - Port NPRuntime from CFDictionary to HashMap.
3511 * bindings/npruntime.cpp:
3512 (getStringIdentifierDictionary):
3513 (getIntIdentifierDictionary):
3514 (_NPN_GetStringIdentifier):
3515 (_NPN_GetIntIdentifier):
3516 * bindings/npruntime.h:
3518 2006-07-01 Geoffrey Garen <ggaren@apple.com>
3522 - Fixed <rdar://problem/4611197> REGRESSION: Liveconnect with Java test
3523 fails at http://www-sor.inria.fr/~dedieu/notes/liveconnect/simple_example.html
3525 * JavaScriptCore.exp: Export symbols used by liveconnect
3527 2006-06-29 Geoffrey Garen <ggaren@apple.com>
3531 - Phase 2 in the JS API.
3533 - Added support for specifying static tables of values -- this should
3534 obviate the need for using complicated callbacks for most lookups.
3536 - API objects are now created with classes (JSClassRef) -- in order to support
3537 static values, and in order to prevent API objects from storing their
3538 data inline, and thus falling into the oversized (read: slow and prone to
3539 giving Maciej the frowny face) heap.
3541 - Added two specialized JSObject subclasses -- JSCallbackFunction and JSCallbackConstructor --
3542 to allow JSFunctionMake and JSConstructorMake to continue to work with
3543 the new class model. Another solution to this problem would be to create
3544 a custom class object for each function and constructor you make. This
3545 solution is more code but also more efficient.
3547 - Substantially beefed up the minidom example to demonstrate and test a
3548 lot of these techniques. Its output is still pretty haphazard, though.
3550 - Gave the <kjs/ preface to some includes -- I'm told this matters to
3551 building on some versions of Linux.
3553 - Implemented JSValueIsInstanceOf and JSValueIsObjectOfClass
3555 - Removed GetDescription callback. Something in the class datastructure
3556 should take care of this.
3559 * API/JSCallbackConstructor.cpp: Added.
3561 (KJS::JSCallbackConstructor::JSCallbackConstructor):
3562 (KJS::JSCallbackConstructor::implementsConstruct):
3563 (KJS::JSCallbackConstructor::construct):
3564 (KJS::JSCallbackConstructor::setPrivate):
3565 (KJS::JSCallbackConstructor::getPrivate):
3566 * API/JSCallbackConstructor.h: Added.
3567 (KJS::JSCallbackConstructor::classInfo):
3568 * API/JSCallbackFunction.cpp: Added.
3570 (KJS::JSCallbackFunction::JSCallbackFunction):
3571 (KJS::JSCallbackFunction::implementsCall):
3572 (KJS::JSCallbackFunction::callAsFunction):
3573 (KJS::JSCallbackFunction::setPrivate):
3574 (KJS::JSCallbackFunction::getPrivate):
3575 * API/JSCallbackFunction.h: Added.
3576 (KJS::JSCallbackFunction::classInfo):
3577 * API/JSCallbackObject.cpp:
3579 (KJS::JSCallbackObject::JSCallbackObject):
3580 (KJS::JSCallbackObject::init):
3581 (KJS::JSCallbackObject::~JSCallbackObject):
3582 (KJS::JSCallbackObject::className):
3583 (KJS::JSCallbackObject::getOwnPropertySlot):
3584 (KJS::JSCallbackObject::put):
3585 (KJS::JSCallbackObject::deleteProperty):
3586 (KJS::JSCallbackObject::implementsConstruct):
3587 (KJS::JSCallbackObject::construct):
3588 (KJS::JSCallbackObject::implementsCall):
3589 (KJS::JSCallbackObject::callAsFunction):
3590 (KJS::JSCallbackObject::getPropertyList):
3591 (KJS::JSCallbackObject::toBoolean):