1 2006-12-09 Lars Knoll <lars@trolltech.com>
5 Make it possible to build WebKit with qmake.
7 * JavaScriptCore.pro: Added.
8 * kjs/kjs.pro: Removed.
9 * pcre/pcre.pri: Added.
11 2006-12-09 Zack Rusin <zack@kde.org>
13 Fixing the compilation with platform kde after the icu changes.
17 2006-12-09 Adam Roben <aroben@apple.com>
21 Some updates in reaction to r18098.
23 * wtf/unicode/icu/UnicodeIcu.h: Use !! to convert UBool to bool in all
25 (WTF::Unicode::toLower):
26 (WTF::Unicode::toUpper):
27 (WTF::Unicode::isDigit):
28 (WTF::Unicode::isSpace):
29 (WTF::Unicode::isPunct):
30 (WTF::Unicode::isLower):
31 (WTF::Unicode::isUpper):
32 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
33 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
35 2006-12-09 George Staikos <staikos@kde.org>
37 Patch by Lars Knoll, comment out ICU dependency on Qt platform (unused code).
41 * bindings/c/c_utility.cpp:
42 (KJS::Bindings::convertUTF8ToUTF16):
44 2006-12-08 David Hyatt <hyatt@apple.com>
46 Land the new ICU abstraction layer. Patch by Lars.
50 * JavaScriptCore.xcodeproj/project.pbxproj:
52 * wtf/unicode/UnicodeCategory.h: Removed.
53 * wtf/unicode/UnicodeDecomposition.h: Removed.
54 * wtf/unicode/UnicodeDirection.h: Removed.
55 * wtf/unicode/icu/UnicodeIcu.h:
57 (WTF::Unicode::foldCase):
58 (WTF::Unicode::toLower):
59 (WTF::Unicode::toUpper):
60 (WTF::Unicode::toTitleCase):
61 (WTF::Unicode::isDigit):
62 (WTF::Unicode::isSpace):
63 (WTF::Unicode::isPunct):
64 (WTF::Unicode::mirroredChar):
65 (WTF::Unicode::category):
66 (WTF::Unicode::direction):
67 (WTF::Unicode::isLower):
68 (WTF::Unicode::isUpper):
69 (WTF::Unicode::digitValue):
70 (WTF::Unicode::combiningClass):
71 (WTF::Unicode::decompositionType):
72 (WTF::Unicode::strcasecmp):
73 (WTF::Unicode::memset):
74 * wtf/unicode/qt4/UnicodeQt4.cpp: Removed.
75 * wtf/unicode/qt4/UnicodeQt4.h:
77 (WTF::Unicode::toLower):
78 (WTF::Unicode::toUpper):
79 (WTF::Unicode::toTitleCase):
80 (WTF::Unicode::foldCase):
81 (WTF::Unicode::isPrintableChar):
82 (WTF::Unicode::isLower):
83 (WTF::Unicode::isUpper):
84 (WTF::Unicode::digitValue):
85 (WTF::Unicode::combiningClass):
86 (WTF::Unicode::decompositionType):
87 (WTF::Unicode::strcasecmp):
88 (WTF::Unicode::memset):
89 (WTF::Unicode::direction):
90 (WTF::Unicode::category):
94 2006-12-08 Adam Roben <aroben@apple.com>
98 This is a mo' better fix for ensuring we don't use macro definitions
104 2006-12-07 Kevin Fyure <digdog@macports.org>
108 http://bugs.webkit.org/show_bug.cgi?id=11545
109 Disable the testcases do not follow the ECMA-262v3 specification.
111 * tests/mozilla/expected.html: Update Results.
112 * tests/mozilla/js1_2/String/concat.js:
113 4 tests disabled. The result of concat Array object is not followinig
115 * tests/mozilla/js1_2/function/Number.js:
116 1 test disabled. The result of Array object to Number object conversion
117 is not following ECMA 9.3. And the test was duplicated in
118 ecma/TypeConversion/9.3-1.js
119 * tests/mozilla/js1_2/function/String.js:
120 2 tests disabled. The result of Object/Array object to String object
121 conversion is not following ECMA 15.5.1.1 and ECMA 9.8
123 2006-11-30 Steve Falkenburg <sfalken@apple.com>
127 Move WTF from JavaScriptCore project into a new WTF project.
129 * JavaScriptCore.vcproj/JavaScriptCore.sln: Add WTF.vcproj to sln
130 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Remove WTF source files
131 * JavaScriptCore.vcproj/WTF/WTF.vcproj: Added.
132 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj: Add dependency on WTF.lib
134 2006-11-30 Geoffrey Garen <ggaren@apple.com>
136 Reviewed by Beth Dakin.
138 Fixed up garbage collection at window close time.
140 * kjs/interpreter.cpp:
141 (KJS::Interpreter::~Interpreter): Garbage collect here, since
142 destroying the interpreter frees the global object and
143 therefore creates a lot of garbage.
145 2006-11-20 W. Andy Carrel <wac@google.com>
149 http://bugs.webkit.org/show_bug.cgi?id=11501
150 REGRESSION: \u no longer escapes metacharacters in RegExps
151 http://bugs.webkit.org/show_bug.cgi?id=11502
152 Serializing RegExps doesn't preserve Unicode escapes
159 Push \u parsing back down into the RegExp object rather than in the
160 parser. This backs out r17354 in favor of a new fix that better
161 matches the behavior of other browsers.
165 (KJS::RegExp::RegExp):
166 (KJS::sanitizePattern):
169 (KJS::convertUnicode):
171 Translate \u escaped unicode characters for the benefit of pcre.
174 (KJS::UString::append):
175 Fix failure to increment length on the first UChar appended to a
176 UString that was copy-on-write.
178 * tests/mozilla/ecma_2/RegExp/properties-001.js:
179 Adjust tests back to the uniform standards.
181 2006-11-20 Samuel Weinig <sam@webkit.org>
185 Fix for http://bugs.webkit.org/show_bug.cgi?id=11647
188 * kjs/config.h: define NOMINMAX instead of min/max
190 * wtf/Vector.h: put back hack to ensure that min/max
191 are not defined as macros.
193 2006-11-19 Simon Hausmann <hausmann@kde.org>
197 http://bugs.webkit.org/show_bug.cgi?id=11649
198 Fix CMake Qt-only build without KDE CMake files
201 * pcre/CMakeLists.txt:
203 2006-11-17 Anders Carlsson <acarlsson@apple.com>
207 Make sure that we always use std::min and std::max instead of macros.
209 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
213 === Safari-521.31 ===
215 2006-11-12 Geoffrey Garen <ggaren@apple.com>
217 Reviewed by Beth Dakin.
219 Added project-wide setting to disable Microsoft's made-up deprecation
220 warnings related to std:: functions. (Doesn't have any affect yet,
221 since we currently disable all deprecation warnings.)
223 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
225 2006-11-12 Mark Rowe <bdash@webkit.org>
229 Clean up of JavaScriptCore bakefiles.
231 * JavaScriptCoreSources.bkl:
234 2006-11-11 Alexey Proskuryakov <ap@webkit.org>
238 http://bugs.webkit.org/show_bug.cgi?id=11508
239 Undisable some warnings for JSImmediate.h
241 Fix suggested by Don Gibson.
244 Re-enable all MSVC warnings, move the remaining runtime checks
247 2006-11-10 Zalan Bujtas <zalan.bujtas@nokia.com>
251 Added s60/symbian platform defines.
252 http://bugs.webkit.org/show_bug.cgi?id=11540
256 === Safari-521.30 ===
258 2006-11-08 Ada Chan <adachan@apple.com>
262 Added a method to delete all the keys in a HashMap.
265 (WTF::deleteAllPairFirsts):
266 (WTF::deleteAllKeys):
268 2006-11-07 Anders Carlsson <acarlsson@apple.com>
272 * API/JSClassRef.cpp:
273 (OpaqueJSClass::OpaqueJSClass):
274 Initialize cachedPrototype to 0.
276 2006-11-06 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
280 Remove warning about garbage after #else. #else clause applies for all
281 non-mac platforms, not only win.
283 * kjs/date_object.cpp:
285 2006-11-06 Mark Rowe <bdash@webkit.org>
287 Reviewed by the wonderful Mitz Pettel.
289 http://bugs.webkit.org/show_bug.cgi?id=11524
290 Bug 11524: REGRESSION(r9842): Array.prototype.join should use ToString operator rather than calling toString on each element
292 * kjs/array_object.cpp:
293 (ArrayProtoFunc::callAsFunction): Use ToString operator on each element rather than calling their toString method.
295 2006-11-03 Steve Falkenburg <sfalken@apple.com>
301 2006-11-03 Alexey Proskuryakov <ap@nypop.com>
305 http://bugs.webkit.org/show_bug.cgi?id=11504
306 Fix warnings on non 32 bit platforms
309 (KJS::JSImmediate::NanAsBits):
310 (KJS::JSImmediate::oneAsBits):
311 Rewrite in a way that moves runtime checks to compile-time.
314 (KJS::JSImmediate::fromDouble):
315 (KJS::JSImmediate::toDouble):
317 2006-11-02 George Staikos <staikos@kde.org>
322 Remove a deprecated pthreads call.
324 2006-11-02 Anders Carlsson <acarlsson@apple.com>
326 Reviewed by Maciej, landed by Anders.
329 Make KDE support optional.
331 2006-11-01 Kevin McCullough <KMcCullough@apple.com>
335 - 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.
338 (KJS::equivalentYearForDST):
339 (KJS::getDSTOffsetSimple):
342 2006-10-31 Geoffrey Garen <ggaren@apple.com>
346 Fixed http://bugs.webkit.org/show_bug.cgi?id=11477
347 REGRESSION: GMail crashes in KJS::FunctionImp::callerGetter
350 (KJS::FunctionImp::argumentsGetter): Removed unnecessary braces.
351 (KJS::FunctionImp::callerGetter): More logical NULL checking.
353 2006-10-31 Oliver Hunt <oliver@apple.com>
357 Adding definition for PLATFORM(CI)
361 2006-10-31 Vladimir Olexa <vladimir.olexa@gmail.com>
365 http://bugs.webkit.org/show_bug.cgi?id=4166
366 Function object does not support caller property
368 Test: fast/js/caller-property.html
371 (KJS::FunctionImp::callerGetter): added
372 (KJS::FunctionImp::getOwnPropertySlot): added if statement to handle callerGetter()
373 * kjs/function.h: added callerGetter() declaration
374 * kjs/identifier.h: added caller property macro
375 * tests/mozilla/expected.html:
377 2006-10-30 Kevin McCullough <KMcCullough@apple.com>
381 - Fix some timezone issues and JavaScriptCore date tests. Addresses bugzilla 4930.
384 (KJS::GregorianDateTime::GregorianDateTime): Here's the fix, to add parenthesis for order of precedence.
385 * kjs/date_object.cpp:
386 (KJS::DateProtoFunc::callAsFunction):
387 (KJS::DateObjectImp::construct): memset not needed as GregorianDateTime initializes itself.
389 2006-10-30 Darin Adler <darin@apple.com>
391 Reviewed by John Sullivan.
393 * kjs/SavedBuiltins.h: Added needed include.
394 * wtf/OwnPtr.h: (WTF::OwnPtr::set): Fixed mistake in assertion.
396 2006-10-28 Darin Adler <darin@apple.com>
400 - renamed PassRefPtr::release to releaseRef to make it clearer that
401 it's the counterpart of adoptRef, and to make it harder to confuse
402 it with the safer-to-use RefPtr::release
404 * kjs/identifier.cpp:
405 (KJS::CStringTranslator::translate):
406 (KJS::UCharBufferTranslator::translate):
408 (KJS::UString::Rep::create):
410 (WTF::PassRefPtr::PassRefPtr):
411 (WTF::PassRefPtr::~PassRefPtr):
412 (WTF::PassRefPtr::get):
413 (WTF::PassRefPtr::releaseRef):
414 (WTF::PassRefPtr::operator->):
415 (WTF::PassRefPtr::operator=):
417 (WTF::static_pointer_cast):
418 (WTF::const_pointer_cast):
420 (WTF::RefPtr::RefPtr):
421 (WTF::RefPtr::operator=):
423 2006-10-28 Darin Adler <darin@apple.com>
427 * kjs/grammar.y: Add definitions of YYMALLOC and YYFREE to fix
428 a warning some people see (not sure why others don't see it).
430 * JavaScriptCore.vcproj/JavaScriptCore/grammarWrapper.cpp: Touch
431 this file to force it to re-build grammar.cpp.
433 2006-10-28 Darin Adler <darin@apple.com>
437 - made changes so the code compiles with the highest warning level
438 under MSVC (disabling some warnings, making some code fixes)
440 * API/JSCallbackConstructor.cpp:
441 (KJS::JSCallbackConstructor::construct):
442 * API/JSCallbackFunction.cpp:
443 (KJS::JSCallbackFunction::callAsFunction):
444 * API/JSCallbackObject.cpp:
445 (KJS::JSCallbackObject::init):
446 (KJS::JSCallbackObject::construct):
447 (KJS::JSCallbackObject::callAsFunction):
448 * API/JSObjectRef.cpp:
449 (JSPropertyNameArrayGetNameAtIndex):
450 * API/JSStringRef.cpp:
451 (JSStringCreateWithCharacters):
452 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
453 * bindings/c/c_utility.cpp:
454 (KJS::Bindings::convertUTF8ToUTF16):
455 (KJS::Bindings::coerceValueToNPVariantStringType):
456 (KJS::Bindings::convertValueToNPVariant):
458 (KJS::GregorianDateTime::GregorianDateTime):
460 (KJS::ExecState::hadException):
462 (KJS::JSImmediate::fromDouble):
463 (KJS::JSImmediate::toDouble):
464 (KJS::JSImmediate::NanAsBits):
465 (KJS::JSImmediate::oneAsBits):
467 * kjs/PropertyNameArray.h:
468 (KJS::PropertyNameArray::size):
469 * kjs/array_object.cpp:
470 (ArrayObjectImp::callAsFunction):
471 * kjs/bool_object.cpp:
472 (BooleanObjectImp::callAsFunction):
474 (KJS::Collector::allocate):
475 (KJS::Collector::markCurrentThreadConservatively):
476 (KJS::Collector::collect):
478 (KJS::Completion::isValueCompletion):
479 * kjs/date_object.cpp:
482 (Debugger::sourceParsed):
483 (Debugger::sourceUnused):
484 (Debugger::exception):
485 (Debugger::atStatement):
486 (Debugger::callEvent):
487 (Debugger::returnEvent):
489 * kjs/error_object.cpp:
490 (ErrorObjectImp::callAsFunction):
491 (NativeErrorImp::callAsFunction):
493 (KJS::FunctionImp::processVarDecls):
494 (KJS::GlobalFuncImp::callAsFunction):
495 * kjs/function_object.cpp:
496 (FunctionPrototype::callAsFunction):
498 * kjs/identifier.cpp:
499 (KJS::CStringTranslator::translate):
500 (KJS::Identifier::add):
504 (Lexer::isIdentStart):
505 (Lexer::isIdentPart):
508 (Lexer::isOctalDigit):
509 (Lexer::matchPunctuator):
510 (Lexer::singleEscape):
511 (Lexer::convertOctal):
513 (Lexer::convertUnicode):
516 * kjs/math_object.cpp:
517 (MathFuncImp::callAsFunction):
518 * kjs/number_object.cpp:
519 (integer_part_noexp):
521 (NumberProtoFunc::callAsFunction):
522 (NumberObjectImp::callAsFunction):
524 (KJS::JSObject::deleteProperty):
525 (KJS::JSObject::callAsFunction):
526 (KJS::JSObject::toBoolean):
527 (KJS::JSObject::toObject):
529 (KJS::JSObject::getPropertySlot):
530 * kjs/property_map.cpp:
532 (KJS::PropertyMap::put):
533 (KJS::PropertyMap::insert):
534 (KJS::PropertyMap::containsGettersOrSetters):
535 * kjs/property_map.h:
536 (KJS::PropertyMap::hasGetterSetterProperties):
537 * kjs/property_slot.h:
538 * kjs/string_object.cpp:
539 (StringInstance::getPropertyNames):
540 (StringObjectImp::callAsFunction):
541 (StringObjectFuncImp::callAsFunction):
543 (KJS::UString::Rep::computeHash):
544 (KJS::UString::UString):
545 (KJS::UString::from):
546 (KJS::UString::append):
547 (KJS::UString::ascii):
548 (KJS::UString::operator=):
549 (KJS::UString::find):
550 (KJS::UString::rfind):
554 (KJS::UCharReference::low):
555 (KJS::UCharReference::high):
557 (KJS::JSValue::toUInt16):
559 * pcre/pcre_compile.c:
560 (get_othercase_range):
563 * pcre/pcre_internal.h:
564 * wtf/HashFunctions.h:
566 (WTF::PtrHash::hash):
571 * wtf/StringExtras.h:
573 * wtf/unicode/icu/UnicodeIcu.h:
574 (WTF::Unicode::isPrintableChar):
576 2006-10-26 W. Andy Carrel <wac@google.com>
580 - Fix http://bugs.webkit.org/show_bug.cgi?id=7445 /
581 <rdar://problem/4614195> (and 7253 / <rdar://4694011>) by changing
582 inline regexps so that they can have \u escaped Unicode sequences and
588 (Lexer::shift): Looking ahead one additional character for the benefit
590 (Lexer::scanRegExp): Change code to support unicode escapes in inline
592 * kjs/lexer.h: Extra lookahead added.
594 === Safari-521.29 ===
596 2006-10-26 Nikolas Zimmermann <zimmermann@kde.org>
600 Fix build with older gcc 3.3.4.
602 * kjs/DateMath.cpp: Remove inline prefix.
603 (KJS::equivalentYearForDST):
605 2006-10-26 Darin Adler <darin@apple.com>
609 - fix iteration of properties of string objects (found because of a warning
610 emitted by the MSVC compiler)
612 * kjs/string_object.cpp: (StringInstance::getPropertyNames): Change code that
613 wants to format a number as a string to use UString::from. Before it was using
614 the UString constructor that makes a string from a character!
617 * kjs/ustring.cpp: Remove the dangerous and not all that helpful UString(char)
620 * kjs/grammar.y: Change code to not depend on the UString(char) constructor.
621 This is potentially more efficient anyway because we could overload the + operator
622 some day to handle char* directly instead of creating a UString.
624 * kjs/nodes2string.cpp: (SourceStream::operator<<): Change code to not depend on
625 the UString(char) constructor.
627 2006-10-25 Kevin McCullough <KMcCullough@apple.com>
629 Reviewed by Steve (rubber stamp).
631 - Link against your local build of JavaScriptCore.lib first, this fixes some errors on release builds of testkjs.
633 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
635 2006-10-25 Geoffrey Garen <ggaren@apple.com>
639 Removed duplicate symbol declaration.
641 * JavaScriptCore.xcodeproj/project.pbxproj:
644 2006-10-24 Steve Falkenburg <sfalken@apple.com>
648 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
650 2006-10-24 Kevin McCullough <KMcCullough@apple.com>
654 - 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.
656 * kjs/date_object.cpp:
658 (KJS::formatLocaleDate):
659 (KJS::DateProtoFunc::callAsFunction):
661 2006-10-23 Kevin McCullough <KMcCullough@apple.com>
667 * JavaScriptCore.xcodeproj/project.pbxproj:
670 2006-10-23 Kevin McCullough <KMcCullough@apple.com>
674 - Makes the toTM function an operator. Was going to piggy back on a patch but the patch needs more work.
677 (KJS::equivalentYearForDST):
679 (KJS::GregorianDateTime::operator tm):
680 * kjs/date_object.cpp:
682 (KJS::DateProtoFunc::callAsFunction):
684 2006-10-23 Kevin McCullough <KMcCullough@apple.com>
688 - 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).
693 2006-10-21 Steve Falkenburg <sfalken@apple.com>
697 Add minimal compatibility with MSVCRT leak checker
701 2006-10-23 Kevin McCullough <KMcCullough@apple.com>
705 - Sets the lowercase range correctly in the test and consolidates a variable to make the test more readable.
707 * tests/mozilla/ecma/String/15.5.4.11-2.js:
709 2006-10-21 Darin Adler <darin@apple.com>
713 - http://bugs.webkit.org/show_bug.cgi?id=11377
714 swap(Vector, Vector) should be O(1) instead of O(n)
717 (WTF::VectorBuffer::swap): Added.
718 (WTF::Vector::swap): Added.
719 (WTF::swap): Added overload that takes two Vector objects.
721 2006-10-21 Darin Adler <darin@apple.com>
725 - http://bugs.webkit.org/show_bug.cgi?id=11376
726 build scripts should invoke make with "-j" option for multiple processors
728 * JavaScriptCore.xcodeproj/project.pbxproj: Pass -j `sysctl -n hw.ncpu` to make.
730 2006-10-19 Kevin McCullough <KMcCullough@apple.com>
734 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.
735 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.
737 * tests/mozilla/ecma/String/15.5.4.11-2.js:
739 2006-10-18 Maciej Stachowiak <mjs@apple.com>
743 - remove vestiges of KXMLCore name (former name of WTF).
751 * wtf/FastMallocInternal.h:
754 * wtf/HashCountedSet.h:
755 * wtf/HashFunctions.h:
768 * wtf/StringExtras.h:
772 * wtf/VectorTraits.h:
774 2006-10-17 Steve Falkenburg <sfalken@apple.com>
780 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
782 2006-10-17 Kevin McCullough <KMcCullough@apple.com>
786 Fixed a date issue where the UTC offset was not set in win.
789 (KJS::getDSTOffsetSimple):
791 (KJS::msToGregorianDateTime):
794 (KJS::GregorianDateTime::GregorianDateTime):
796 2006-10-17 Kevin McCullough <KMcCullough@apple.com>
800 Fixes a JavaScriptCore math issue on win.
802 * kjs/math_object.cpp:
803 (MathFuncImp::callAsFunction):
807 2006-10-16 Kevin McCullough <kmccullough@apple.com>
811 Removed unecessary global specifiers.
813 * kjs/math_object.cpp:
814 (MathFuncImp::callAsFunction):
816 2006-10-16 Kevin McCullough <KMcCullough@apple.com>
820 Fixes a compile order issue for testkjs on win.
822 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
824 2006-10-15 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
828 Remove junk (as gcc calls it) after #else clause.
830 * wtf/FastMalloc.cpp:
833 2006-10-14 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
837 Define KXMLCORE_USE_CURL for platforms that wish to use CURL as
838 networking, and set it for GDK build
842 2006-10-13 Marvin Decker <marv.decker@gmail.com>
844 Reviewed by Kevin McCullough.
846 Fixes http://bugs.webkit.org/show_bug.cgi?id=11283
847 Fixes Qt/Linux and Windows build
851 * kjs/date_object.cpp:
852 (KJS::DateProtoFunc::callAsFunction):
854 2006-10-13 Kevin McCullough <KMcCullough@apple.com>
856 Reviewed by Adam, Geoff, Darin.
858 Fixed displaying the UTC offset and time zone string, as well as renamed the GregorianDateTime structure and clean up.
863 (KJS::getDSTOffsetSimple):
864 (KJS::gregorianDateTimeToMS):
865 (KJS::msToGregorianDateTime):
867 (KJS::GregorianDateTime::GregorianDateTime):
868 (KJS::GregorianDateTime::~GregorianDateTime):
869 (KJS::GregorianDateTime::toTM):
870 * kjs/date_object.cpp:
873 (KJS::formatDateUTCVariant):
875 (KJS::fillStructuresUsingTimeArgs):
876 (KJS::fillStructuresUsingDateArgs):
877 (KJS::DateInstance::getTime):
878 (KJS::DateInstance::getUTCTime):
879 (KJS::DateProtoFunc::callAsFunction):
880 (KJS::DateObjectImp::construct):
881 (KJS::DateObjectImp::callAsFunction):
882 (KJS::DateObjectFuncImp::callAsFunction):
886 2006-10-13 Kevin McCullough <KMcCullough@apple.com>
890 Gets JavaScripCore tests running on windows.
892 * Scripts/run-javascriptcore-tests:
893 * Scripts/webkitdirs.pm:
895 2006-10-12 Geoffrey Garen <ggaren@apple.com>
899 Removed JSObjectMakeWithPrototype, clarified some comments. We really
900 don't want people to manage their own prototypes, so we don't want an
901 extra function in the API devoted to just that. People can still manage
902 their own prototypes if they really want by using JSObjectSetPrototype.
904 * API/JSClassRef.cpp:
905 (OpaqueJSClass::createNoAutomaticPrototype):
906 (OpaqueJSClass::create):
908 * API/JSObjectRef.cpp:
914 * JavaScriptCore.exp:
916 2006-10-12 Kevin McCullough <KMcCullough@apple.com>
924 * kjs/date_object.cpp:
927 2006-10-11 Kevin McCullough <KMcCullough@apple.com>
931 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.
936 (KJS::getDSTOffsetSimple):
942 * kjs/date_object.cpp:
945 (KJS::DateProtoFunc::callAsFunction):
946 (KJS::DateObjectImp::construct):
947 (KJS::DateObjectImp::callAsFunction):
948 (KJS::DateObjectFuncImp::callAsFunction):
952 2006-10-09 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
956 Improve gdk build compiler flags (show warning, no rtti and exceptions).
960 2006-10-06 Kevin McCullough <KMcCullough@apple.com>
964 DST and TimeZones were wrong in some cases, specifically on some of the dates where DST changes.
967 (KJS::equivalentYearForDST):
969 (KJS::getDSTOffsetSimple):
971 (KJS::dateToMseconds):
974 * kjs/date_object.cpp:
977 2006-10-05 Darin Adler <darin@apple.com>
979 Reviewed by Kevin McCullough.
981 * wtf/Assertions.cpp: Fix build when _DEBUG is not defined.
983 2006-10-04 Kevin McCullough <KMcCullough@apple.com>
987 - 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.
992 * kjs/date_object.cpp:
996 2006-10-04 Geoffrey Garen <ggaren@apple.com>
998 Patch by Darin and me, reviewed by Maciej.
1000 Fixed <rdar://problem/4518397> REGRESSION(?): Oft-seen but unrepro crash
1001 in JavaScript garbage collection (KJS::Collector::collect())
1002 <rdar://problem/4752492> Crash in KJS::collect
1004 The issue here was allocating one garbage-collected object in the midst
1005 of allocating a second garbage-collected object. In such a case, the
1006 zeroIfFree word lies.
1008 * kjs/collector.cpp:
1009 (KJS::Collector::allocate):
1010 (KJS::Collector::collect):
1012 2006-10-04 Kevin McCullough <KMcCullough@apple.com>
1019 (KJS::dateToDayInYear): accept and correctly handle negative months
1021 2006-10-05 Kevin McCullough <KMcCullough@apple.com>
1026 (KJS::dateToDayInYear):
1028 2006-10-05 Mark Rowe <bdash@webkit.org>
1030 Reviewed by maculloch.
1034 * JavaScriptCoreSources.bkl: Add DateMath.cpp to file list.
1036 2006-10-05 Kevin McCullough <KMcCullough@apple.com>
1042 * JavaScriptCore.xcodeproj/project.pbxproj:
1044 2006-10-04 Nikolas Zimmermann <zimmermann@kde.org>
1048 Fix Qt/Linux build by adding DateMath.cpp to compilation.
1050 * CMakeLists.txt: Also replace tabs with spaces.
1052 2006-10-04 Kevin McCullough <KMcCullough@apple.com>
1054 Reviewed by DethBakin.
1056 - 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.
1061 (KJS::dateToDayInYear):
1063 2006-10-05 Darin Adler <darin@apple.com>
1067 * wtf/Assertions.cpp: Changed assertion formatting to omit the "======"
1068 lines so you can see more assertions in less space. Also improved format
1069 of file/line information so it works with more development environments.
1071 2006-10-04 Kevin McCullough <KMcCullough@apple.com>
1075 - The build machine is more sensitive about automatic conversions. These fixes exp
1076 licitly cast or change the input and return types of functions to avoid conversions.
1078 * JavaScriptCore.xcodeproj/project.pbxproj:
1084 (KJS::monthToDayInYear):
1085 (KJS::dateToDayInYear):
1086 (KJS::getDSTOffsetSimple):
1087 (KJS::getDSTOffset):
1088 (KJS::dateToMseconds):
1091 2006-10-04 Kevin McCullough <KMcCullough@apple.com>
1095 - 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.
1097 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1098 * JavaScriptCore.xcodeproj/project.pbxproj:
1099 * kjs/DateMath.cpp: Added.
1102 (KJS::daysFrom1970ToYear):
1103 (KJS::msFrom1970ToYear):
1107 (KJS::isInLeapYear):
1109 (KJS::msToMilliseconds):
1115 (KJS::msToDayInMonth):
1116 (KJS::monthToDayInYear):
1117 (KJS::timeToMseconds):
1118 (KJS::dateToDayInYear):
1119 (KJS::equivalentYearForDST):
1120 (KJS::getUTCOffset):
1121 (KJS::getDSTOffsetSimple):
1122 (KJS::getDSTOffset):
1123 (KJS::localTimeToUTC):
1124 (KJS::UTCToLocalTime):
1125 (KJS::dateToMseconds):
1128 * kjs/DateMath.h: Added.
1130 * kjs/date_object.cpp:
1133 (KJS::DateInstance::getTime):
1134 (KJS::DateInstance::getUTCTime):
1135 (KJS::DateProtoFunc::callAsFunction):
1136 (KJS::DateObjectImp::construct):
1137 (KJS::DateObjectFuncImp::callAsFunction):
1140 * os-win32/stdint.h:
1142 2006-10-02 Nikolas Zimmermann <zimmermann@kde.org>
1144 Reviewed/landed by Adam.
1146 Build testkjs on Qt/Linux.
1150 2006-10-02 Nikolas Zimmermann <zimmermann@kde.org>
1152 Reviewed by eseidel. Landed by eseidel.
1154 Fix win32 build, which has no inttypes.h
1158 2006-10-02 Nikolas Zimmermann <zimmermann@kde.org>
1160 Reviewed by eseidel & mjs. Landed by eseidel.
1162 Fix Qt/Linux build with older gcc 3.3.4.
1163 http://bugs.webkit.org/show_bug.cgi?id=11116
1165 * kjs/lookup.h: Move cacheGlobalObject into KJS namespace.
1166 (KJS::cacheGlobalObject): Also remove GCC_ROOT_NS_HACK.
1167 * wtf/Assertions.h: Include inttypes.h for uintptr_t.
1169 2006-09-28 Steve Falkenburg <sfalken@apple.com>
1173 Use $(ConfigSuffix) set via vsprops files to add _debug
1174 to end of debug filenames.
1176 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1177 * JavaScriptCore.vcproj/debug.vsprops: Added.
1178 * JavaScriptCore.vcproj/dftables/dftables.vcproj:
1179 * JavaScriptCore.vcproj/release.vsprops: Added.
1180 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
1182 2006-09-28 Darin Adler <darin@apple.com>
1186 - support for change that should fix <rdar://problem/4733044>
1187 REGRESSION: XML iBench shows 10% perf. regression (copying
1188 strings while decoding)
1190 * wtf/Vector.h: Changed VectorBuffer so that the general case
1191 contains an instance of the 0 case, since deriving from it
1192 was violating the Liskov Substitution Principle.
1193 (WTF::VectorBuffer::releaseBuffer): Added. Releases the buffer so it can
1194 be adopted by another data structure that uses the FastMalloc.h allocator.
1195 Returns 0 if the internal buffer was being used.
1196 (WTF::Vector::releaseBuffer): Added. Releases the buffer as above or creates
1197 a new one in the case where the internal buffer was being used.
1199 2006-09-28 Maciej Stachowiak <mjs@apple.com>
1203 - change garbage collection to happen at increments proportional to number of live objects, not always
1204 every 1000 allocations
1206 * kjs/collector.cpp:
1207 (KJS::Collector::allocate):
1209 2006-09-28 Maciej Stachowiak <mjs@apple.com>
1213 - fixed REGRESSION (r16606): javascriptCore Crash on website load
1217 - fixed some possible off-by-one bugs
1218 - use indexing, not iterators, for Vectors
1219 - store Vector by pointer instead of by value to avoid blowing out FunctionImp size
1222 (KJS::FunctionImp::addParameter):
1223 (KJS::FunctionImp::parameterString):
1224 (KJS::FunctionImp::processParameters):
1225 (KJS::FunctionImp::lengthGetter):
1226 (KJS::FunctionImp::getParameterName):
1229 2006-09-27 Steve Falkenburg <sfalken@apple.com>
1235 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1236 * JavaScriptCore.vcproj/JavaScriptCore/dstroot-to-sdk.cmd: Removed.
1238 2006-09-27 John Sullivan <sullivan@apple.com>
1241 (KJS::FunctionImp::getParameterName):
1242 removed assertion that displeased gcc 4.0.1 (build 5420):
1243 ASSERT(static_cast<size_t>(index) == index);
1245 2006-09-27 Kevin McCullough <KMcCullough@apple.com>
1249 Cleanup of previous fix which was to address Radar: 4752492
1252 (KJS::FunctionImp::addParameter):
1253 (KJS::FunctionImp::parameterString):
1254 (KJS::FunctionImp::processParameters):
1255 (KJS::FunctionImp::lengthGetter):
1256 (KJS::FunctionImp::getParameterName):
1259 2006-09-27 Kevin McCullough <KMcCullough@apple.com>
1263 Fixes a GC stack overflow crash.
1264 The change is to move from a linked list implementation of Parameters to a Vector.
1265 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.
1268 (KJS::Parameter::Parameter):
1269 (KJS::FunctionImp::addParameter):
1270 (KJS::FunctionImp::parameterString):
1271 (KJS::FunctionImp::processParameters):
1272 (KJS::FunctionImp::lengthGetter):
1273 (KJS::FunctionImp::getParameterName):
1276 2006-09-27 Steve Falkenburg <sfalken@apple.com>
1280 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1282 2006-09-27 Steve Falkenburg <sfalken@apple.com>
1284 Set path before build.
1286 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1288 2006-09-27 Sean Gies <seangies@apple.com>
1290 Reviewed by Adam Roben.
1292 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Debug config should link to debug runtime.
1293 * JavaScriptCore.vcproj/dftables/dftables.vcproj: Debug config should link to debug runtime.
1295 2006-09-27 Don Melton <gramps@apple.com>
1297 Reviewed by Adam Roben.
1299 Changed line ending from DOS to UNIX format so it doesn't die running
1302 * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
1304 2006-09-23 Alexey Proskuryakov <ap@nypop.com>
1308 http://bugs.webkit.org/show_bug.cgi?id=10183
1309 REGRESSION: obfuscated JS decoding breaks because of soft hyphen removal
1310 (Fanfiction.net author pages not listing stories)
1312 Rolled out the fix for bug 4139.
1317 * tests/mozilla/ecma/Array/15.4.5.1-1.js:
1318 * tests/mozilla/expected.html:
1320 2006-09-22 Steve Falkenburg <sfalken@apple.com>
1324 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1326 2006-09-22 Darin Adler <darin@apple.com>
1330 * wtf/Vector.h: Add an append that takes a pointer and length.
1331 Generalize the existing Vector append to work on vectors with
1332 any value for inlineCapacity. Change the append algorithm so
1333 it doesn't check capacity each time through the loop.
1335 2006-09-22 Steve Falkenburg <sfalken@apple.com>
1339 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1341 2006-09-21 Geoffrey Garen <ggaren@apple.com>
1345 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1346 Updated to include the right path.
1347 * wtf/FastMalloc.h: #include Platform.h, since we use Platform macros.
1349 === Safari-521.27 ===
1351 2006-09-20 Anders Carlsson <acarlsson@apple.com>
1353 Reviewed by Dave Hyatt.
1358 2006-09-20 Sean Gies <seangies@apple.com>
1360 Reviewed by Steve Falkenburg.
1362 * wtf/Assertions.cpp: Debug messages should go into debugger console.
1364 2006-09-20 David Hyatt <hyatt@apple.com>
1366 Add an implementation of lrint for Win32.
1373 2006-09-15 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
1377 http://bugs.webkit.org/show_bug.cgi?id=10864
1378 Bug 10864: Linux\GDK build fixes
1380 * JavaScriptCoreSources.bkl:
1383 2006-09-15 Adam Roben <aroben@apple.com>
1387 * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
1389 2006-09-15 Anders Carlsson <acarlsson@apple.com>
1391 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1392 Fix the release build.
1394 2006-09-15 Anders Carlsson <acarlsson@apple.com>
1398 Add JavaScriptCore API to the build.
1400 * API/JSCallbackConstructor.cpp:
1401 * API/JSCallbackFunction.cpp:
1402 * API/JSCallbackObject.cpp:
1403 * API/JSClassRef.cpp:
1404 * API/JSContextRef.cpp:
1405 * API/JSObjectRef.cpp:
1406 * API/JSStringRef.cpp:
1407 * API/JSValueRef.cpp:
1408 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1409 * os-win32/stdbool.h: Added.
1411 2006-09-12 Steve Falkenburg <sfalken@apple.com>
1415 Build tweaks (doing JavaScriptCore now since it doesn't have
1418 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1419 * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
1420 * JavaScriptCore.vcproj/JavaScriptCore/dstroot-to-sdk.cmd: Added.
1421 * JavaScriptCore.vcproj/dftables/dftables.vcproj:
1422 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
1424 2006-09-11 Brady Eidson <beidson@apple.com>
1426 Build fix - I think Tim's last checkin wasn't tested on Tiger, possibly. I simply
1427 commented out the undefined constants until he can have a chance to make the right call
1429 * bindings/objc/objc_utility.mm:
1430 (KJS::Bindings::objcValueTypeForType): Commented out undefined symbols
1432 2006-09-11 Timothy Hatcher <timothy@apple.com>
1434 Reviewed by Tim O. and Darin.
1436 Add support for more method signatures affecting ObjC methods called from JavaScript:
1437 - Added unsigned types and long long.
1438 - Allow methods that use const, oneway, bycopy and byref type modifiers.
1440 * bindings/objc/objc_instance.mm:
1441 (ObjcInstance::invokeMethod):
1442 * bindings/objc/objc_utility.h:
1444 * bindings/objc/objc_utility.mm:
1445 (KJS::Bindings::convertValueToObjcValue):
1446 (KJS::Bindings::convertObjcValueToValue):
1447 (KJS::Bindings::objcValueTypeForType):
1449 2006-09-05 Timothy Hatcher <timothy@apple.com>
1453 <rdar://problem/4715840> SEL is not char*
1455 * bindings/objc/objc_class.mm:
1456 (KJS::Bindings::ObjcClass::methodsNamed): use sel_getName instead of a char* cast.
1457 * bindings/objc/objc_runtime.mm:
1458 (ObjcFallbackObjectImp::callAsFunction): ditto
1460 2006-09-03 Alexey Proskuryakov <ap@nypop.com>
1464 http://bugs.webkit.org/show_bug.cgi?id=10693
1465 Convert JavaScript arrays to AppleScript lists
1467 * JavaScriptCore.exp: Export ArrayInstance::info and ArrayInstance::getItem().
1468 * kjs/array_instance.h:
1469 * kjs/array_object.cpp:
1470 (ArrayInstance::getItem): Added a method to access array items from C++.
1472 2006-09-02 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
1476 Bug 10454: Unix bakefile fixes
1477 http://bugs.webkit.org/show_bug.cgi?id=10454
1479 * JavaScriptCoreSources.bkl:
1481 2006-09-01 Nikolas Zimmermann <zimmermann@kde.org>
1483 Reviewed by hyatt. Landed by eseidel.
1487 * pcre/CMakeLists.txt: Add wtf/ include.
1489 2006-09-01 Nikolas Zimmermann <zimmermann@kde.org>
1491 Reviewed and landed by ap.
1493 Fix build on Linux (C89 without gcc extensions enabled).
1495 * pcre/pcre_internal.h: Use C style comments.
1496 * wtf/Assertions.h: Use C style comments.
1497 * wtf/Platform.h: Use C style comments.
1499 2006-09-01 Steve Falkenburg <sfalken@apple.com>
1503 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1504 * JavaScriptCore.vcproj/dftables/dftables.vcproj:
1506 2006-08-31 Anders Carlsson <acarlsson@apple.com>
1510 Add new portability functions to MathExtras.h and add StringExtras.h which is for
1511 string portability functions.
1513 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1514 * bindings/c/c_instance.cpp:
1515 * kjs/date_object.cpp:
1519 * wtf/StringExtras.h: Added.
1523 2006-08-31 Anders Carlsson <acarlsson@apple.com>
1529 * JavaScriptCore.vcproj/dftables/dftables.vcproj:
1530 * pcre/pcre_internal.h:
1532 2006-08-31 Timothy Hatcher <timothy@apple.com>
1536 Band-aid fix for PCRE to compile for ppc64 and x86_64 now that
1537 we use -Wshorten-64-to-32. Adds an INT_CAST macro that ASSERTs
1538 the value <= INT_MAX.
1540 I filed <rdar://problem/4712064> to track the need to verify
1541 PCRE's 64-bit compliance.
1543 * pcre/pcre_compile.c:
1552 (pcre_get_substring_list):
1553 * pcre/pcre_internal.h:
1554 * pcre/pcre_tables.c:
1555 * pcre/pcre_try_flipped.c:
1556 (_pcre_try_flipped):
1558 2006-08-30 Darin Adler <darin@apple.com>
1560 Reviewed by Tim Hatcher.
1562 - add WTF::getPtr, a function template that makes it possible to write
1563 generic code that gets a raw pointer out of any of our pointer types
1565 * JavaScriptCore.xcodeproj/project.pbxproj:
1566 * wtf/GetPtr.h: Added.
1567 * wtf/ListRefPtr.h: (WTF::getPtr): Added.
1568 * wtf/OwnArrayPtr.h: (WTF::getPtr): Added.
1569 * wtf/OwnPtr.h: (WTF::getPtr): Added.
1570 * wtf/PassRefPtr.h: (WTF::getPtr): Added.
1571 * wtf/RefPtr.h: (WTF::getPtr): Added.
1573 2006-08-29 waylonis <waylonis@google.com>
1575 Reviewed, tweaked by ggaren.
1577 - Added storage and accessor functions for ExecState as a fix for
1578 http://bugs.webkit.org/show_bug.cgi?id=10114
1580 * kjs/ExecState.cpp:
1581 (KJS::ExecState::ExecState):
1584 (KJS::Context::setExecState):
1585 (KJS::Context::execState):
1587 2006-08-30 Nikolas Zimmermann <zimmermann@kde.org>
1591 Commit KDE related tweaks, to be able to
1592 differentiate between a Qt-only or a KDE build.
1594 * CMakeLists.txt: Install wtf-unity library.
1595 * wtf/Platform.h: Add define for the KDE platform.
1597 2006-08-28 Darin Adler <darin@apple.com>
1601 * kjs/list.h: Use explicit in constructor (as appropriate).
1603 2006-08-24 Nikolas Zimmermann <zimmermann@kde.org>
1605 Reviewed, tweaked and landed by ap
1607 http://bugs.webkit.org/show_bug.cgi?id=10467
1608 WebKit should have Qt platform support (Part II)
1610 * CMakeLists.txt: Adjust to Anders' build fixes.
1611 * wtf/Platform.h: Fix define for the Qt platform (we don't use/need Cairo.)
1613 2006-08-23 David Hyatt <hyatt@apple.com>
1615 Fix Platform.h to include #defines for graphics features.
1619 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1622 2006-08-23 Anders Carlsson <acarlsson@apple.com>
1626 Make the bindings compile without CoreFoundation.
1628 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1629 * bindings/c/c_instance.cpp:
1630 * bindings/c/c_utility.cpp:
1631 (KJS::Bindings::convertUTF8ToUTF16):
1633 * bindings/runtime.cpp:
1634 (KJS::Bindings::Instance::createBindingForLanguageInstance):
1635 (KJS::Bindings::Instance::createLanguageInstanceForValue):
1636 * bindings/runtime_root.cpp:
1637 * bindings/runtime_root.h:
1638 * kjs/interpreter.cpp:
1639 (KJS::Interpreter::createLanguageInstanceForValue):
1640 * kjs/interpreter.h:
1642 2006-08-22 Anders Carlsson <acarlsson@apple.com>
1646 Move the npruntime code over to using HashMap and the runtime_root code over to using
1647 HashMap and HashCountedSet.
1649 * bindings/NP_jsobject.cpp:
1650 * bindings/c/c_utility.cpp:
1651 (KJS::Bindings::identifierFromNPIdentifier):
1652 * bindings/c/c_utility.h:
1653 * bindings/jni/jni_jsobject.cpp:
1654 (JavaJSObject::invoke):
1655 * bindings/npruntime.cpp:
1656 (getStringIdentifierMap):
1657 (getIntIdentifierMap):
1658 (_NPN_GetStringIdentifier):
1659 (_NPN_GetIntIdentifier):
1660 * bindings/runtime_root.cpp:
1661 (getReferencesByRootMap):
1663 (KJS::Bindings::findReferenceSet):
1664 (KJS::Bindings::rootForImp):
1665 (KJS::Bindings::rootForInterpreter):
1666 (KJS::Bindings::addNativeReference):
1667 (KJS::Bindings::removeNativeReference):
1668 (RootObject::removeAllNativeReferences):
1669 * bindings/runtime_root.h:
1671 2006-08-22 Anders Carlsson <acarlsson@apple.com>
1675 Switch over the NPAPI and Java bindings to using HashMaps instead of dictionaries.
1677 * JavaScriptCore.xcodeproj/project.pbxproj:
1678 * bindings/c/c_class.cpp:
1679 (KJS::Bindings::CClass::CClass):
1680 (KJS::Bindings::CClass::~CClass):
1681 (KJS::Bindings::CClass::classForIsA):
1682 (KJS::Bindings::CClass::methodsNamed):
1683 (KJS::Bindings::CClass::fieldNamed):
1684 * bindings/c/c_class.h:
1685 * bindings/jni/jni_class.cpp:
1686 (JavaClass::JavaClass):
1687 (JavaClass::~JavaClass):
1688 (JavaClass::methodsNamed):
1689 (JavaClass::fieldNamed):
1690 * bindings/jni/jni_class.h:
1691 * bindings/objc/objc_class.h:
1692 * bindings/objc/objc_class.mm:
1693 (KJS::Bindings::deleteMethod):
1694 (KJS::Bindings::deleteField):
1696 (KJS::Bindings::ObjcClass::methodsNamed):
1697 (KJS::Bindings::ObjcClass::fieldNamed):
1698 * bindings/runtime.cpp:
1699 * bindings/runtime.h:
1700 * bindings/runtime_object.cpp:
1701 (RuntimeObjectImp::fieldGetter):
1702 (RuntimeObjectImp::getOwnPropertySlot):
1703 (RuntimeObjectImp::put):
1704 (RuntimeObjectImp::canPut):
1706 2006-08-21 Vladimir Olexa <vladimir.olexa@gmail.com>
1710 http://bugs.webkit.org/show_bug.cgi?id=6252
1711 JavaScript 1.6 Array.lastIndexOf
1713 Test: fast/js/array-lastIndexOf.html
1715 * kjs/array_object.cpp:
1716 (ArrayProtoFunc::callAsFunction): Added a LastIndexOf case.
1717 * kjs/array_object.h:
1718 (KJS::ArrayProtoFunc::): Added LastIndexOf to enum.
1719 * tests/mozilla/expected.html: Two more tests now pass.
1721 2006-08-20 Nikolas Zimmermann <zimmermann@kde.org>
1723 Reviewed by Maciej. Landed by rwlbuis.
1725 Fixes parts of: http://bugs.webkit.org/show_bug.cgi?id=10463
1726 WebKit should have Qt platform support
1728 Removing obsolete QConstString/QString constructors in kjs code.
1733 2006-08-17 Nikolas Zimmermann <zimmermann@kde.org>
1735 Reviewed by Maciej. Landed by rwlbuis.
1737 Fixes: http://bugs.webkit.org/show_bug.cgi?id=10463
1738 WTF Changes needed for Qt platform code.
1741 * wtf/unicode/UnicodeDecomposition.h: Added.
1743 * wtf/unicode/UnicodeDirection.h: Added.
1745 * wtf/unicode/qt4/UnicodeQt4.cpp: Added.
1746 (WTF::Unicode::direction):
1747 (WTF::Unicode::category):
1748 (WTF::Unicode::decomposition):
1749 * wtf/unicode/qt4/UnicodeQt4.h:
1750 (WTF::Unicode::toLower):
1751 (WTF::Unicode::toUpper):
1752 (WTF::Unicode::isPrintableChar):
1753 (WTF::Unicode::isSpace):
1754 (WTF::Unicode::isPunct):
1755 (WTF::Unicode::isDigit):
1756 (WTF::Unicode::mirroredChar):
1757 (WTF::Unicode::compare):
1759 2006-08-17 Nikolas Zimmermann <zimmermann@kde.org>
1761 Reviewed by Eric. Landed by rwlbuis.
1763 Fixes: http://bugs.webkit.org/show_bug.cgi?id=10464
1764 Offer a cmake build system for Qt platform.
1766 * CMakeLists.txt: Added.
1767 * pcre/CMakeLists.txt: Added.
1769 2006-08-17 Anders Carlsson <acarlsson@apple.com>
1776 2006-08-15 Steve Falkenburg <sfalken@apple.com>
1782 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1785 2006-08-15 Mark Rowe <opendarwin.org@bdash.net.nz>
1789 Build fix: DWARF and -gfull are incompatible with symbol separation.
1791 * JavaScriptCore.xcodeproj/project.pbxproj:
1793 2006-08-15 Mark Rowe <opendarwin.org@bdash.net.nz>
1797 http://bugs.webkit.org/show_bug.cgi?id=10394
1798 Bug 10394: WebKit Release and Production configurations should enable dead code stripping
1800 * JavaScriptCore.xcodeproj/project.pbxproj:
1802 2006-08-15 Mark Rowe <opendarwin.org@bdash.net.nz>
1806 http://bugs.webkit.org/show_bug.cgi?id=10384
1807 Bug 10384: Switch to DWARF for Release configuration
1809 * JavaScriptCore.xcodeproj/project.pbxproj:
1811 2006-08-13 Maks Orlovich <maksim@kde.org>
1813 Reviewed (and tweaked a little) by Maciej.
1815 - shrank the size of JSObject by 8 bytes and made the corresponding reduction to the cell size, resulting
1816 in a 1.2% speed improvement on JS iBench (and probably overall memory savings).
1818 This was done by removing _scope and _internalValue data members
1819 from JSObject and moving them only to the subclasses that actually
1823 (KJS::JSObject::mark): No need to mark scope or internal value here.
1825 (KJS::JSObject::JSObject): Don't initialize them.
1826 * kjs/JSWrapperObject.cpp: Added. New base class for object types that
1827 wrap primitive values (Number, String, Boolean, Date).
1828 (KJS::JSWrapperObject::mark):
1829 * kjs/JSWrapperObject.h: Added.
1830 (KJS::JSWrapperObject::JSWrapperObject):
1831 (KJS::JSWrapperObject::internalValue):
1832 (KJS::JSWrapperObject::setInternalValue):
1833 * kjs/array_object.cpp:
1834 (ArrayPrototype::ArrayPrototype): Don't set useless internal value.
1835 * kjs/bool_object.cpp:
1836 (BooleanInstance::BooleanInstance): Inherit from JSWrapperObject.
1837 (BooleanProtoFunc::callAsFunction): Fixed to account for fact that not all
1838 JSObjects have an internal value.
1839 (BooleanObjectImp::construct): ditto.
1840 * kjs/bool_object.h:
1841 * kjs/collector.cpp: Lowered cell size to 48.
1842 (KJS::Collector::allocate): meaningless whitespace change
1843 * kjs/date_object.cpp:
1844 (KJS::DateInstance::DateInstance): Inherit from JSWrapperObject.
1845 (KJS::DateProtoFunc::callAsFunction): adjusted for move of internalValue
1846 (KJS::DateObjectImp::construct): ditto
1847 * kjs/date_object.h:
1848 * kjs/error_object.cpp:
1849 (ErrorPrototype::ErrorPrototype): don't set internal value
1850 * kjs/function.cpp: move _scope and related handling here
1851 (KJS::FunctionImp::mark): mark scope
1853 (KJS::FunctionImp::scope): moved here from JSObject
1854 (KJS::FunctionImp::setScope): ditto
1855 * kjs/number_object.cpp:
1856 (NumberInstance::NumberInstance): inherit from JSWrapperObject
1857 (NumberProtoFunc::callAsFunction): adjusted
1858 (NumberObjectImp::construct): adjusted
1859 * kjs/number_object.h: shring RegExp-related objects a little
1860 * kjs/regexp_object.cpp:
1861 (RegExpPrototype::RegExpPrototype): Adjust for size tweaks
1862 (RegExpObjectImp::RegExpObjectImp): ditto
1863 * kjs/regexp_object.h:
1864 * kjs/string_object.cpp:
1865 (StringInstance::StringInstance): inherit from JSWrapperObject
1866 (StringProtoFunc::callAsFunction): adjusted
1867 * kjs/string_object.h:
1868 * JavaScriptCore.exp: Exported new methods as needed.
1869 * JavaScriptCore.xcodeproj/project.pbxproj: Added new files to build.
1871 2006-08-04 Brady Eidson <beidson@apple.com>
1873 Reviewed by Geoff's rubber stamp
1875 Fix a build break on Intel hardware causes by adapting stricter
1876 compiler warnings (-Wshorten-64-to-32)
1879 (assertEqualsAsNumber): manually cast some doubles to floats
1882 2006-08-04 Sam Weinig <sam.weinig@gmail.com>
1886 - patch for http://bugs.webkit.org/show_bug.cgi?id=10192
1887 Make WebCore (and friends) compile with -Wshorten-64-to-32
1889 * Adds -Wshorten-64-to-32 flag to Xcode project.
1890 * Adds explicit casts where OK.
1894 (JSNodeList_getProperty):
1895 * JavaScriptCore.xcodeproj/project.pbxproj:
1897 2006-08-04 Adam Roben <aroben@apple.com>
1901 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Convert
1904 2006-08-03 Sam Weinig <sam.weinig@gmail.com>
1908 - patch for http://bugs.webkit.org/show_bug.cgi?id=10176
1909 Make WebCore compile with -Wundef
1911 * Adds -Wundef flag to Xcode project
1912 * Converts #ifs to #ifdef and #ifndefs where needed.
1913 * Added #define YYMAXDEPTH 10000 in kjs/grammar.y
1914 to fix a warning from within Bison.
1916 * JavaScriptCore.xcodeproj/project.pbxproj:
1917 * bindings/jni/jni_jsobject.cpp:
1918 (JavaJSObject::getSlot):
1919 (JavaJSObject::setSlot):
1921 * bindings/objc/objc_class.mm:
1922 (KJS::Bindings::ObjcClass::methodsNamed):
1923 (KJS::Bindings::ObjcClass::fieldNamed):
1924 * bindings/objc/objc_instance.mm:
1925 (ObjcInstance::invokeMethod):
1926 * bindings/objc/objc_runtime.mm:
1927 (ObjcMethod::getMethodSignature):
1933 2006-08-03 Anders Carlsson <acarlsson@apple.com>
1935 Reviewed by John Sullivan.
1939 Return *this in operator=
1941 2006-08-03 Adam Roben <aroben@apple.com>
1945 - Fixed Windows build
1947 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1948 * wtf/MathExtras.h: Implement inline versions of these functions
1952 2006-08-02 Adam Roben <aroben@apple.com>
1958 * kjs/date_object.cpp:
1961 2006-07-29 Darin Adler <darin@apple.com>
1963 - Removed tabs from these source files that still had them.
1964 We don't use them; that way source files look fine in editors
1965 that have tabs set to 8 spaces or to 4 spaces.
1966 - Removed allow-tabs Subversion property from the files too.
1968 * bindings/NP_jsobject.cpp:
1969 * bindings/c/c_utility.cpp:
1970 * bindings/jni/jni_runtime.cpp:
1971 * bindings/jni/jni_utility.cpp:
1972 * bindings/objc/objc_utility.mm:
1973 * bindings/runtime.cpp:
1974 * bindings/runtime_method.cpp:
1975 * bindings/testbindings.cpp:
1976 * bindings/testbindings.mm:
1977 * kjs/date_object.cpp:
1982 * kjs/string_object.cpp:
1985 2006-07-29 Darin Adler <darin@apple.com>
1987 * tests/mozilla/expected.html: Update test results now that regress-185165.js
1988 is succeeding. I suspect Anders fix for bug 4620655 is the reason.
1990 2006-07-29 Sam Weinig <sam.weinig@gmail.com>
1994 - patch for http://bugs.webkit.org/show_bug.cgi?id=10080
1995 Adopt pedantic changes from the Unity project to improve
1996 cross-compiler compatibility
1999 * Removing trailing semicolon from namespace braces.
2000 * Removing trailing comma from last enum declaration.
2001 * Updating to match style guidelines.
2002 * Adding missing newline to the end of the file.
2003 * Turning on gcc warning for missing newline at the end of a source file
2004 (GCC_WARN_ABOUT_MISSING_NEWLINE in Xcode, -Wnewline in gcc).
2005 * Alphabetical sorting of Xcode source list files.
2006 * Replace use of non-portable variable-size array with Vector.
2007 * Use C-style comments instead of C++ comments in files that might
2008 be included by either C or C++ files.
2010 * API/JSCallbackConstructor.cpp:
2011 (KJS::JSCallbackConstructor::construct):
2012 * API/JSCallbackFunction.cpp:
2013 (KJS::JSCallbackFunction::callAsFunction):
2014 * API/JSCallbackObject.cpp:
2015 (KJS::JSCallbackObject::construct):
2016 (KJS::JSCallbackObject::callAsFunction):
2017 * JavaScriptCore.xcodeproj/project.pbxproj:
2018 * JavaScriptCorePrefix.h:
2019 * bindings/jni/jni_class.cpp:
2020 (JavaClass::fieldNamed):
2021 * bindings/jni/jni_class.h:
2022 * bindings/jni/jni_instance.cpp:
2023 (JavaInstance::JavaInstance):
2024 (JavaInstance::valueOf):
2025 * bindings/jni/jni_objc.mm:
2026 (KJS::Bindings::dispatchJNICall):
2027 * bindings/jni/jni_runtime.cpp:
2028 (JavaParameter::JavaParameter):
2029 (JavaArray::JavaArray):
2030 * bindings/jni/jni_runtime.h:
2031 * bindings/jni/jni_utility.h:
2032 * bindings/objc/objc_instance.h:
2033 * bindings/runtime_array.h:
2039 2006-07-29 Mike Emmel <mike.emmel@gmail.com>
2043 - fixes for Linux build
2045 * JavaScriptCoreSources.bkl: Added new files to build, kjs/PropertyNameArray.cpp
2046 and kjs/testkjs.cpp, and removed old files.
2048 2006-07-24 Dan Waylonis <waylonis@google.com>
2050 Reviewed and tweaked a bit by Darin.
2052 - fix http://bugs.webkit.org/show_bug.cgi?id=9902
2053 jsNull and NSNull not properly converted between JS and ObjC
2055 * bindings/objc/objc_utility.mm: (KJS::Bindings::convertObjcValueToValue):
2056 Added case for converting NSNull to jsNull.
2058 2006-07-24 Rob Buis <buis@kde.org>
2062 http://bugs.webkit.org/show_bug.cgi?id=4258
2063 Date().toString() only includes GMT offset, not timezone string
2065 Use the info in tm_zone to append timezone abbreviation
2066 to Date().toString().
2068 * kjs/date_object.cpp:
2071 2006-07-24 Rob Buis <buis@kde.org>
2075 http://bugs.webkit.org/show_bug.cgi?id=5257
2076 setYear() does not match FireFox/IE behavior
2078 Make sure the right values end up in tm_year.
2080 * kjs/date_object.cpp:
2083 2006-07-23 Mark Rowe <opendarwin.org@bdash.net.nz>
2087 Bug 9686: [Drosera] Need the ability to break into Drosera on Javascript exceptions
2088 http://bugs.webkit.org/show_bug.cgi?id=9686
2090 JavaScriptCore portion of the fix.
2092 * JavaScriptCore.exp: Update symbol for change in argument type.
2094 (Debugger::detach): Clear map of recent exceptions.
2095 (Debugger::hasHandledException): Track the most recent exception
2096 thrown by an interpreter.
2097 (Debugger::exception): Change exception argument to a JSValue.
2100 (Node::debugExceptionIfNeeded): Notify the debugger of an exception
2101 if it hasn't seen it before.
2102 (ThrowNode::execute): Notify the debugger that an exception is being thrown.
2105 2006-07-23 Geoffrey Garen <ggaren@apple.com>
2107 Patch by Eric Albert, reviewed by Darin and me.
2109 - Fixed <rdar://problem/4645931> JavaScriptCore stack-scanning code
2110 crashes (Collector::markStackObjectsConservatively)
2112 * bindings/jni/jni_jsobject.cpp: On 64bit systems, jint is a long, not an
2114 (JavaJSObject::getSlot):
2115 (JavaJSObject::setSlot):
2116 * kjs/collector.cpp:
2117 (KJS::Collector::markCurrentThreadConservatively): Use a pointer instead of
2118 an int as 'dummy,' because on LP64 systems, an int is not pointer-aligned,
2119 and we want to scan the stack for pointers.
2120 * JavaScriptCore.xcodeproj/project.pbxproj: After a tense cease-fire, the
2121 XCode war has started up again!
2123 === Safari-521.20 ===
2125 2006-07-21 Geoffrey Garen <ggaren@apple.com>
2129 <rdar://problem/4507265> REGRESSION: overlays don't work on HousingMaps.com (Google Maps-based site)
2131 - Added support for strings that masquerade as undefined. Currently used
2132 by WebCore to implement undetectable style.filter.
2134 The name is a little long, but it's only used in one line of code, so I
2135 thought clarity should win over brevity.
2137 * JavaScriptCore.exp:
2138 * JavaScriptCore.xcodeproj/project.pbxproj:
2140 * kjs/string_object.h:
2141 (KJS::StringInstanceThatMasqueradesAsUndefined::StringInstanceThatMasqueradesAsUndefined):
2142 (KJS::StringInstanceThatMasqueradesAsUndefined::masqueradeAsUndefined):
2143 (KJS::StringInstanceThatMasqueradesAsUndefined::toBoolean):
2145 === Safari-521.19 ===
2147 2006-07-20 Steve Falkenburg <sfalken@apple.com>
2152 (KJS::escapeStringForPrettyPrinting):
2154 2006-07-19 Anders Carlsson <acarlsson@apple.com>
2158 <rdar://problem/4620655> REGRESSION(10.4.7-10.5): preview button for a blogger.com post doesn't work
2160 * kjs/nodes2string.cpp:
2161 (StringNode::streamTo):
2162 Return the escaped string.
2164 (RegExpNode::streamTo):
2165 Use the correct syntax.
2168 (KJS::escapeStringForPrettyPrinting):
2170 Add escape function which escapes a string for pretty-printing so it can be parsed again.
2172 * wtf/unicode/icu/UnicodeIcu.h:
2173 (WTF::Unicode::isPrintableChar):
2176 2006-07-18 Maciej Stachowiak <mjs@apple.com>
2178 Reviewed by Adele Peterson.
2180 <rdar://problem/4589530> REGRESSION: null character in JS string causes parse error (works in Tiger and in other browsers)
2186 (Lexer::scanRegExp):
2189 2006-07-18 Tim Omernick <timo@apple.com>
2191 Reviewed by Tim Hatcher.
2193 Removed a misleading comment; we recently added support for the NPNVPluginElementNPObject
2198 === Safari-521.18 ===
2200 2006-07-18 Timothy Hatcher <timothy@apple.com>
2202 Made the following headers public:
2211 * JavaScriptCore.xcodeproj/project.pbxproj:
2213 2006-07-17 Geoffrey Garen <ggaren@apple.com>
2217 - Added automatic prototype creation for classes.
2219 A class stores a weak reference to a prototype, which is cleared when
2220 the prototype is garbage collected, to avoid a reference cycle.
2222 We now have an attributes field in JSClassDefinition, that currently is
2223 used only to override automatic prototype creation when you want to manage your
2224 own prototypes, but can be extended in the future for other nefarious purposes.
2226 Similarly, we have JSObjectMake and JSObjectMakeWithPrototype, the latter
2227 allowing you to manage your own prototypes.
2229 JSObjectMakeConstructor is more interesting now, able to make a constructor
2230 on your behalf if you just give it a class.
2232 - Removed bogus old code from minidom.js.
2234 - Tweaked the headerdocs.
2236 - Added more GC testing, which caught some leaks, and tested more funny
2237 edge cases in lookup, which caught a lookup bug. Removed some testing
2238 we used to do with MyObject because it was redundant with the new, cool
2241 While fixing the lookup bug I retracted this change:
2243 "If a static setProperty callback returns 'false', to indicate that the
2244 property was not set, we no longer forward the set request up the class
2245 chain, because that's almost certainly not what the programmer expected."
2247 Returning false when setting a static property is a little silly, but you can see
2248 it being useful when shadowing a base class's static properties, and, regardless
2249 of usefullness, this is the defined behavior of the setProperty callback.
2251 - Plus a little ASCII art, for the kids.
2253 2006-07-17 Timothy Hatcher <timothy@apple.com>
2257 <rdar://problem/4634874> WebScriptObject and WebUndefined are no longer defined by WebKit
2259 Moves WebScriptObject and WebUndefined up to WebCore.
2260 This change does create an upwards-dependancy on WebScriptObject existing
2261 in the loaded process, but this code path in JavaScriptCore does not get used
2262 unless it is through WebKit/WebCore. Moving all of the binding code out of
2263 JavaScriptCore might make sense in the future.
2265 * JavaScriptCore.exp:
2266 * JavaScriptCore.xcodeproj/project.pbxproj:
2267 * bindings/objc/WebScriptObject.h: Replaced.
2268 * bindings/objc/WebScriptObject.mm: Removed.
2269 * bindings/objc/WebScriptObjectPrivate.h: Removed.
2270 * bindings/objc/objc_class.h:
2271 * bindings/objc/objc_instance.h:
2272 * bindings/objc/objc_instance.mm:
2273 (ObjcInstance::~ObjcInstance):
2274 * bindings/objc/objc_runtime.h:
2275 * bindings/objc/objc_runtime.mm:
2276 (convertValueToObjcObject):
2277 * bindings/objc/objc_utility.mm:
2278 (KJS::Bindings::convertValueToObjcValue):
2279 (KJS::Bindings::convertObjcValueToValue):
2280 (KJS::Bindings::createObjcInstanceForValue):
2282 2006-07-17 Darin Adler <darin@apple.com>
2284 * API/JSBase.h: Fix comment formatting where things used to be lined up but
2285 are now ragged. Got rid of spaces that attempted to line things up.
2286 * API/JSObjectRef.h: Ditto. Also add missing periods for a couple of comments.
2288 2006-07-17 Geoffrey Garen <ggaren@apple.com>
2292 - Removed the exception parameter from the initialize callback and, by extension,
2293 JSObjectMake. We have never had a need for exceptions when iniitializing,
2294 so the parameter seemed likely to "get in the way."
2296 Also, an exception in JavaScript is thrown in response to input --
2297 "invalid URL", "index not a number", etc., so it's the job of the
2298 constructor function, not the initialize method, to throw.
2300 If initialize *really* wants to throw, it can communicate the throw to
2301 the constructor through the constructed object's private data (e.g., set
2302 it to NULL, signaling to the consntructor that initialization failed.)
2304 - Added JSObjectMakeWithData, which enables a constructor to set private
2305 data on an object *before* it has been initialized. That way, the initialize
2306 methods can properly operate on the data.
2308 * API/JSNode.c: Moved ref into the initialize method, for better encapsulation,
2309 now that it's possible.
2310 * API/JSNodeList.c: ditto
2312 (main): Do more aggressive garbage collection to test ref/deref and
2313 initialize/finalize.
2314 * API/minidom.js: store childNodes in a temporary so it doesn't get re-created
2315 like a thousand times. This makes debugging ref/deref easier
2317 2006-07-17 Geoffrey Garen <ggaren@apple.com>
2321 - Changed the initialize callback to run from least derived class (parent
2322 class) to most derived class. This enables C++ style initialization,
2323 and derived class overriding of member data.
2325 - Added excpetion propopgation to JSObjectMake, to support initialize
2326 exceptions, and generally round out our policy of making function
2327 signatures as long as possible.
2329 * API/JSCallbackObject.h: Use ExecState instead of ContextRef, cuz we're
2332 2006-07-17 Geoffrey Garen <ggaren@apple.com>
2336 - Changed JSObjectMakeConstructor to JSObjectMakeConstructorWithCallback,
2337 to match JSObjectMakeFunctionWithCallback.
2339 - Added prototype parameter, so the generated constructor
2340 automatically works with hasInstance / instanceof
2342 - Moved hasInstance implementation from InternalFunctionImp to JSObject
2343 so that subclasses can inherit it without inheriting function-related baggage.
2344 More refactoring here would be good, but this seems like a good short-term
2347 (KJS::JSCallbackFunction::implementsHasInstance): override and return false,
2348 because callback functions aren't constructors.
2350 2006-07-17 Maciej Stachowiak <mjs@apple.com>
2354 - add a JSContextRef parameter to all JSValueRef, JSObjectRef, and JSContextRef operations;
2355 except JSObject{Get,Set}PrivateData which can be assumed to be simple pure accessors.
2357 Also renamed the parameter "context" to "ctx" because it makes the code read better with this pervasive
2358 but usually uninteresting parameter.
2362 (JSCheckScriptSyntax):
2365 * API/JSCallbackObject.cpp:
2366 (KJS::JSCallbackObject::JSCallbackObject):
2367 (KJS::JSCallbackObject::init):
2368 (KJS::JSCallbackObject::getOwnPropertySlot):
2369 (KJS::JSCallbackObject::put):
2370 (KJS::JSCallbackObject::deleteProperty):
2371 (KJS::JSCallbackObject::toNumber):
2372 (KJS::JSCallbackObject::toString):
2373 * API/JSContextRef.cpp:
2374 (JSGlobalContextCreate):
2375 (JSGlobalContextRetain):
2376 (JSGlobalContextRelease):
2377 (JSContextGetGlobalObject):
2378 * API/JSContextRef.h:
2380 (JSNodePrototype_appendChild):
2381 (JSNodePrototype_removeChild):
2382 (JSNodePrototype_replaceChild):
2383 (JSNode_getNodeType):
2384 (JSNode_getFirstChild):
2387 (JSNodeListPrototype_item):
2388 (JSNodeList_length):
2389 (JSNodeList_getProperty):
2390 (JSNodeList_prototype):
2391 * API/JSObjectRef.cpp:
2393 (JSObjectMakeFunctionWithCallback):
2394 (JSObjectMakeConstructor):
2395 (JSObjectMakeFunction):
2396 (JSObjectGetPrototype):
2397 (JSObjectSetPrototype):
2398 (JSObjectHasProperty):
2399 (JSObjectGetProperty):
2400 (JSObjectSetProperty):
2401 (JSObjectGetPropertyAtIndex):
2402 (JSObjectSetPropertyAtIndex):
2403 (JSObjectDeleteProperty):
2404 (JSObjectIsFunction):
2405 (JSObjectCallAsFunction):
2406 (JSObjectIsConstructor):
2407 (JSObjectCallAsConstructor):
2408 (JSObjectCopyPropertyNames):
2409 * API/JSObjectRef.h:
2410 * API/JSStringRef.cpp:
2411 * API/JSValueRef.cpp:
2413 (JSValueIsUndefined):
2419 (JSValueIsObjectOfClass):
2421 (JSValueIsStrictEqual):
2422 (JSValueIsInstanceOfConstructor):
2423 (JSValueMakeUndefined):
2425 (JSValueMakeBoolean):
2426 (JSValueMakeNumber):
2427 (JSValueMakeString):
2430 (JSValueToStringCopy):
2438 (MyObject_getProperty):
2439 (MyObject_deleteProperty):
2440 (MyObject_callAsFunction):
2441 (MyObject_callAsConstructor):
2442 (MyObject_convertToType):
2443 (print_callAsFunction):
2446 2006-07-16 Geoffrey Garen <ggaren@apple.com>
2448 Approved by Maciej, RS by Beth.
2450 JSObjectMakeFunction -> JSObjectMakeFunctionWithCallback
2451 JSObjectMakeFunctionWithBody -> JSObjectMakeFunction
2453 because the latter is more common, and more fundamental, than the former.
2458 * API/JSCallbackObject.cpp:
2459 (KJS::JSCallbackObject::getOwnPropertySlot):
2460 (KJS::JSCallbackObject::put):
2461 (KJS::JSCallbackObject::deleteProperty):
2462 (KJS::JSCallbackObject::getPropertyNames):
2463 (KJS::JSCallbackObject::staticValueGetter):
2464 (KJS::JSCallbackObject::staticFunctionGetter):
2465 * API/JSClassRef.cpp:
2466 (OpaqueJSClass::OpaqueJSClass):
2467 (OpaqueJSClass::~OpaqueJSClass):
2469 * API/JSObjectRef.cpp:
2471 (JSObjectMakeFunctionWithCallback):
2472 (JSObjectMakeFunction):
2473 (OpaqueJSPropertyNameArray::OpaqueJSPropertyNameArray):
2474 (JSObjectCopyPropertyNames):
2475 * API/JSObjectRef.h:
2481 * JavaScriptCore.exp:
2483 2006-07-16 Geoffrey Garen <ggaren@apple.com>
2487 Replace __JS with OpaqueJS because the former, while used by CF, is
2488 a prefix that's triply-reserved by the compiler. (_* is reserved in global
2489 names, _[A-Z] is reserved in all names, and __ is reserved in all names
2492 Opaque is an alternative used by other Mac OS X framewokrs.
2497 * API/JSCallbackObject.cpp:
2498 (KJS::JSCallbackObject::getOwnPropertySlot):
2499 (KJS::JSCallbackObject::put):
2500 (KJS::JSCallbackObject::deleteProperty):
2501 (KJS::JSCallbackObject::getPropertyNames):
2502 (KJS::JSCallbackObject::staticValueGetter):
2503 (KJS::JSCallbackObject::staticFunctionGetter):
2504 * API/JSClassRef.cpp:
2505 (OpaqueJSClass::OpaqueJSClass):
2506 (OpaqueJSClass::~OpaqueJSClass):
2508 * API/JSObjectRef.cpp:
2510 (OpaqueJSPropertyNameArray::OpaqueJSPropertyNameArray):
2511 (JSObjectCopyPropertyNames):
2513 2006-07-16 Darin Adler <darin@apple.com>
2515 - try to fix Windows build
2517 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2518 Added some recently added files, removed some recently removed.
2520 2006-07-16 Geoffrey Garen <ggaren@apple.com>
2524 - Change getProperty* to return undefined, rather than NULL, for missing
2525 properties, since that's what the spec says. Also added exception out
2526 parameters to the *Index functions, because they can call through to the
2527 regular functions, which can throw for custom objects.
2529 * API/JSObjectRef.cpp:
2530 (JSObjectGetProperty):
2531 (JSObjectGetPropertyAtIndex):
2532 (JSObjectSetPropertyAtIndex):
2533 * API/JSObjectRef.h:
2537 2006-07-16 Geoffrey Garen <ggaren@apple.com>
2541 - Properly document and handle NULL callbacks for static properties. We
2542 throw an exception in any case other than a ReadOnly property with a NULL
2543 setProperty callback, because a NULL callback almost certainly indicates
2544 a programming error. Also throw an exception if hasProperty returns true
2545 for a property that getProperty can't get.
2547 - If a static setProperty callback returns 'false', to indicate that the
2548 property was not set, we no longer forward the set request up the class
2549 chain, because that's almost certainly not what the programmer expected.
2551 * API/JSCallbackObject.cpp:
2552 (KJS::JSCallbackObject::getOwnPropertySlot):
2553 (KJS::JSCallbackObject::put):
2554 (KJS::JSCallbackObject::staticValueGetter):
2555 (KJS::JSCallbackObject::staticFunctionGetter):
2556 (KJS::JSCallbackObject::callbackGetter):
2557 * API/JSObjectRef.h:
2560 (MyObject_hasProperty):
2563 2006-07-16 Geoffrey Garen <ggaren@apple.com>
2567 - Added names to functions.
2569 - Removed GetPrivate/SetPrivate from callbackFunctions and callbackConstructors.
2570 The private data idiom is that a JS object stores its native implementation
2571 as private data. For functions and constructors, the native implementation is nothing
2572 more than the callback they already store, so supporting private data, too,
2573 confuses the idiom. If you *really* want, you can still create a custom
2574 function with private data.
2576 * API/JSCallbackConstructor.cpp:
2577 * API/JSCallbackConstructor.h:
2578 * API/JSCallbackFunction.cpp:
2579 (KJS::JSCallbackFunction::JSCallbackFunction):
2580 * API/JSCallbackFunction.h:
2581 * API/JSCallbackObject.cpp:
2582 (KJS::JSCallbackObject::staticFunctionGetter):
2583 * API/JSObjectRef.cpp:
2584 (JSObjectMakeFunction):
2585 (JSObjectMakeFunctionWithBody):
2586 (JSObjectGetPrivate):
2587 (JSObjectSetPrivate):
2588 * API/JSObjectRef.h:
2594 2006-07-15 Maciej Stachowiak <mjs@apple.com>
2598 - switch property lists to be vector+set of Identifiers instead of list of References
2600 This has the following benefits:
2602 - no duplicates in property lists
2603 - simplifies API calls
2604 - probably more efficient, since linked list is gone
2605 - entirely removed Reference, ReferenceList and ProtectedReference types from the API
2607 * kjs/PropertyNameArray.cpp: Added.
2608 (KJS::PropertyNameArray::add): Check set, if not already there, add to
2610 * kjs/PropertyNameArray.h: Added.
2611 (KJS::PropertyNameArray::PropertyNameArray): Newly added type, combines
2612 a set and a vector to make a unique but ordered list of identifiers.
2613 (KJS::PropertyNameArray::begin): ditto
2614 (KJS::PropertyNameArray::end): ditto
2615 (KJS::PropertyNameArray::size): ditto
2616 (KJS::PropertyNameArray::operator[]): ditto
2617 * kjs/array_instance.h:
2618 * kjs/array_object.cpp:
2619 (ArrayInstance::getPropertyNames): renamed from getPropertyList, updated
2620 for PropertyNameArray
2621 (ArrayInstance::setLength): updated for PropertyNameArray
2622 (ArrayInstance::pushUndefinedObjectsToEnd): ditto
2624 (ForInNode::execute): updated for PropertyNameArray
2627 (KJS::JSObject::getPropertyNames): renamed from getPropertyList, updated
2628 for PropertyNameArray
2630 * kjs/property_map.cpp:
2631 (KJS::PropertyMap::getEnumerablePropertyNames): updated for PropertyNameArray
2632 (KJS::PropertyMap::getSparseArrayPropertyNames): ditto
2633 * kjs/property_map.h:
2634 * kjs/protected_reference.h: Removed.
2635 * kjs/reference.cpp: Removed.
2636 * kjs/reference.h: Removed.
2637 * kjs/reference_list.cpp: Removed.
2638 * kjs/reference_list.h: Removed.
2639 * kjs/scope_chain.cpp:
2640 (KJS::ScopeChain::print): Use PropertyNamesArray instead of ReferenceList.
2641 * kjs/string_object.cpp:
2642 (StringInstance::getPropertyNames): Updated for new approach.
2643 * kjs/string_object.h:
2646 (toJS): Added overload for PropertyNameAccumulatorRef / PropertyNameArray*
2649 * API/JSCallbackObject.cpp:
2650 (KJS::JSCallbackObject::getPropertyNames): Fixed for new API.
2651 * API/JSCallbackObject.h:
2652 * API/JSObjectRef.cpp:
2653 (__JSPropertyNameArray::__JSPropertyNameArray): Type used for a publicly vended
2654 JSPropertyNameArrayRef.
2655 (JSObjectCopyPropertyNames): New API call - renamed / refactored from
2656 JSObjectCreatePropertyList
2657 (JSPropertyNameArrayRetain): new retain call for JSPropertyNameArray.
2658 (JSPropertyNameArrayRelease): new release call for - " -.
2659 (JSPropertyNameArrayGetCount): Instead of having to use a stateful enumerator you
2660 can now get the count and items in any order.
2661 (JSPropertyNameArrayGetNameAtIndex): See above.
2662 (JSPropertyNameAccumulatorAddName): What you add properties to is now an opaque
2664 * API/JSObjectRef.h: Prototyped new functions, removed old ones
2665 * JavaScriptCore.exp: Updated exported symbols.
2666 * JavaScriptCore.xcodeproj/project.pbxproj: Added new files, removed old.
2668 (MyObject_getPropertyNames): Renamed / fixed callback to fit new paradigm.
2669 (main): Updated for new API.
2671 2006-07-15 Darin Adler <darin@apple.com>
2673 - oops, missed a few more arrays that had to be const
2676 (JSNodePrototype_appendChild): Added const.
2677 (JSNodePrototype_removeChild): Ditto.
2678 (JSNodePrototype_replaceChild): Ditto.
2679 (JSNode_construct): Ditto.
2681 (JSNodeListPrototype_item): Ditto.
2682 * API/JSObjectRef.cpp:
2683 (JSObjectMakeFunctionWithBody): Ditto.
2684 (JSObjectCallAsFunction): Ditto.
2685 (JSObjectCallAsConstructor): Ditto.
2689 (MyObject_callAsFunction): Ditto.
2690 (MyObject_callAsConstructor): Ditto.
2691 (print_callAsFunction): Ditto.
2692 (myConstructor_callAsConstructor): Ditto.
2694 2006-07-15 Darin Adler <darin@apple.com>
2698 * API/JSNode.h: Made an array parameter const.
2699 * API/JSObjectRef.h: Made array parameters const. Fixed a comment.
2701 2006-07-15 Geoffrey Garen <ggaren@apple.com>
2705 - JSObjectMakeFunctionWithBody includes a function name and named parameters now.
2707 * API/JSObjectRef.cpp:
2708 (JSObjectMakeFunctionWithBody):
2709 * API/JSObjectRef.h:
2711 (assertEqualsAsUTF8String): More informative failure reporting.
2712 (main): Test more function cases.
2714 2006-07-15 Geoffrey Garen <ggaren@apple.com>
2718 - Moved the arguments passed to JSClassCreate into a single structure,
2719 called JSClassDefinition. This will enable easier structure
2720 migration/versioning in the future, if necessary.
2722 - Added support for class names.
2724 - kJSClassDefinitionNull replaces kJSObjectCallbacksNone.
2726 - JSClass is becoming a fairly complex struct, so I migrated all of its
2727 implementation other than reference counting to the sruct.
2729 - Also moved JSClass* functions in the API to JSObjectRef.cpp, since they're
2730 declared in JSObjectRef.h
2732 - Also added some more informative explanation to the class structure doc.
2734 2006-07-15 Darin Adler <darin@apple.com>
2738 - fix http://bugs.webkit.org/show_bug.cgi?id=8395
2739 <rdar://problem/4613467>
2740 REGRESSION: RegEx seems broken for hex escaped non breaking space
2742 Test: fast/js/regexp-extended-characters-more.html
2745 (match): Got rid of utf16Length local variable to guarantee there's no
2746 extra stack usage in recursive calls. Fixed two places in the PCRE_UTF16
2747 code that were using the length variable, which is the UTF-8 length of
2748 a character in the pattern, to move in the UTF-16 subject string. Instead
2749 they hardcode lengths of 1 and 2 since the code already handles BMP
2750 characters and surrogate pairs separately. Also fixed some DPRINTF so
2751 I could compile with DEBUG on.
2752 (pcre_exec): Changed a place that was checking for multibyte characters
2753 in the subject string to use ISMIDCHAR. Instead it was using hardcoded
2754 logic that was right for UTF-8 but wrong for UTF-16.
2756 * pcre/pcre_compile.c: (pcre_compile2): Fixed a DPRINTF so I could compile
2759 2006-07-14 Geoffrey Garen <ggaren@apple.com>
2763 Global replace in the API of argc/argv with argumentCount/arguments.
2765 2006-07-14 Geoffrey Garen <ggaren@apple.com>
2769 - Finalized exception handling in the API.
2771 setProperty can throw because it throws for built-in arrays. getProperty
2772 and deleteProperty can throw because setProperty can throw and we want
2773 to be consistent, and also because they seem like "actions." callAsFunction,
2774 callAsConstructor, and hasInstance can throw, because they caan throw for
2777 toBoolean can't throw because it's defined that way in the spec.
2779 - Documented that toBoolean and toObject can't be overridden by custom
2780 objects because they're defined that way in the spec.
2782 === Safari-521.17 ===
2784 2006-07-14 Geoffrey Garen <ggaren@apple.com>
2788 - Implemented ref-counting of JSContexts by splitting into two datatypes:
2789 JSGlobalContext, which you can create/retain/release, and JSContext, which
2792 Internally, you retain a JSGlobalContext/ExecState by retaining its
2793 interpreter, which, in the case of a global ExecState, owns it.
2795 - Also made ~Interpreter() protected to catch places where Interpreter
2796 is manually deleted. (Can't make it private because some crazy fool
2797 decided it would be a good idea to subclass Interpreter in other frameworks.
2801 (toJS): Added cast for new JSGlobalContext
2802 * API/JSStringRef.h: Changed vague "you must" language to more specific
2803 (but, ultimately, equally vague) "behavior is undefined if you don't"
2805 (KJS::Interpreter::Interpreter): Factored more common initialization into
2807 * kjs/interpreter.h:
2808 (KJS::Interpreter::ref): new
2809 (KJS::Interpreter::deref): new
2810 (KJS::Interpreter::refCount): new
2812 (doIt): Ref-count the interpreter.
2814 2006-07-14 Maciej Stachowiak <mjs@apple.com>
2818 - removed bool return value from JSObjectSetProperty, since it is inefficient and
2819 also doesn't work quite right
2820 - added JSObjectGetPropertyAtIndex and JSObjectSetPropertyAtIndex
2822 * API/JSObjectRef.cpp:
2823 (JSObjectSetProperty): Removed return value and canPut stuff.
2824 (JSObjectGetPropertyAtIndex): Added.
2825 (JSObjectSetPropertyAtIndex): Added.
2826 * API/JSObjectRef.h: Prototyped and documented new functions.
2828 2006-07-14 Geoffrey Garen <ggaren@apple.com>
2832 Moved JSCheckScriptSyntax, JSEvaluateScript, and JSGarbageCollect into
2833 JSBase.h/.cpp. They don't belong in the value-specific or context-specific
2834 files because they're not part of the value or context implementations.
2837 * API/JSContextRef.cpp:
2838 (JSContextGetGlobalObject):
2839 * API/JSContextRef.h:
2840 * API/JSValueRef.cpp:
2843 * JavaScriptCore.xcodeproj/project.pbxproj:
2845 2006-07-13 Timothy Hatcher <timothy@apple.com>
2849 Moved JavaScriptCore to be a public framework.
2851 * JavaScriptCore.xcodeproj/project.pbxproj:
2853 2006-07-13 Mark Rowe <opendarwin.org@bdash.net.nz>
2855 Reviewed by Geoffrey.
2857 http://bugs.webkit.org/show_bug.cgi?id=9742
2858 Bug 9742: REGRESSION: WebKit hangs when loading <http://www.vtbook.com>
2861 (KJS::JSValue::getUInt32): Only types tagged as numeric can be converted to UInt32.
2863 2006-07-13 Geoffrey Garen <ggaren@apple.com>
2867 - Renamed JSEvaluate -> JSEvaluateScript, JSCheckSyntax -> JSCheckScriptSyntax
2868 - Added exception out parameters to JSValueTo* and JSValueIsEqual because
2870 - Removed JSObjectGetDescription because it's useless and vague, and
2871 JSValueToString/JSValueIsObjectOfClass do a better job, anyway
2872 - Clarified comments about "IsFunction/Constructor" to indicate that they
2873 are true of all functions/constructors, not just those created by JSObjectMake*
2875 2006-07-12 Geoffrey Garen <ggaren@apple.com>
2879 Finished previously approved JSInternalString -> JSString conversion
2880 by renaming the files.
2882 * API/JSCallbackObject.cpp:
2883 * API/JSInternalStringRef.cpp: Removed.
2884 * API/JSInternalStringRef.h: Removed.
2885 * API/JSStringRef.cpp: Added.
2886 * API/JSStringRef.h: Added.
2887 * API/JavaScriptCore.h:
2888 * JavaScriptCore.xcodeproj/project.pbxproj:
2890 2006-07-12 Geoffrey Garen <ggaren@apple.com>
2894 - Removed context and exception parameters from JSObjectGetPropertyEnumerator,
2895 removing the spurious use of ExecState inside JavaScriptCore that made
2896 us think this was necessary in the first place.
2898 (StringInstance::getPropertyList): Use getString instead of toString because
2899 we know we're dealing with a string -- we put it there in the first place.
2900 While we're at it, store the string's size instead of retrieving it each time
2901 through the loop, to avoid the unnecessary killing of puppies.
2902 * kjs/string_object.h:
2904 2006-07-12 Maciej Stachowiak <mjs@apple.com>
2908 - add handling of hasInstance callback for API objects
2910 * API/JSCallbackObject.cpp:
2911 (KJS::JSCallbackObject::implementsHasInstance): Check if callback is present.
2912 (KJS::JSCallbackObject::hasInstance): Invoke appropriate callback.
2913 * API/JSCallbackObject.h:
2914 * API/JSClassRef.cpp:
2915 * API/JSObjectRef.h:
2917 (MyObject_hasInstance): Test case; should match what construct would do.
2920 2006-07-11 Geoffrey Garen <ggaren@apple.com>
2924 - Implemented a vast number of renames and comment clarifications
2925 suggested during API review.
2927 JSInternalString -> JSString
2928 JS*Make -> JSValueMake*, JSObjectMake*
2929 JSTypeCode -> JSType
2930 JSValueIsInstanceOf -> JSValueIsInstanceOfConstructor (reads strangely well in client code)
2931 JSGC*Protect -> JSValue*Protect
2932 JS*Callback -> JSObject*Callback
2933 JSGetPropertyListCallback -> JSObjectAddPropertiesToListCallback
2934 JSPropertyEnumeratorGetNext -> JSPropertyEnumeratorGetNextName
2936 JSStringCreateWithUTF8CString, JSStringGetUTF8CString,
2937 JSStringGetMaximumUTF8CStringSize JSStringIsEqualToUTF8CString,
2938 JSStringCreateWithCFString, JSStringCopyCFString, JSStringCreateWithCharacters.
2940 - Changed functions taking a JSValue out arg and returning a bool indicating
2941 whether it was set to simply return a JSValue or NULL.
2943 - Removed JSStringGetCharacters because it's more documentation than code,
2944 and it's just a glorified memcpy built on existing API functionality.
2946 - Moved standard library includes into the headers that actually require them.
2948 - Standardized use of the phrase "Create Rule."
2950 - Removed JSLock from make functions that don't allocate.
2952 - Added exception handling to JSValueToBoolean, since we now allow
2953 callback objects to throw exceptions upon converting to boolean.
2955 - Renamed JSGCCollect to JSGarbageCollect.
2957 2006-07-10 Geoffrey Garen <ggaren@apple.com>
2961 - Changed public header includes to the <JavaScriptCore/ style.
2962 - Changed instances of 'buffer' to 'string' since we decided on
2963 JSInternalString instead of JSStringBuffer.
2965 * API/JSContextRef.h:
2966 * API/JSInternalStringRef.cpp:
2968 (JSInternalStringRetain):
2969 (JSInternalStringRelease):
2970 (JSValueCopyStringValue):
2971 (JSInternalStringGetLength):
2972 (JSInternalStringGetCharactersPtr):
2973 (JSInternalStringGetCharacters):
2974 (JSInternalStringGetMaxLengthUTF8):
2975 (JSInternalStringGetCharactersUTF8):
2976 (CFStringCreateWithJSInternalString):
2977 * API/JSInternalStringRef.h:
2979 (JSNodePrototype_appendChild):
2980 (JSNode_getNodeType):
2981 * API/JSObjectRef.cpp:
2982 (JSObjectCallAsConstructor):
2984 * API/JavaScriptCore.h:
2989 (MyObject_getPropertyList):
2990 (myConstructor_callAsConstructor):
2991 (main): I noticed that we were prematurely releasing some string buffers,
2992 so I moved their release calls to the end of main(). I got rid of 'Buf' in *Buf
2993 (sometimes changing to 'IString', when necessary to differentiate a variable)
2994 to match the buffer->string change.
2996 === Safari-521.16 ===
2998 2006-07-10 Darin Adler <darin@apple.com>
3000 * kjs/value.cpp: (KJS::JSValue::toInt32Inline): Added inline keyword one more place.
3003 2006-07-10 Darin Adler <darin@apple.com>
3005 - fix the release build
3009 (KJS::JSValue::toInt32Inline): Move the code here to an inline.
3010 (KJS::JSValue::toInt32): Call the inline from both overloaded toInt32 functions.
3012 2006-07-10 David Kilzer <ddkilzer@kilzer.net>
3016 - fix http://bugs.webkit.org/show_bug.cgi?id=9179
3017 Implement select.options.add() method
3019 * JavaScriptCore.exp: Added overloaded KJS::JSValue::toInt32() method.
3020 * JavaScriptCore.xcodeproj/project.pbxproj: Altered attributes metadata for
3021 kjs/value.h to make it available as a forwarded header.
3023 (KJS::lookupPut): Extracted a lookupPut() method from the existing lookupPut() method.
3024 The new method returns a boolean value if no entry is found in the lookup table.
3026 (KJS::JSValue::toInt32): Overloaded toInt32() method with boolean "Ok" argument.
3027 * kjs/value.h: Ditto.
3029 2006-07-10 Geoffrey Garen <ggaren@apple.com>
3031 No review necessary. Removed bogus file I accidentally checked in before.
3033 * API/JSInternalSringRef.h: Removed.
3035 2006-07-10 Geoffrey Garen <ggaren@apple.com>
3039 Added exception out parameter to API object callbacks, removed semi-bogus
3040 JSContext(.*)Exception functions.
3042 To make these calls syntactically simple, I added an exceptionSlot()
3043 method to the ExecState class, which provides a JSValue** slot in which to
3044 store a JSValue* exception.
3048 * API/JSCallbackConstructor.cpp:
3049 (KJS::JSCallbackConstructor::construct):
3050 * API/JSCallbackFunction.cpp:
3051 (KJS::JSCallbackFunction::callAsFunction):
3052 * API/JSCallbackObject.cpp:
3053 (KJS::JSCallbackObject::init):
3054 (KJS::JSCallbackObject::getOwnPropertySlot):
3055 (KJS::JSCallbackObject::put):
3056 (KJS::JSCallbackObject::deleteProperty):
3057 (KJS::JSCallbackObject::construct):
3058 (KJS::JSCallbackObject::callAsFunction):
3059 (KJS::JSCallbackObject::getPropertyList):
3060 (KJS::JSCallbackObject::toBoolean):
3061 (KJS::JSCallbackObject::toNumber):
3062 (KJS::JSCallbackObject::toString):
3063 (KJS::JSCallbackObject::staticValueGetter):
3064 (KJS::JSCallbackObject::callbackGetter):
3065 * API/JSContextRef.cpp:
3067 * API/JSContextRef.h:
3069 (JSNodePrototype_appendChild):
3070 (JSNodePrototype_removeChild):
3071 (JSNodePrototype_replaceChild):
3072 (JSNode_getNodeType):
3073 (JSNode_getChildNodes):
3074 (JSNode_getFirstChild):
3078 (JSNodeListPrototype_item):
3079 (JSNodeList_length):
3080 (JSNodeList_getProperty):
3081 * API/JSObjectRef.h:
3085 (MyObject_initialize):
3086 (MyObject_hasProperty):
3087 (MyObject_getProperty):
3088 (MyObject_setProperty):
3089 (MyObject_deleteProperty):
3090 (MyObject_getPropertyList):
3091 (MyObject_callAsFunction):
3092 (MyObject_callAsConstructor):
3093 (MyObject_convertToType):
3094 (print_callAsFunction):
3095 (myConstructor_callAsConstructor):
3097 * JavaScriptCore.exp:
3099 (KJS::ExecState::exceptionHandle):
3101 2006-07-10 Geoffrey Garen <ggaren@apple.com>
3105 Improved type safety by implementing opaque JSValue/JSObject typing through
3106 abuse of 'const', not void*. Also fixed an alarming number of bugs
3107 exposed by this new type safety.
3109 I made one design change in JavaScriptCore, which is that the JSObject
3110 constructor should take a JSValue* as its prototype argument, not a JSObject*,
3111 since we allow the prototype to be any JSValue*, including jsNull(), for
3117 * API/JSCallbackConstructor.cpp:
3118 (KJS::JSCallbackConstructor::construct):
3119 * API/JSCallbackFunction.cpp:
3120 (KJS::JSCallbackFunction::callAsFunction):
3121 * API/JSCallbackObject.cpp:
3122 (KJS::JSCallbackObject::JSCallbackObject):
3123 (KJS::JSCallbackObject::getOwnPropertySlot):
3124 (KJS::JSCallbackObject::put):
3125 (KJS::JSCallbackObject::construct):
3126 (KJS::JSCallbackObject::callAsFunction):
3127 (KJS::JSCallbackObject::staticFunctionGetter):
3128 * API/JSCallbackObject.h:
3129 * API/JSContextRef.cpp:
3132 (JSNodePrototype_appendChild):
3133 (JSNodePrototype_removeChild):
3134 (JSNodePrototype_replaceChild):
3135 * API/JSObjectRef.cpp:
3137 (JSFunctionMakeWithBody):
3138 (JSObjectGetProperty):
3139 (JSObjectCallAsFunction):
3140 (JSObjectCallAsConstructor):
3141 * API/JSObjectRef.h:
3146 (KJS::JSObject::JSObject):
3148 2006-07-10 Geoffrey Garen <ggaren@apple.com>
3150 Approved by Maciej, Darin.
3152 Renamed JSStringBufferRef to JSInternalStringRef. "Internal string" means the
3153 JavaScript engine's internal string representation, which is the most
3154 low-level and efficient representation to use when interfacing with JavaScript.
3160 * API/JSCallbackObject.cpp:
3161 (KJS::JSCallbackObject::getOwnPropertySlot):
3162 (KJS::JSCallbackObject::put):
3163 (KJS::JSCallbackObject::deleteProperty):
3164 (KJS::JSCallbackObject::staticValueGetter):
3165 (KJS::JSCallbackObject::callbackGetter):
3166 * API/JSContextRef.cpp:
3169 * API/JSContextRef.h:
3170 * API/JSInternalStringRef.cpp: Added.
3172 (JSInternalStringCreate):
3173 (JSInternalStringCreateUTF8):
3174 (JSInternalStringRetain):
3175 (JSInternalStringRelease):
3176 (JSValueCopyStringValue):
3177 (JSInternalStringGetLength):
3178 (JSInternalStringGetCharactersPtr):
3179 (JSInternalStringGetCharacters):
3180 (JSInternalStringGetMaxLengthUTF8):
3181 (JSInternalStringGetCharactersUTF8):
3182 (JSInternalStringIsEqual):
3183 (JSInternalStringIsEqualUTF8):
3184 (JSInternalStringCreateCF):
3185 (CFStringCreateWithJSInternalString):
3186 * API/JSInternalStringRef.h: Added.
3188 (JSNodePrototype_appendChild):
3189 (JSNode_getNodeType):
3190 (JSNode_getChildNodes):
3191 (JSNode_getFirstChild):
3193 (JSNodeList_length):
3194 (JSNodeList_getProperty):
3195 * API/JSObjectRef.cpp:
3196 (JSFunctionMakeWithBody):
3197 (JSObjectGetDescription):
3198 (JSObjectHasProperty):
3199 (JSObjectGetProperty):
3200 (JSObjectSetProperty):
3201 (JSObjectDeleteProperty):
3202 (JSPropertyEnumeratorGetNext):
3203 (JSPropertyListAdd):
3204 * API/JSObjectRef.h:
3205 * API/JSStringBufferRef.cpp: Removed.
3206 * API/JSStringBufferRef.h: Removed.
3208 * API/JavaScriptCore.h:
3213 (assertEqualsAsUTF8String):
3214 (assertEqualsAsCharactersPtr):
3215 (assertEqualsAsCharacters):
3216 (MyObject_hasProperty):
3217 (MyObject_getProperty):
3218 (MyObject_setProperty):
3219 (MyObject_deleteProperty):
3220 (MyObject_getPropertyList):
3221 (print_callAsFunction):
3222 (myConstructor_callAsConstructor):
3224 * JavaScriptCore.exp:
3225 * JavaScriptCore.xcodeproj/project.pbxproj:
3227 2006-07-08 Tim Omernick <timo@apple.com>
3231 Added an OpenGL drawing model to the Netscape Plug-in API.
3235 2006-07-08 Timothy Hatcher <timothy@apple.com>
3239 Moved KJS_GetCreatedJavaVMs to jni_utility.cpp.
3240 Switched KJS_GetCreatedJavaVMs over to use dlopen and dlsym
3241 now that NSAddImage, NSLookupSymbolInImage and NSAddressOfSymbol
3242 are deprecated in Leopard.
3244 * JavaScriptCore.exp:
3245 * JavaScriptCore.xcodeproj/project.pbxproj:
3246 * bindings/jni/jni_utility.cpp:
3247 (KJS::Bindings::KJS_GetCreatedJavaVMs):
3248 * bindings/softlinking.c: Removed.
3249 * bindings/softlinking.h: Removed.
3251 2006-07-08 Geoffrey Garen <ggaren@apple.com>
3255 - Make JSObjectGetProperty return a JSValue or NULL, like JSEvaluate does.
3257 * API/JSObjectRef.cpp:
3258 (JSObjectGetProperty):
3259 * API/JSObjectRef.h:
3263 2006-07-08 Geoffrey Garen <ggaren@apple.com>
3265 Style change -- no review necessary.
3267 Use 0 instead of NULL in API .cpp files, to match our style guidelines.
3269 * API/JSContextRef.cpp:
3271 * API/JSObjectRef.cpp:
3272 (JSFunctionMakeWithBody):
3273 (JSObjectCallAsFunction):
3274 (JSObjectCallAsConstructor):
3275 * API/JSValueRef.cpp:
3278 2006-07-08 Geoffrey Garen <ggaren@apple.com>
3282 - Added ability to pass NULL for thisObject when calling JSObjectCallAsFunction,
3283 to match JSEvaluate.
3285 * API/JSObjectRef.cpp:
3286 (JSObjectCallAsFunction):
3287 * API/JSObjectRef.h:
3291 === Safari-521.15 ===
3293 2006-07-07 Geoffrey Garen <ggaren@apple.com>
3297 - Standardized which functions take a JSContext as an argument. The rule is:
3298 if you might execute JavaScript, you take a JSContext, otherwise you don't.
3300 The FIXME in JSObjectRef.h requires refactoring some parts of Interpreter,
3301 but not API changes, so I'm putting it off until later.
3303 * API/JSCallbackObject.cpp:
3304 (KJS::JSCallbackObject::JSCallbackObject):
3305 (KJS::JSCallbackObject::init):
3306 * API/JSCallbackObject.h:
3307 * API/JSContextRef.cpp:
3309 * API/JSContextRef.h:
3310 * API/JSObjectRef.cpp:
3312 (JSPropertyEnumeratorGetNext):
3313 * API/JSObjectRef.h:
3315 (MyObject_initialize):
3317 * JavaScriptCore.exp:
3318 * kjs/array_object.cpp:
3319 (ArrayInstance::setLength):
3320 (ArrayInstance::pushUndefinedObjectsToEnd):
3322 (ForInNode::execute):
3323 * kjs/reference.cpp:
3324 (KJS::Reference::getPropertyName):
3325 (KJS::Reference::getValue):
3327 * kjs/scope_chain.cpp:
3328 (KJS::ScopeChain::print):
3330 2006-07-06 Geoffrey Garen <ggaren@apple.com>
3336 - Headerdoc finished
3339 - Added a JSContextRef argument to many functions, because you need a
3340 JSContextRef for doing virtually anything. I expect to add this argument
3341 to even more functions in a future patch.
3343 - Removed the globalObjectPrototype argument to JSContextCreate because
3344 you can't create an object until you have a context, so it's impossible
3345 to pass a prototype object to JSContextCreate. That's OK because (1) there's
3346 no reason to give the global object a prototype and (2) if you really want
3347 to, you can just use a separate call to JSObjectSetPrototype.
3349 - Removed the JSClassRef argument to JSClassCreate because it was unnecessary,
3350 and you need to be able to make the global object's class before you've
3351 created a JSContext.
3353 - Added an optional exception parameter to JSFunctionMakeWithBody because anything
3354 less would be uncivilized.
3356 - Made the return value parameter to JSObjectGetProperty optional to match
3357 all other return value parameters in the API.
3359 - Made JSObjectSetPrivate/JSObjectGetPrivate work on JSCallbackFunctions
3360 and JSCallbackConstructors. You could use an abstract base class or strategic
3361 placement of m_privateData in the class structure to implement this, but
3362 the former seemed like overkill, and the latter seemed too dangerous.
3364 - Fixed a bug where JSPropertyEnumeratorGetNext would skip the first property.
3367 - Reversed the logic of the JSChar #ifdef to avoid confusing headerdoc
3369 - Removed function names from @function declarations because headeroc
3370 can parse them automatically, and I wanted to rule out manual mismatch.
3372 - Changed Error::create to take a const UString& instead of a UString*
3373 because it was looking at me funny.
3375 - Renamed JSStringBufferCreateWithCFString to JSStringBufferCreateCF
3376 because the latter is more concise and it matches JSStringBufferCreateUTF8.
3378 * API/JSCallbackObject.cpp:
3379 (KJS::JSCallbackObject::getOwnPropertySlot):
3380 (KJS::JSCallbackObject::put):
3381 (KJS::JSCallbackObject::deleteProperty):
3382 (KJS::JSCallbackObject::getPropertyList):
3383 (KJS::JSCallbackObject::toBoolean):
3384 (KJS::JSCallbackObject::toNumber):
3385 (KJS::JSCallbackObject::toString):
3386 * API/JSClassRef.cpp:
3388 * API/JSContextRef.cpp:
3390 (JSContextSetException):
3391 * API/JSContextRef.h:
3393 (JSNodePrototype_class):
3396 (JSNodeListPrototype_class):
3398 * API/JSObjectRef.cpp:
3399 (JSObjectGetProperty):
3400 (JSObjectGetPrivate):
3401 (JSObjectSetPrivate):
3402 (JSObjectCallAsFunction):
3403 (JSObjectCallAsConstructor):
3404 (JSPropertyEnumeratorGetNext):
3405 * API/JSObjectRef.h:
3406 * API/JSStringBufferRef.cpp:
3407 (JSStringBufferCreateCF):
3408 * API/JSStringBufferRef.h:
3409 * API/JSValueRef.cpp:
3410 (JSValueIsInstanceOf):
3416 (MyObject_hasProperty):
3417 (MyObject_setProperty):
3418 (MyObject_deleteProperty):
3419 (MyObject_getPropertyList):
3420 (MyObject_convertToType):
3423 * JavaScriptCore.exp:
3425 2006-07-07 Geoffrey Garen <ggaren@apple.com>
3429 - Fixed a few crashes resulting from NULL parameters to JSClassCreate.
3431 * API/JSClassRef.cpp:
3434 * API/testapi.c: Added test for NULL parameters.
3437 2006-07-07 Geoffrey Garen <ggaren@apple.com>
3439 Reviewed by John, mocked by Darin.
3441 - Changed JSEvaluate to take a JSObjectRef instead of a JSValueRef as
3442 "this," since "this" must be an object.
3444 * API/JSContextRef.cpp:
3446 * API/JSContextRef.h:
3448 2006-07-07 Geoffrey Garen <ggaren@apple.com>
3455 * JavaScriptCore.xcodeproj/project.pbxproj:
3457 2006-07-05 Geoffrey Garen <ggaren@apple.com>
3461 Renamed JSCharBufferRef, which was universally unpopular, to JSStringBufferRef,
3462 which, hopefully, will be less unpopular.
3468 * API/JSCallbackObject.cpp:
3469 (KJS::JSCallbackObject::getOwnPropertySlot):
3470 (KJS::JSCallbackObject::put):
3471 (KJS::JSCallbackObject::deleteProperty):
3472 (KJS::JSCallbackObject::staticValueGetter):
3473 (KJS::JSCallbackObject::callbackGetter):
3474 * API/JSCharBufferRef.cpp: Removed.
3475 * API/JSCharBufferRef.h: Removed.
3476 * API/JSContextRef.cpp:
3479 * API/JSContextRef.h:
3481 (JSNodePrototype_appendChild):
3482 (JSNode_getNodeType):
3483 (JSNode_getChildNodes):
3484 (JSNode_getFirstChild):
3486 (JSNodeList_length):
3487 (JSNodeList_getProperty):
3488 * API/JSObjectRef.cpp:
3489 (JSFunctionMakeWithBody):
3490 (JSObjectGetDescription):
3491 (JSObjectHasProperty):
3492 (JSObjectGetProperty):
3493 (JSObjectSetProperty):
3494 (JSObjectDeleteProperty):
3495 (JSPropertyEnumeratorGetNext):
3496 (JSPropertyListAdd):
3497 * API/JSObjectRef.h:
3498 * API/JSStringBufferRef.cpp: Added.
3500 (JSStringBufferCreate):
3501 (JSStringBufferCreateUTF8):
3502 (JSStringBufferRetain):
3503 (JSStringBufferRelease):
3504 (JSValueCopyStringValue):
3505 (JSStringBufferGetLength):
3506 (JSStringBufferGetCharactersPtr):
3507 (JSStringBufferGetCharacters):
3508 (JSStringBufferGetMaxLengthUTF8):
3509 (JSStringBufferGetCharactersUTF8):
3510 (JSStringBufferIsEqual):
3511 (JSStringBufferIsEqualUTF8):
3512 (JSStringBufferCreateWithCFString):
3513 (CFStringCreateWithJSStringBuffer):
3514 * API/JSStringBufferRef.h: Added.
3516 * API/JavaScriptCore.h:
3521 (assertEqualsAsUTF8String):
3522 (assertEqualsAsCharactersPtr):
3523 (assertEqualsAsCharacters):
3524 (MyObject_hasProperty):
3525 (MyObject_getProperty):
3526 (MyObject_setProperty):
3527 (MyObject_deleteProperty):
3528 (MyObject_getPropertyList):
3529 (print_callAsFunction):
3530 (myConstructor_callAsConstructor):
3532 * JavaScriptCore.exp:
3533 * JavaScriptCore.xcodeproj/project.pbxproj:
3535 2006-07-05 Geoffrey Garen <ggaren@apple.com>
3539 Moved some code around for more logical file separation.
3542 * API/JSContextRef.h:
3543 * API/JSObjectRef.cpp:
3544 * API/JSValueRef.cpp:
3548 2006-07-03 Geoffrey Garen <ggaren@apple.com>
3552 Implemented JSFunctionMakeWithBody, which parses a script as a function body
3553 in the global scope, and returns the resulting anonymous function.
3555 I also removed private data from JSCallbackFunction. It never worked,
3556 since JSCallbackFunction doesn't inherit from JSCallbackObject.
3558 * API/JSCallbackConstructor.cpp: Removed.
3559 * API/JSCallbackConstructor.h: Removed.
3560 * API/JSCallbackFunction.cpp:
3561 (KJS::JSCallbackFunction::JSCallbackFunction):
3562 (KJS::JSCallbackFunction::implementsConstruct):
3563 (KJS::JSCallbackFunction::construct):
3564 (KJS::JSCallbackFunction::implementsCall):
3565 (KJS::JSCallbackFunction::callAsFunction):
3566 * API/JSCallbackFunction.h:
3567 * API/JSCallbackObject.cpp:
3568 (KJS::JSCallbackObject::staticFunctionGetter):
3569 * API/JSObjectRef.cpp:
3571 (JSFunctionMakeWithCallbacks):
3572 * API/JSObjectRef.h:
3578 * JavaScriptCore.exp: Programmatically added all symbols exported by
3579 API object files, and sorted results
3580 * JavaScriptCore.xcodeproj/project.pbxproj:
3582 2006-07-03 Geoffrey Garen <ggaren@apple.com>
3586 - Return syntax error in JSCheckSyntax through a JSValueRef* exception
3590 * API/JSContextRef.cpp:
3594 * JavaScriptCore.exp:
3595 * kjs/interpreter.cpp:
3596 (KJS::Interpreter::checkSyntax):
3597 * kjs/interpreter.h:
3599 2006-07-04 Darin Adler <darin@apple.com>