2006-11-17 Anders Carlsson <acarlsson@apple.com>
[WebKit-https.git] / JavaScriptCore / ChangeLog
1 2006-11-17  Anders Carlsson  <acarlsson@apple.com>
2
3         Reviewed by Adam.
4
5         Make sure that we always use std::min and std::max instead of macros.
6         
7         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
8         * kjs/config.h:
9         * wtf/Vector.h:
10
11 === Safari-521.31 ===
12
13 2006-11-12  Geoffrey Garen  <ggaren@apple.com>
14
15         Reviewed by Beth Dakin.
16         
17         Added project-wide setting to disable Microsoft's made-up deprecation 
18         warnings related to std:: functions. (Doesn't have any affect yet,
19         since we currently disable all deprecation warnings.)
20
21         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
22
23 2006-11-12  Mark Rowe  <bdash@webkit.org>
24
25         Reviewed by Mitz.
26
27         Clean up of JavaScriptCore bakefiles.
28
29         * JavaScriptCoreSources.bkl:
30         * jscore.bkl:
31
32 2006-11-11  Alexey Proskuryakov  <ap@webkit.org>
33
34         Reviewed by Maciej.
35
36         http://bugs.webkit.org/show_bug.cgi?id=11508
37         Undisable some warnings for JSImmediate.h
38
39         Fix suggested by Don Gibson.
40
41         * kjs/JSImmediate.h:
42         Re-enable all MSVC warnings, move the remaining runtime checks
43         to compile-time.
44
45 2006-11-10  Zalan Bujtas  <zalan.bujtas@nokia.com>
46
47         Reviewed by Maciej.
48
49         Added s60/symbian platform defines.
50         http://bugs.webkit.org/show_bug.cgi?id=11540
51
52         * wtf/Platform.h:
53
54 === Safari-521.30 ===
55
56 2006-11-08  Ada Chan  <adachan@apple.com>
57
58         Reviewed by darin.
59         
60         Added a method to delete all the keys in a HashMap.
61
62         * wtf/HashMap.h:
63         (WTF::deleteAllPairFirsts):
64         (WTF::deleteAllKeys):
65
66 2006-11-07  Anders Carlsson  <acarlsson@apple.com>
67
68         Reviewed by Geoff.
69
70         * API/JSClassRef.cpp:
71         (OpaqueJSClass::OpaqueJSClass):
72         Initialize cachedPrototype to 0.
73
74 2006-11-06  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
75
76         Reviewed by Maciej.
77
78         Remove warning about garbage after #else. #else clause applies for all
79         non-mac platforms, not only win.
80
81         * kjs/date_object.cpp:
82
83 2006-11-06  Mark Rowe  <bdash@webkit.org>
84
85         Reviewed by the wonderful Mitz Pettel.
86
87         http://bugs.webkit.org/show_bug.cgi?id=11524
88         Bug 11524: REGRESSION(r9842): Array.prototype.join should use ToString operator rather than calling toString on each element
89
90         * kjs/array_object.cpp:
91         (ArrayProtoFunc::callAsFunction): Use ToString operator on each element rather than calling their toString method.
92
93 2006-11-03  Steve Falkenburg  <sfalken@apple.com>
94
95         Fix build
96
97         * kjs/JSImmediate.h:
98
99 2006-11-03  Alexey Proskuryakov  <ap@nypop.com>
100
101         Reviewed by Darin.
102
103         http://bugs.webkit.org/show_bug.cgi?id=11504
104         Fix warnings on non 32 bit platforms
105
106         * kjs/JSImmediate.h:
107         (KJS::JSImmediate::NanAsBits):
108         (KJS::JSImmediate::oneAsBits):
109         Rewrite in a way that moves runtime checks to compile-time.
110
111         (KJS::):
112         (KJS::JSImmediate::fromDouble):
113         (KJS::JSImmediate::toDouble):
114
115 2006-11-02  George Staikos <staikos@kde.org>
116
117         Reviewed by Maciej.
118
119         * collector.cpp:
120         Remove a deprecated pthreads call.
121
122 2006-11-02  Anders Carlsson  <acarlsson@apple.com>
123
124         Reviewed by Maciej, landed by Anders.
125
126         * CMakeLists.txt:
127         Make KDE support optional.
128
129 2006-11-01  Kevin McCullough  <KMcCullough@apple.com>
130
131         Reviewed by Brady.
132
133         - Fixes many JavaScriptCore tests in other timezones.  The root problem is that on mac localtime() returns historically accurate information for DST, but the JavaScript spec explicitly states to not take into account historical information but rather to interpolate from valid years.
134
135         * kjs/DateMath.cpp:
136         (KJS::equivalentYearForDST):
137         (KJS::getDSTOffsetSimple):
138         (KJS::getDSTOffset):
139
140 2006-10-31  Geoffrey Garen  <ggaren@apple.com>
141
142         Reviewed by Beth.
143         
144         Fixed http://bugs.webkit.org/show_bug.cgi?id=11477
145         REGRESSION: GMail crashes in KJS::FunctionImp::callerGetter
146
147         * kjs/function.cpp:
148         (KJS::FunctionImp::argumentsGetter): Removed unnecessary braces.
149         (KJS::FunctionImp::callerGetter): More logical NULL checking.
150
151 2006-10-31  Oliver Hunt  <oliver@apple.com>
152
153         Reviewed by Geoff.
154
155         Adding definition for PLATFORM(CI)
156
157         * wtf/Platform.h:
158
159 2006-10-31  Vladimir Olexa  <vladimir.olexa@gmail.com>
160
161         Reviewed by Geoff.
162
163         http://bugs.webkit.org/show_bug.cgi?id=4166
164         Function object does not support caller property
165
166         Test: fast/js/caller-property.html
167
168         * kjs/function.cpp: 
169         (KJS::FunctionImp::callerGetter): added
170         (KJS::FunctionImp::getOwnPropertySlot): added if statement to handle callerGetter()
171         * kjs/function.h: added callerGetter() declaration
172         * kjs/identifier.h: added caller property macro
173         * tests/mozilla/expected.html: 
174
175 2006-10-30  Kevin McCullough  <KMcCullough@apple.com>
176
177         Reviewed by Adam.
178
179         - Fix some timezone issues and JavaScriptCore date tests.  Addresses bugzilla 4930.
180
181         * kjs/DateMath.h:
182         (KJS::GregorianDateTime::GregorianDateTime): Here's the fix, to add parenthesis for order of precedence.
183         * kjs/date_object.cpp:
184         (KJS::DateProtoFunc::callAsFunction): 
185         (KJS::DateObjectImp::construct): memset not needed as GregorianDateTime initializes itself.
186
187 2006-10-30  Darin Adler  <darin@apple.com>
188
189         Reviewed by John Sullivan.
190
191         * kjs/SavedBuiltins.h: Added needed include.
192         * wtf/OwnPtr.h: (WTF::OwnPtr::set): Fixed mistake in assertion.
193
194 2006-10-28  Darin Adler  <darin@apple.com>
195
196         Reviewed by Maciej.
197
198         - renamed PassRefPtr::release to releaseRef to make it clearer that
199           it's the counterpart of adoptRef, and to make it harder to confuse
200           it with the safer-to-use RefPtr::release
201
202         * kjs/identifier.cpp:
203         (KJS::CStringTranslator::translate):
204         (KJS::UCharBufferTranslator::translate):
205         * kjs/ustring.cpp:
206         (KJS::UString::Rep::create):
207         * wtf/PassRefPtr.h:
208         (WTF::PassRefPtr::PassRefPtr):
209         (WTF::PassRefPtr::~PassRefPtr):
210         (WTF::PassRefPtr::get):
211         (WTF::PassRefPtr::releaseRef):
212         (WTF::PassRefPtr::operator->):
213         (WTF::PassRefPtr::operator=):
214         (WTF::adoptRef):
215         (WTF::static_pointer_cast):
216         (WTF::const_pointer_cast):
217         * wtf/RefPtr.h:
218         (WTF::RefPtr::RefPtr):
219         (WTF::RefPtr::operator=):
220
221 2006-10-28  Darin Adler  <darin@apple.com>
222
223         Reviewed by Steve.
224
225         * kjs/grammar.y: Add definitions of YYMALLOC and YYFREE to fix
226         a warning some people see (not sure why others don't see it).
227
228         * JavaScriptCore.vcproj/JavaScriptCore/grammarWrapper.cpp: Touch
229         this file to force it to re-build grammar.cpp.
230
231 2006-10-28  Darin Adler  <darin@apple.com>
232
233         Reviewed by Geoff.
234
235         - made changes so the code compiles with the highest warning level
236           under MSVC (disabling some warnings, making some code fixes)
237
238         * API/JSCallbackConstructor.cpp:
239         (KJS::JSCallbackConstructor::construct):
240         * API/JSCallbackFunction.cpp:
241         (KJS::JSCallbackFunction::callAsFunction):
242         * API/JSCallbackObject.cpp:
243         (KJS::JSCallbackObject::init):
244         (KJS::JSCallbackObject::construct):
245         (KJS::JSCallbackObject::callAsFunction):
246         * API/JSObjectRef.cpp:
247         (JSPropertyNameArrayGetNameAtIndex):
248         * API/JSStringRef.cpp:
249         (JSStringCreateWithCharacters):
250         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
251         * bindings/c/c_utility.cpp:
252         (KJS::Bindings::convertUTF8ToUTF16):
253         (KJS::Bindings::coerceValueToNPVariantStringType):
254         (KJS::Bindings::convertValueToNPVariant):
255         * kjs/DateMath.h:
256         (KJS::GregorianDateTime::GregorianDateTime):
257         * kjs/ExecState.h:
258         (KJS::ExecState::hadException):
259         * kjs/JSImmediate.h:
260         (KJS::JSImmediate::fromDouble):
261         (KJS::JSImmediate::toDouble):
262         (KJS::JSImmediate::NanAsBits):
263         (KJS::JSImmediate::oneAsBits):
264         * kjs/Parser.h:
265         * kjs/PropertyNameArray.h:
266         (KJS::PropertyNameArray::size):
267         * kjs/array_object.cpp:
268         (ArrayObjectImp::callAsFunction):
269         * kjs/bool_object.cpp:
270         (BooleanObjectImp::callAsFunction):
271         * kjs/collector.cpp:
272         (KJS::Collector::allocate):
273         (KJS::Collector::markCurrentThreadConservatively):
274         (KJS::Collector::collect):
275         * kjs/completion.h:
276         (KJS::Completion::isValueCompletion):
277         * kjs/date_object.cpp:
278         (KJS::findMonth):
279         * kjs/debugger.cpp:
280         (Debugger::sourceParsed):
281         (Debugger::sourceUnused):
282         (Debugger::exception):
283         (Debugger::atStatement):
284         (Debugger::callEvent):
285         (Debugger::returnEvent):
286         * kjs/dtoa.cpp:
287         * kjs/error_object.cpp:
288         (ErrorObjectImp::callAsFunction):
289         (NativeErrorImp::callAsFunction):
290         * kjs/function.cpp:
291         (KJS::FunctionImp::processVarDecls):
292         (KJS::GlobalFuncImp::callAsFunction):
293         * kjs/function_object.cpp:
294         (FunctionPrototype::callAsFunction):
295         * kjs/grammar.y:
296         * kjs/identifier.cpp:
297         (KJS::CStringTranslator::translate):
298         (KJS::Identifier::add):
299         * kjs/internal.h:
300         * kjs/lexer.cpp:
301         (Lexer::lex):
302         (Lexer::isIdentStart):
303         (Lexer::isIdentPart):
304         (isDecimalDigit):
305         (Lexer::isHexDigit):
306         (Lexer::isOctalDigit):
307         (Lexer::matchPunctuator):
308         (Lexer::singleEscape):
309         (Lexer::convertOctal):
310         (Lexer::convertHex):
311         (Lexer::convertUnicode):
312         (Lexer::record8):
313         * kjs/lexer.h:
314         * kjs/math_object.cpp:
315         (MathFuncImp::callAsFunction):
316         * kjs/number_object.cpp:
317         (integer_part_noexp):
318         (intPow10):
319         (NumberProtoFunc::callAsFunction):
320         (NumberObjectImp::callAsFunction):
321         * kjs/object.cpp:
322         (KJS::JSObject::deleteProperty):
323         (KJS::JSObject::callAsFunction):
324         (KJS::JSObject::toBoolean):
325         (KJS::JSObject::toObject):
326         * kjs/object.h:
327         (KJS::JSObject::getPropertySlot):
328         * kjs/property_map.cpp:
329         (KJS::isValid):
330         (KJS::PropertyMap::put):
331         (KJS::PropertyMap::insert):
332         (KJS::PropertyMap::containsGettersOrSetters):
333         * kjs/property_map.h:
334         (KJS::PropertyMap::hasGetterSetterProperties):
335         * kjs/property_slot.h:
336         * kjs/string_object.cpp:
337         (StringInstance::getPropertyNames):
338         (StringObjectImp::callAsFunction):
339         (StringObjectFuncImp::callAsFunction):
340         * kjs/ustring.cpp:
341         (KJS::UString::Rep::computeHash):
342         (KJS::UString::UString):
343         (KJS::UString::from):
344         (KJS::UString::append):
345         (KJS::UString::ascii):
346         (KJS::UString::operator=):
347         (KJS::UString::find):
348         (KJS::UString::rfind):
349         * kjs/ustring.h:
350         (KJS::UChar::high):
351         (KJS::UChar::low):
352         (KJS::UCharReference::low):
353         (KJS::UCharReference::high):
354         * kjs/value.cpp:
355         (KJS::JSValue::toUInt16):
356         * kjs/value.h:
357         * pcre/pcre_compile.c:
358         (get_othercase_range):
359         * pcre/pcre_exec.c:
360         (match):
361         * pcre/pcre_internal.h:
362         * wtf/HashFunctions.h:
363         (WTF::intHash):
364         (WTF::PtrHash::hash):
365         * wtf/MathExtras.h:
366         (isnan):
367         (lround):
368         (lroundf):
369         * wtf/StringExtras.h:
370         (strncasecmp):
371         * wtf/unicode/icu/UnicodeIcu.h:
372         (WTF::Unicode::isPrintableChar):
373
374 2006-10-26  W. Andy Carrel  <wac@google.com>
375
376         Reviewed by Maciej.
377
378         - Fix http://bugs.webkit.org/show_bug.cgi?id=7445 /
379           <rdar://problem/4614195> (and 7253 / <rdar://4694011>) by changing
380           inline regexps so that they can have \u escaped Unicode sequences and
381           still work properly.
382
383         * kjs/lexer.cpp:
384         (Lexer::Lexer): 
385         (Lexer::setCode):
386         (Lexer::shift): Looking ahead one additional character for the benefit
387         of scanRegExp
388         (Lexer::scanRegExp): Change code to support unicode escapes in inline 
389         regexps.
390         * kjs/lexer.h: Extra lookahead added.
391
392 === Safari-521.29 ===
393
394 2006-10-26  Nikolas Zimmermann  <zimmermann@kde.org>
395
396         Reviewed by Darin.
397
398         Fix build with older gcc 3.3.4.
399
400         * kjs/DateMath.cpp: Remove inline prefix.
401         (KJS::equivalentYearForDST):
402
403 2006-10-26  Darin Adler  <darin@apple.com>
404
405         Reviewed by John.
406
407         - fix iteration of properties of string objects (found because of a warning
408           emitted by the MSVC compiler)
409
410         * kjs/string_object.cpp: (StringInstance::getPropertyNames): Change code that
411         wants to format a number as a string to use UString::from. Before it was using
412         the UString constructor that makes a string from a character!
413
414         * kjs/ustring.h:
415         * kjs/ustring.cpp: Remove the dangerous and not all that helpful UString(char)
416         constructor.
417
418         * kjs/grammar.y: Change code to not depend on the UString(char) constructor.
419         This is potentially more efficient anyway because we could overload the + operator
420         some day to handle char* directly instead of creating a UString.
421
422         * kjs/nodes2string.cpp: (SourceStream::operator<<): Change code to not depend on
423         the UString(char) constructor.
424
425 2006-10-25  Kevin McCullough  <KMcCullough@apple.com>
426
427         Reviewed by Steve (rubber stamp).
428
429         - Link against your local build of JavaScriptCore.lib first, this fixes some errors on release builds of testkjs.
430
431         * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
432
433 2006-10-25  Geoffrey Garen  <ggaren@apple.com>
434
435         Reviewed by Lou.
436         
437         Removed duplicate symbol declaration.
438
439         * JavaScriptCore.xcodeproj/project.pbxproj:
440         * kjs/grammar.y:
441
442 2006-10-24  Steve Falkenburg  <sfalken@apple.com>
443
444         Build config change
445
446         * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
447
448 2006-10-24  Kevin McCullough  <KMcCullough@apple.com>
449
450         Reviewed by Brady.
451
452         - Fixes a date formatting issue on win.  Specifically strftime cannot handle some ranges of time so we shift time call strftime and then manipulate the returned string, if needed.
453
454         * kjs/date_object.cpp:
455         (KJS::):
456         (KJS::formatLocaleDate):
457         (KJS::DateProtoFunc::callAsFunction):
458
459 2006-10-23  Kevin McCullough  <KMcCullough@apple.com>
460
461         Reviewed by 
462
463        - Build fix
464
465         * JavaScriptCore.xcodeproj/project.pbxproj:
466         * kjs/grammar.y:
467
468 2006-10-23  Kevin McCullough  <KMcCullough@apple.com>
469
470         Reviewed by Maciej.
471
472         - Makes the toTM function an operator.  Was going to piggy back on a patch but the patch needs more work.
473
474         * kjs/DateMath.cpp:
475         (KJS::equivalentYearForDST):
476         * kjs/DateMath.h:
477         (KJS::GregorianDateTime::operator tm):
478         * kjs/date_object.cpp:
479         (KJS::formatTime):
480         (KJS::DateProtoFunc::callAsFunction):
481
482 2006-10-23  Kevin McCullough  <KMcCullough@apple.com>
483
484         Reviewed by Maciej.
485
486        - Fixes two regressions on win.  Both are stack overflows. For one the number of recursions is capped at 100, and for the other, nested parenthesis pairs are not evaluated (since they would evaluate to whatever is in them anyway).
487
488         * kjs/grammar.y:
489         * kjs/object.cpp:
490
491 2006-10-21  Steve Falkenburg  <sfalken@apple.com>
492
493         Reviewed by Adam.
494         
495         Add minimal compatibility with MSVCRT leak checker
496
497         * wtf/FastMalloc.h:
498
499 2006-10-23  Kevin McCullough  <KMcCullough@apple.com>
500
501         Reviewed by Geof.
502
503         - Sets the lowercase range correctly in the test and consolidates a variable to make the test more readable.
504
505        * tests/mozilla/ecma/String/15.5.4.11-2.js:
506
507 2006-10-21  Darin Adler  <darin@apple.com>
508
509         Reviewed by Anders.
510
511         - http://bugs.webkit.org/show_bug.cgi?id=11377
512           swap(Vector, Vector) should be O(1) instead of O(n)
513
514         * wtf/Vector.h:
515         (WTF::VectorBuffer::swap): Added.
516         (WTF::Vector::swap): Added.
517         (WTF::swap): Added overload that takes two Vector objects.
518
519 2006-10-21  Darin Adler  <darin@apple.com>
520
521         Reviewed by Adam.
522
523         - http://bugs.webkit.org/show_bug.cgi?id=11376
524           build scripts should invoke make with "-j" option for multiple processors
525
526         * JavaScriptCore.xcodeproj/project.pbxproj: Pass -j `sysctl -n hw.ncpu` to make.
527
528 2006-10-19  Kevin McCullough  <KMcCullough@apple.com>
529
530         Reviewed by Geof.
531
532         Changed test to make us pass Georgian case changing for Unicode 4.0 and 5.0.  This incorporates changes from the 1.4 revision of the same mozilla test.
533         On Tiger we are still using Unicode 4.0 but on win and Leopard we are using Unicode 5.0, so this test currently allows for either answer.
534
535         * tests/mozilla/ecma/String/15.5.4.11-2.js:
536
537 2006-10-18  Maciej Stachowiak  <mjs@apple.com>
538
539         Reviewed by Geoff.
540         
541         - remove vestiges of KXMLCore name (former name of WTF).
542
543         * wtf/Assertions.h:
544         * wtf/FastMalloc.h:
545         (operator new):
546         (operator delete):
547         (operator new[]):
548         (operator delete[]):
549         * wtf/FastMallocInternal.h:
550         * wtf/Forward.h:
551         * wtf/GetPtr.h:
552         * wtf/HashCountedSet.h:
553         * wtf/HashFunctions.h:
554         * wtf/HashMap.h:
555         * wtf/HashSet.h:
556         * wtf/HashTable.h:
557         * wtf/HashTraits.h:
558         * wtf/ListRefPtr.h:
559         * wtf/MathExtras.h:
560         * wtf/Noncopyable.h:
561         * wtf/OwnArrayPtr.h:
562         * wtf/OwnPtr.h:
563         * wtf/PassRefPtr.h:
564         * wtf/Platform.h:
565         * wtf/RefPtr.h:
566         * wtf/StringExtras.h:
567         (snprintf):
568         * wtf/UnusedParam.h:
569         * wtf/Vector.h:
570         * wtf/VectorTraits.h:
571
572 2006-10-17  Steve Falkenburg  <sfalken@apple.com>
573
574         Reviewed by Maciej.
575         
576         Adjust include paths
577
578         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
579
580 2006-10-17  Kevin McCullough  <KMcCullough@apple.com>
581
582         Reviewed by Darin.
583
584         Fixed a date issue where the UTC offset was not set in win.
585
586         * kjs/DateMath.cpp:
587         (KJS::getDSTOffsetSimple):
588         (KJS::getDSTOffset):
589         (KJS::msToGregorianDateTime):
590         * kjs/DateMath.h:
591         (KJS::):
592         (KJS::GregorianDateTime::GregorianDateTime):
593
594 2006-10-17  Kevin McCullough  <KMcCullough@apple.com>
595
596         Reviewed by Brady.
597
598         Fixes a JavaScriptCore math issue on win.
599
600         * kjs/math_object.cpp:
601         (MathFuncImp::callAsFunction):
602         * wtf/MathExtras.h:
603         (wtf_atan2):
604
605 2006-10-16  Kevin McCullough  <kmccullough@apple.com>
606
607         Reviewed by Geof.
608
609         Removed unecessary global specifiers.
610
611         * kjs/math_object.cpp:
612         (MathFuncImp::callAsFunction):
613
614 2006-10-16  Kevin McCullough  <KMcCullough@apple.com>
615
616         Reviewed by John.
617
618         Fixes a compile order issue for testkjs on win.
619
620         * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
621
622 2006-10-15  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
623
624         Reviewed by Anders.
625
626         Remove junk (as gcc calls it) after #else clause.
627
628         * wtf/FastMalloc.cpp:
629         (WTF::do_free):
630
631 2006-10-14  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
632
633         Reviewed by Maciej.
634
635         Define KXMLCORE_USE_CURL for platforms that wish to use CURL as
636         networking, and set it for GDK build
637
638         * wtf/Platform.h:
639
640 2006-10-13  Marvin Decker  <marv.decker@gmail.com>
641
642         Reviewed by Kevin McCullough.
643
644         Fixes http://bugs.webkit.org/show_bug.cgi?id=11283
645         Fixes Qt/Linux and Windows build
646
647         * kjs/DateMath.cpp:
648         * kjs/DateMath.h:
649         * kjs/date_object.cpp:
650         (KJS::DateProtoFunc::callAsFunction):
651
652 2006-10-13  Kevin McCullough  <KMcCullough@apple.com>
653
654         Reviewed by Adam, Geoff, Darin.
655
656        Fixed displaying the UTC offset and time zone string, as well as renamed the GregorianDateTime structure and clean up. 
657
658         * ChangeLog:
659         * kjs/DateMath.cpp:
660         (KJS::getUTCOffset):
661         (KJS::getDSTOffsetSimple):
662         (KJS::gregorianDateTimeToMS):
663         (KJS::msToGregorianDateTime):
664         * kjs/DateMath.h:
665         (KJS::GregorianDateTime::GregorianDateTime):
666         (KJS::GregorianDateTime::~GregorianDateTime):
667         (KJS::GregorianDateTime::toTM):
668         * kjs/date_object.cpp:
669         (KJS::gmtoffset):
670         (KJS::formatDate):
671         (KJS::formatDateUTCVariant):
672         (KJS::formatTime):
673         (KJS::fillStructuresUsingTimeArgs):
674         (KJS::fillStructuresUsingDateArgs):
675         (KJS::DateInstance::getTime):
676         (KJS::DateInstance::getUTCTime):
677         (KJS::DateProtoFunc::callAsFunction):
678         (KJS::DateObjectImp::construct):
679         (KJS::DateObjectImp::callAsFunction):
680         (KJS::DateObjectFuncImp::callAsFunction):
681         (KJS::parseDate):
682         * kjs/date_object.h:
683
684 2006-10-13  Kevin McCullough  <KMcCullough@apple.com>
685
686         Reviewed by Adam.
687
688         Gets JavaScripCore tests running on windows.
689
690         * Scripts/run-javascriptcore-tests:
691         * Scripts/webkitdirs.pm:
692
693 2006-10-12  Geoffrey Garen  <ggaren@apple.com>
694
695         Reviewed by Maciej.
696         
697         Removed JSObjectMakeWithPrototype, clarified some comments. We really
698         don't want people to manage their own prototypes, so we don't want an
699         extra function in the API devoted to just that. People can still manage
700         their own prototypes if they really want by using JSObjectSetPrototype.
701
702         * API/JSClassRef.cpp:
703         (OpaqueJSClass::createNoAutomaticPrototype):
704         (OpaqueJSClass::create):
705         * API/JSClassRef.h:
706         * API/JSObjectRef.cpp:
707         (JSClassCreate):
708         (JSObjectMake):
709         * API/JSObjectRef.h:
710         * API/testapi.c:
711         (main):
712         * JavaScriptCore.exp:
713
714 2006-10-12  Kevin McCullough  <KMcCullough@apple.com>
715
716         Reviewed by Adam.
717
718         Build breakage fix
719
720         * kjs/DateMath.cpp:
721         (KJS::msToTM):
722         * kjs/date_object.cpp:
723         (KJS::gmtoffset):
724
725 2006-10-11  Kevin McCullough  <KMcCullough@apple.com>
726
727         Reviewed by Geoff.
728
729         Added our own tm struct to have a consistent set of fields, which lets us display the DST offset and timezone strings correctly.  Also there is some code cleanup.
730
731         * kjs/DateMath.cpp:
732         (KJS::timeToMS):
733         (KJS::getUTCOffset):
734         (KJS::getDSTOffsetSimple):
735         (KJS::dateToMS):
736         (KJS::msToTM):
737         (KJS::tmToKJStm):
738         (KJS::KJStmToTm):
739         * kjs/DateMath.h:
740         * kjs/date_object.cpp: 
741         (KJS::gmtoffset): 
742         (KJS::formatTime): 
743         (KJS::DateProtoFunc::callAsFunction): 
744         (KJS::DateObjectImp::construct):
745         (KJS::DateObjectImp::callAsFunction):
746         (KJS::DateObjectFuncImp::callAsFunction):
747         (KJS::parseDate):
748         * kjs/date_object.h:
749
750 2006-10-09  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
751
752         Reviewed by Geoff.
753
754         Improve gdk build compiler flags (show warning, no rtti and exceptions).
755
756         * jscore.bkl:
757
758 2006-10-06  Kevin McCullough  <KMcCullough@apple.com>
759
760         Reviewed by Brady.
761
762         DST and TimeZones were wrong in some cases, specifically on some of the dates where DST changes.
763
764         * kjs/DateMath.cpp:
765         (KJS::equivalentYearForDST):
766         (KJS::getUTCOffset):
767         (KJS::getDSTOffsetSimple):
768         (KJS::getDSTOffset):
769         (KJS::dateToMseconds):
770         (KJS::msToTM):
771         * kjs/DateMath.h:
772         * kjs/date_object.cpp:
773         (KJS::gmtoffset):
774
775 2006-10-05  Darin Adler  <darin@apple.com>
776
777         Reviewed by Kevin McCullough.
778
779         * wtf/Assertions.cpp: Fix build when _DEBUG is not defined.
780
781 2006-10-04  Kevin McCullough  <KMcCullough@apple.com>
782
783         Reviewed by Adam.
784
785         - Removed an unnecessary assert that was stopping many pages.  tm_gmtoff was not set for UTC time in mozilla but is always set for us.
786
787         * kjs/DateMath.cpp:
788         (KJS::getUTCOffset):
789         (KJS::msToTM):
790         * kjs/date_object.cpp:
791         (KJS::gmtoffset):
792         (KJS::formatTime):
793
794 2006-10-04  Geoffrey Garen  <ggaren@apple.com>
795
796         Patch by Darin and me, reviewed by Maciej.
797
798         Fixed <rdar://problem/4518397> REGRESSION(?): Oft-seen but unrepro crash 
799               in JavaScript garbage collection (KJS::Collector::collect())
800                <rdar://problem/4752492> Crash in KJS::collect
801               
802         The issue here was allocating one garbage-collected object in the midst 
803         of allocating a second garbage-collected object. In such a case, the
804         zeroIfFree word lies.
805
806         * kjs/collector.cpp:
807         (KJS::Collector::allocate):
808         (KJS::Collector::collect):
809
810 2006-10-04  Kevin McCullough  <KMcCullough@apple.com>
811
812         Reviewed by Adam.
813
814         - Layout test fix
815
816         * kjs/DateMath.cpp:
817         (KJS::dateToDayInYear): accept and correctly handle negative months
818
819 2006-10-05  Kevin McCullough  <KMcCullough@apple.com>
820
821        build fix
822
823         * kjs/DateMath.cpp:
824         (KJS::dateToDayInYear):
825
826 2006-10-05  Mark Rowe  <bdash@webkit.org>
827
828         Reviewed by maculloch.
829
830         Gdk build fix.
831
832         * JavaScriptCoreSources.bkl: Add DateMath.cpp to file list.
833
834 2006-10-05  Kevin McCullough  <KMcCullough@apple.com>
835
836         Reviewed by aroben
837
838         - build fix
839
840         * JavaScriptCore.xcodeproj/project.pbxproj:
841
842 2006-10-04  Nikolas Zimmermann  <zimmermann@kde.org>
843
844         Reviewed by Mitz.
845
846         Fix Qt/Linux build by adding DateMath.cpp to compilation.
847
848         * CMakeLists.txt: Also replace tabs with spaces.
849
850 2006-10-04  Kevin McCullough  <KMcCullough@apple.com>
851
852         Reviewed by DethBakin.
853
854         - Apparently the build bot uses an older version of XCode which warns about conversions and the newest version does not.  I hope this fixes the build but I cann't be sure on my system.
855
856         * kjs/DateMath.cpp:
857         (KJS::msToYear):
858         (KJS::dayInYear):
859         (KJS::dateToDayInYear):
860
861 2006-10-05  Darin Adler  <darin@apple.com>
862
863         Reviewed by Adam.
864
865         * wtf/Assertions.cpp: Changed assertion formatting to omit the "======"
866         lines so you can see more assertions in less space. Also improved format
867         of file/line information so it works with more development environments.
868
869 2006-10-04  Kevin McCullough  <KMcCullough@apple.com>
870
871         Reviewed by Tim H.
872
873         - The build machine is more sensitive about automatic conversions.  These fixes exp
874 licitly cast or change the input and return types of functions to avoid conversions.
875
876         * JavaScriptCore.xcodeproj/project.pbxproj:
877         * kjs/DateMath.cpp:
878         (KJS::):
879         (KJS::msToDays):
880         (KJS::msToYear):
881         (KJS::dayInYear):
882         (KJS::monthToDayInYear):
883         (KJS::dateToDayInYear):
884         (KJS::getDSTOffsetSimple):
885         (KJS::getDSTOffset):
886         (KJS::dateToMseconds):
887         (KJS::msToTM):
888
889 2006-10-04  Kevin McCullough  <KMcCullough@apple.com>
890
891         Reviewed by GGaren
892
893         - This is a big makeover for our Date implemenetation.  This solves many platform specific issues, specifically dates before 1970, and simplifies some ugly code.  The purpose of this was to get us to pass many of the JavaScriptCore tests on windows.
894
895         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
896         * JavaScriptCore.xcodeproj/project.pbxproj:
897         * kjs/DateMath.cpp: Added.
898         (KJS::):
899         (KJS::daysInYear):
900         (KJS::daysFrom1970ToYear):
901         (KJS::msFrom1970ToYear):
902         (KJS::msToDays):
903         (KJS::msToYear):
904         (KJS::isLeapYear):
905         (KJS::isInLeapYear):
906         (KJS::dayInYear):
907         (KJS::msToMilliseconds):
908         (KJS::msToWeekDay):
909         (KJS::msToSeconds):
910         (KJS::msToMinutes):
911         (KJS::msToHours):
912         (KJS::msToMonth):
913         (KJS::msToDayInMonth):
914         (KJS::monthToDayInYear):
915         (KJS::timeToMseconds):
916         (KJS::dateToDayInYear):
917         (KJS::equivalentYearForDST):
918         (KJS::getUTCOffset):
919         (KJS::getDSTOffsetSimple):
920         (KJS::getDSTOffset):
921         (KJS::localTimeToUTC):
922         (KJS::UTCToLocalTime):
923         (KJS::dateToMseconds):
924         (KJS::msToTM):
925         (KJS::isDST):
926         * kjs/DateMath.h: Added.
927         (KJS::):
928         * kjs/date_object.cpp:
929         (KJS::gmtoffset):
930         (KJS::formatTime):
931         (KJS::DateInstance::getTime):
932         (KJS::DateInstance::getUTCTime):
933         (KJS::DateProtoFunc::callAsFunction):
934         (KJS::DateObjectImp::construct):
935         (KJS::DateObjectFuncImp::callAsFunction):
936         (KJS::parseDate):
937         * kjs/testkjs.cpp:
938         * os-win32/stdint.h:
939
940 2006-10-02  Nikolas Zimmermann  <zimmermann@kde.org>
941
942         Reviewed/landed by Adam.
943
944         Build testkjs on Qt/Linux.
945
946         * CMakeLists.txt:
947
948 2006-10-02  Nikolas Zimmermann  <zimmermann@kde.org>
949
950         Reviewed by eseidel.  Landed by eseidel.
951
952         Fix win32 build, which has no inttypes.h
953
954         * wtf/Assertions.h:
955
956 2006-10-02  Nikolas Zimmermann <zimmermann@kde.org>
957
958         Reviewed by eseidel & mjs.  Landed by eseidel.
959
960         Fix Qt/Linux build with older gcc 3.3.4.
961         http://bugs.webkit.org/show_bug.cgi?id=11116
962  
963         * kjs/lookup.h: Move cacheGlobalObject into KJS namespace.
964         (KJS::cacheGlobalObject): Also remove GCC_ROOT_NS_HACK.
965         * wtf/Assertions.h: Include inttypes.h for uintptr_t.
966
967 2006-09-28  Steve Falkenburg  <sfalken@apple.com>
968
969         Reviewed by Maciej.
970         
971         Use $(ConfigSuffix) set via vsprops files to add _debug
972         to end of debug filenames.
973
974         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
975         * JavaScriptCore.vcproj/debug.vsprops: Added.
976         * JavaScriptCore.vcproj/dftables/dftables.vcproj:
977         * JavaScriptCore.vcproj/release.vsprops: Added.
978         * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
979
980 2006-09-28  Darin Adler  <darin@apple.com>
981
982         Reviewed by Alice.
983
984         - support for change that should fix <rdar://problem/4733044>
985           REGRESSION: XML iBench shows 10% perf. regression (copying
986           strings while decoding)
987
988         * wtf/Vector.h: Changed VectorBuffer so that the general case
989         contains an instance of the 0 case, since deriving from it
990         was violating the Liskov Substitution Principle.
991         (WTF::VectorBuffer::releaseBuffer): Added. Releases the buffer so it can
992         be adopted by another data structure that uses the FastMalloc.h allocator.
993         Returns 0 if the internal buffer was being used.
994         (WTF::Vector::releaseBuffer): Added. Releases the buffer as above or creates
995         a new one in the case where the internal buffer was being used.
996
997 2006-09-28  Maciej Stachowiak  <mjs@apple.com>
998
999         Reviewed by Geoff.
1000         
1001         - change garbage collection to happen at increments proportional to number of live objects, not always
1002         every 1000 allocations
1003
1004         * kjs/collector.cpp:
1005         (KJS::Collector::allocate):
1006
1007 2006-09-28  Maciej Stachowiak  <mjs@apple.com>
1008
1009         Reviewed by Mitz.
1010
1011         - fixed REGRESSION (r16606): javascriptCore Crash on website load
1012         
1013         Plus style fixes.
1014         
1015             - fixed some possible off-by-one bugs
1016             - use indexing, not iterators, for Vectors
1017             - store Vector by pointer instead of by value to avoid blowing out FunctionImp size
1018         
1019         * kjs/function.cpp:
1020         (KJS::FunctionImp::addParameter):
1021         (KJS::FunctionImp::parameterString):
1022         (KJS::FunctionImp::processParameters):
1023         (KJS::FunctionImp::lengthGetter):
1024         (KJS::FunctionImp::getParameterName):
1025         * kjs/function.h:
1026
1027 2006-09-27  Steve Falkenburg  <sfalken@apple.com>
1028
1029         Reviewed by Maciej.
1030         
1031         More build tweaks
1032
1033         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1034         * JavaScriptCore.vcproj/JavaScriptCore/dstroot-to-sdk.cmd: Removed.
1035
1036 2006-09-27  John Sullivan  <sullivan@apple.com>
1037
1038         * kjs/function.cpp:
1039         (KJS::FunctionImp::getParameterName):
1040         removed assertion that displeased gcc 4.0.1 (build 5420):
1041         ASSERT(static_cast<size_t>(index) == index);
1042
1043 2006-09-27  Kevin McCullough  <KMcCullough@apple.com>
1044
1045         Reviewed by GGaren.
1046
1047         Cleanup of previous fix which was to address Radar: 4752492
1048
1049         * kjs/function.cpp:
1050         (KJS::FunctionImp::addParameter):
1051         (KJS::FunctionImp::parameterString):
1052         (KJS::FunctionImp::processParameters):
1053         (KJS::FunctionImp::lengthGetter):
1054         (KJS::FunctionImp::getParameterName):
1055         * kjs/function.h:
1056
1057 2006-09-27  Kevin McCullough  <KMcCullough@apple.com>
1058
1059         Reviewed by Adele.
1060
1061         Fixes a GC stack overflow crash.
1062         The change is to move from a linked list implementation of Parameters to a Vector.
1063         The problem with the linked list is that each one creates it's own stack frame when being destroyed and in extreme cases this caused the stack to overflow. 
1064
1065         * kjs/function.cpp:
1066         (KJS::Parameter::Parameter):
1067         (KJS::FunctionImp::addParameter):
1068         (KJS::FunctionImp::parameterString):
1069         (KJS::FunctionImp::processParameters):
1070         (KJS::FunctionImp::lengthGetter):
1071         (KJS::FunctionImp::getParameterName):
1072         * kjs/function.h:
1073
1074 2006-09-27  Steve Falkenburg  <sfalken@apple.com>
1075
1076         Fix last path fix.
1077
1078         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1079
1080 2006-09-27  Steve Falkenburg  <sfalken@apple.com>
1081
1082         Set path before build.
1083
1084         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1085
1086 2006-09-27  Sean Gies  <seangies@apple.com>
1087
1088         Reviewed by Adam Roben.
1089
1090         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Debug config should link to debug runtime.
1091         * JavaScriptCore.vcproj/dftables/dftables.vcproj: Debug config should link to debug runtime.
1092
1093 2006-09-27  Don Melton  <gramps@apple.com>
1094
1095         Reviewed by Adam Roben.
1096
1097         Changed line ending from DOS to UNIX format so it doesn't die running
1098         on my machine. ;)
1099
1100         * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
1101
1102 2006-09-23  Alexey Proskuryakov  <ap@nypop.com>
1103
1104         Reviewed by Maciej.
1105
1106         http://bugs.webkit.org/show_bug.cgi?id=10183
1107         REGRESSION: obfuscated JS decoding breaks because of soft hyphen removal
1108         (Fanfiction.net author pages not listing stories)
1109
1110         Rolled out the fix for bug 4139.
1111
1112         * kjs/lexer.cpp:
1113         (Lexer::setCode):
1114         (Lexer::shift):
1115         * tests/mozilla/ecma/Array/15.4.5.1-1.js:
1116         * tests/mozilla/expected.html:
1117
1118 2006-09-22  Steve Falkenburg  <sfalken@apple.com>
1119
1120         Build fix.
1121
1122         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1123
1124 2006-09-22  Darin Adler  <darin@apple.com>
1125
1126         Reviewed by Alice.
1127
1128         * wtf/Vector.h: Add an append that takes a pointer and length.
1129         Generalize the existing Vector append to work on vectors with
1130         any value for inlineCapacity. Change the append algorithm so
1131         it doesn't check capacity each time through the loop.
1132
1133 2006-09-22  Steve Falkenburg  <sfalken@apple.com>
1134
1135         Fix release build.
1136
1137         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1138
1139 2006-09-21  Geoffrey Garen  <ggaren@apple.com>
1140
1141         Reviewed by Maciej.
1142
1143         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1144         Updated to include the right path.
1145         * wtf/FastMalloc.h: #include Platform.h, since we use Platform macros.
1146
1147 === Safari-521.27 ===
1148
1149 2006-09-20  Anders Carlsson  <acarlsson@apple.com>
1150
1151         Reviewed by Dave Hyatt.
1152
1153         * wtf/MathExtras.h:
1154         Get rid of lrint.
1155
1156 2006-09-20  Sean Gies  <seangies@apple.com>
1157
1158         Reviewed by Steve Falkenburg.
1159
1160         * wtf/Assertions.cpp: Debug messages should go into debugger console.
1161
1162 2006-09-20  David Hyatt  <hyatt@apple.com>
1163
1164         Add an implementation of lrint for Win32.
1165
1166         Reviewed by anders
1167
1168         * wtf/MathExtras.h:
1169         (lrint):
1170
1171 2006-09-15  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
1172
1173         Reviewed by Adam.
1174
1175         http://bugs.webkit.org/show_bug.cgi?id=10864
1176         Bug 10864: Linux\GDK build fixes
1177
1178         * JavaScriptCoreSources.bkl:
1179         * jscore.bkl:
1180
1181 2006-09-15  Adam Roben  <aroben@apple.com>
1182
1183         Windows build fix.
1184
1185         * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
1186
1187 2006-09-15  Anders Carlsson  <acarlsson@apple.com>
1188
1189         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1190         Fix the release build.
1191
1192 2006-09-15  Anders Carlsson  <acarlsson@apple.com>
1193
1194         Reviewed by Steve.
1195
1196         Add JavaScriptCore API to the build.
1197         * API/JSBase.cpp:
1198         * API/JSCallbackConstructor.cpp:
1199         * API/JSCallbackFunction.cpp:
1200         * API/JSCallbackObject.cpp:
1201         * API/JSClassRef.cpp:
1202         * API/JSContextRef.cpp:
1203         * API/JSObjectRef.cpp:
1204         * API/JSStringRef.cpp:
1205         * API/JSValueRef.cpp:
1206         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1207         * os-win32/stdbool.h: Added.
1208
1209 2006-09-12  Steve Falkenburg  <sfalken@apple.com>
1210
1211         Reviewed by Ada.
1212         
1213         Build tweaks (doing JavaScriptCore now since it doesn't have
1214         dependencies).
1215
1216         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1217         * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
1218         * JavaScriptCore.vcproj/JavaScriptCore/dstroot-to-sdk.cmd: Added.
1219         * JavaScriptCore.vcproj/dftables/dftables.vcproj:
1220         * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
1221
1222 2006-09-11  Brady Eidson  <beidson@apple.com>
1223
1224         Build fix - I think Tim's last checkin wasn't tested on Tiger, possibly.  I simply
1225         commented out the undefined constants until he can have a chance to make the right call
1226
1227         * bindings/objc/objc_utility.mm:
1228         (KJS::Bindings::objcValueTypeForType): Commented out undefined symbols
1229
1230 2006-09-11  Timothy Hatcher  <timothy@apple.com>
1231
1232         Reviewed by Tim O. and Darin.
1233
1234         Add support for more method signatures affecting ObjC methods called from JavaScript:
1235         - Added unsigned types and long long.
1236         - Allow methods that use const, oneway, bycopy and byref type modifiers.
1237
1238         * bindings/objc/objc_instance.mm:
1239         (ObjcInstance::invokeMethod):
1240         * bindings/objc/objc_utility.h:
1241         (KJS::Bindings::):
1242         * bindings/objc/objc_utility.mm:
1243         (KJS::Bindings::convertValueToObjcValue):
1244         (KJS::Bindings::convertObjcValueToValue):
1245         (KJS::Bindings::objcValueTypeForType):
1246
1247 2006-09-05  Timothy Hatcher  <timothy@apple.com>
1248
1249         Reviewed by Tim O.
1250
1251         <rdar://problem/4715840> SEL is not char*
1252
1253         * bindings/objc/objc_class.mm:
1254         (KJS::Bindings::ObjcClass::methodsNamed): use sel_getName instead of a char* cast.
1255         * bindings/objc/objc_runtime.mm:
1256         (ObjcFallbackObjectImp::callAsFunction): ditto
1257
1258 2006-09-03  Alexey Proskuryakov  <ap@nypop.com>
1259
1260         Reviewed by Tim H.
1261
1262         http://bugs.webkit.org/show_bug.cgi?id=10693
1263         Convert JavaScript arrays to AppleScript lists
1264
1265         * JavaScriptCore.exp: Export ArrayInstance::info and ArrayInstance::getItem().
1266         * kjs/array_instance.h:
1267         * kjs/array_object.cpp:
1268         (ArrayInstance::getItem): Added a method to access array items from C++.
1269
1270 2006-09-02  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
1271
1272         Reviewed by Tim H.
1273
1274         Bug 10454: Unix bakefile fixes
1275         http://bugs.webkit.org/show_bug.cgi?id=10454
1276
1277         * JavaScriptCoreSources.bkl:
1278
1279 2006-09-01  Nikolas Zimmermann  <zimmermann@kde.org>
1280
1281         Reviewed by hyatt.  Landed by eseidel.
1282
1283         Fix build on Linux.
1284
1285         * pcre/CMakeLists.txt: Add wtf/ include.
1286
1287 2006-09-01  Nikolas Zimmermann  <zimmermann@kde.org>
1288
1289         Reviewed and landed by ap.
1290
1291         Fix build on Linux (C89 without gcc extensions enabled).
1292
1293         * pcre/pcre_internal.h: Use C style comments.
1294         * wtf/Assertions.h: Use C style comments.
1295         * wtf/Platform.h: Use C style comments.
1296
1297 2006-09-01  Steve Falkenburg  <sfalken@apple.com>
1298
1299         Fix build.
1300
1301         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1302         * JavaScriptCore.vcproj/dftables/dftables.vcproj:
1303
1304 2006-08-31  Anders Carlsson  <acarlsson@apple.com>
1305
1306         Reviewed by Darin.
1307         
1308         Add new portability functions to MathExtras.h and add StringExtras.h which is for
1309         string portability functions.
1310         
1311         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1312         * bindings/c/c_instance.cpp:
1313         * kjs/date_object.cpp:
1314         * wtf/MathExtras.h:
1315         (copysign):
1316         (isfinite):
1317         * wtf/StringExtras.h: Added.
1318         (snprintf):
1319         (strncasecmp):
1320
1321 2006-08-31  Anders Carlsson  <acarlsson@apple.com>
1322
1323         Reviewed by Tim H.
1324         
1325         Fix Windows build.
1326         
1327         * JavaScriptCore.vcproj/dftables/dftables.vcproj:
1328         * pcre/pcre_internal.h:
1329
1330 2006-08-31  Timothy Hatcher  <timothy@apple.com>
1331
1332         Reviewed by Geoff.
1333
1334         Band-aid fix for PCRE to compile for ppc64 and x86_64 now that
1335         we use -Wshorten-64-to-32. Adds an INT_CAST macro that ASSERTs
1336         the value <= INT_MAX.
1337
1338         I filed <rdar://problem/4712064> to track the need to verify
1339         PCRE's 64-bit compliance.
1340
1341         * pcre/pcre_compile.c:
1342         (complete_callout):
1343         (compile_branch):
1344         (compile_regex):
1345         (pcre_compile2):
1346         * pcre/pcre_exec.c:
1347         (match):
1348         (pcre_exec):
1349         * pcre/pcre_get.c:
1350         (pcre_get_substring_list):
1351         * pcre/pcre_internal.h:
1352         * pcre/pcre_tables.c:
1353         * pcre/pcre_try_flipped.c:
1354         (_pcre_try_flipped):
1355
1356 2006-08-30  Darin Adler  <darin@apple.com>
1357
1358         Reviewed by Tim Hatcher.
1359
1360         - add WTF::getPtr, a function template that makes it possible to write
1361           generic code that gets a raw pointer out of any of our pointer types
1362
1363         * JavaScriptCore.xcodeproj/project.pbxproj:
1364         * wtf/GetPtr.h: Added.
1365         * wtf/ListRefPtr.h: (WTF::getPtr): Added.
1366         * wtf/OwnArrayPtr.h: (WTF::getPtr): Added.
1367         * wtf/OwnPtr.h: (WTF::getPtr): Added.
1368         * wtf/PassRefPtr.h: (WTF::getPtr): Added.
1369         * wtf/RefPtr.h: (WTF::getPtr): Added.
1370
1371 2006-08-29  waylonis  <waylonis@google.com>
1372
1373         Reviewed, tweaked by ggaren.
1374
1375         - Added storage and accessor functions for ExecState as a fix for
1376           http://bugs.webkit.org/show_bug.cgi?id=10114
1377         
1378         * kjs/ExecState.cpp:
1379         (KJS::ExecState::ExecState):
1380         * kjs/ExecState.h:
1381         * kjs/context.h:
1382         (KJS::Context::setExecState):
1383         (KJS::Context::execState):
1384
1385 2006-08-30  Nikolas Zimmermann  <zimmermann@kde.org>
1386
1387         Reviewed by Tim H.
1388
1389         Commit KDE related tweaks, to be able to
1390         differentiate between a Qt-only or a KDE build.
1391
1392         * CMakeLists.txt: Install wtf-unity library.
1393         * wtf/Platform.h: Add define for the KDE platform.
1394
1395 2006-08-28  Darin Adler  <darin@apple.com>
1396
1397         Reviewed by Geoff.
1398
1399         * kjs/list.h: Use explicit in constructor (as appropriate).
1400
1401 2006-08-24  Nikolas Zimmermann  <zimmermann@kde.org>
1402
1403         Reviewed, tweaked and landed by ap
1404
1405         http://bugs.webkit.org/show_bug.cgi?id=10467
1406         WebKit should have Qt platform support (Part II)
1407
1408         * CMakeLists.txt: Adjust to Anders' build fixes.
1409         * wtf/Platform.h: Fix define for the Qt platform (we don't use/need Cairo.)
1410
1411 2006-08-23  David Hyatt  <hyatt@apple.com>
1412
1413         Fix Platform.h to include #defines for graphics features.
1414
1415         Reviewed by darin
1416
1417         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1418         * wtf/Platform.h:
1419
1420 2006-08-23  Anders Carlsson  <acarlsson@apple.com>
1421
1422         Reviewed by Darin.
1423
1424         Make the bindings compile without CoreFoundation.
1425         
1426         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1427         * bindings/c/c_instance.cpp:
1428         * bindings/c/c_utility.cpp:
1429         (KJS::Bindings::convertUTF8ToUTF16):
1430         * bindings/npapi.h:
1431         * bindings/runtime.cpp:
1432         (KJS::Bindings::Instance::createBindingForLanguageInstance):
1433         (KJS::Bindings::Instance::createLanguageInstanceForValue):
1434         * bindings/runtime_root.cpp:
1435         * bindings/runtime_root.h:
1436         * kjs/interpreter.cpp:
1437         (KJS::Interpreter::createLanguageInstanceForValue):
1438         * kjs/interpreter.h:
1439
1440 2006-08-22  Anders Carlsson  <acarlsson@apple.com>
1441
1442         Reviewed by Darin.
1443
1444         Move the npruntime code over to using HashMap and the runtime_root code over to using 
1445         HashMap and HashCountedSet.
1446         
1447         * bindings/NP_jsobject.cpp:
1448         * bindings/c/c_utility.cpp:
1449         (KJS::Bindings::identifierFromNPIdentifier):
1450         * bindings/c/c_utility.h:
1451         * bindings/jni/jni_jsobject.cpp:
1452         (JavaJSObject::invoke):
1453         * bindings/npruntime.cpp:
1454         (getStringIdentifierMap):
1455         (getIntIdentifierMap):
1456         (_NPN_GetStringIdentifier):
1457         (_NPN_GetIntIdentifier):
1458         * bindings/runtime_root.cpp:
1459         (getReferencesByRootMap):
1460         (getReferencesSet):
1461         (KJS::Bindings::findReferenceSet):
1462         (KJS::Bindings::rootForImp):
1463         (KJS::Bindings::rootForInterpreter):
1464         (KJS::Bindings::addNativeReference):
1465         (KJS::Bindings::removeNativeReference):
1466         (RootObject::removeAllNativeReferences):
1467         * bindings/runtime_root.h:
1468
1469 2006-08-22  Anders Carlsson  <acarlsson@apple.com>
1470
1471         Reviewed by Geoff.
1472         
1473         Switch over the NPAPI and Java bindings to using HashMaps instead of dictionaries.
1474         
1475         * JavaScriptCore.xcodeproj/project.pbxproj:
1476         * bindings/c/c_class.cpp:
1477         (KJS::Bindings::CClass::CClass):
1478         (KJS::Bindings::CClass::~CClass):
1479         (KJS::Bindings::CClass::classForIsA):
1480         (KJS::Bindings::CClass::methodsNamed):
1481         (KJS::Bindings::CClass::fieldNamed):
1482         * bindings/c/c_class.h:
1483         * bindings/jni/jni_class.cpp:
1484         (JavaClass::JavaClass):
1485         (JavaClass::~JavaClass):
1486         (JavaClass::methodsNamed):
1487         (JavaClass::fieldNamed):
1488         * bindings/jni/jni_class.h:
1489         * bindings/objc/objc_class.h:
1490         * bindings/objc/objc_class.mm:
1491         (KJS::Bindings::deleteMethod):
1492         (KJS::Bindings::deleteField):
1493         (KJS::Bindings::):
1494         (KJS::Bindings::ObjcClass::methodsNamed):
1495         (KJS::Bindings::ObjcClass::fieldNamed):
1496         * bindings/runtime.cpp:
1497         * bindings/runtime.h:
1498         * bindings/runtime_object.cpp:
1499         (RuntimeObjectImp::fieldGetter):
1500         (RuntimeObjectImp::getOwnPropertySlot):
1501         (RuntimeObjectImp::put):
1502         (RuntimeObjectImp::canPut):
1503
1504 2006-08-21  Vladimir Olexa  <vladimir.olexa@gmail.com>
1505
1506         Reviewed by Darin.
1507
1508         http://bugs.webkit.org/show_bug.cgi?id=6252
1509         JavaScript 1.6 Array.lastIndexOf
1510
1511         Test: fast/js/array-lastIndexOf.html
1512
1513         * kjs/array_object.cpp:
1514         (ArrayProtoFunc::callAsFunction): Added a LastIndexOf case.
1515         * kjs/array_object.h:
1516         (KJS::ArrayProtoFunc::): Added LastIndexOf to enum.
1517         * tests/mozilla/expected.html: Two more tests now pass.
1518
1519 2006-08-20  Nikolas Zimmermann  <zimmermann@kde.org>
1520
1521         Reviewed by Maciej. Landed by rwlbuis.
1522
1523         Fixes parts of: http://bugs.webkit.org/show_bug.cgi?id=10463
1524         WebKit should have Qt platform support
1525
1526         Removing obsolete QConstString/QString constructors in kjs code.
1527
1528         * kjs/identifier.h:
1529         * kjs/ustring.h:
1530
1531 2006-08-17  Nikolas Zimmermann  <zimmermann@kde.org>
1532
1533         Reviewed by Maciej. Landed by rwlbuis.
1534
1535         Fixes: http://bugs.webkit.org/show_bug.cgi?id=10463
1536         WTF Changes needed for Qt platform code.
1537
1538         * wtf/Platform.h:
1539         * wtf/unicode/UnicodeDecomposition.h: Added.
1540         (WTF::Unicode::):
1541         * wtf/unicode/UnicodeDirection.h: Added.
1542         (WTF::Unicode::):
1543         * wtf/unicode/qt4/UnicodeQt4.cpp: Added.
1544         (WTF::Unicode::direction):
1545         (WTF::Unicode::category):
1546         (WTF::Unicode::decomposition):
1547         * wtf/unicode/qt4/UnicodeQt4.h:
1548         (WTF::Unicode::toLower):
1549         (WTF::Unicode::toUpper):
1550         (WTF::Unicode::isPrintableChar):
1551         (WTF::Unicode::isSpace):
1552         (WTF::Unicode::isPunct):
1553         (WTF::Unicode::isDigit):
1554         (WTF::Unicode::mirroredChar):
1555         (WTF::Unicode::compare):
1556
1557 2006-08-17  Nikolas Zimmermann  <zimmermann@kde.org>
1558
1559         Reviewed by Eric. Landed by rwlbuis.
1560
1561         Fixes: http://bugs.webkit.org/show_bug.cgi?id=10464
1562         Offer a cmake build system for Qt platform.
1563
1564         * CMakeLists.txt: Added.
1565         * pcre/CMakeLists.txt: Added.
1566
1567 2006-08-17  Anders Carlsson  <acarlsson@apple.com>
1568
1569         Reviewed by Maciej.
1570
1571         * bindings/npapi.h:
1572         Fix ifdef.
1573
1574 2006-08-15  Steve Falkenburg  <sfalken@apple.com>
1575
1576         Reviewed by mjs.
1577         
1578         Build fix.
1579
1580         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1581         * wtf/Assertions.h:
1582
1583 2006-08-15  Mark Rowe  <opendarwin.org@bdash.net.nz>
1584
1585         Reviewed by Tim H.
1586
1587         Build fix:  DWARF and -gfull are incompatible with symbol separation.
1588
1589         * JavaScriptCore.xcodeproj/project.pbxproj:
1590
1591 2006-08-15  Mark Rowe  <opendarwin.org@bdash.net.nz>
1592
1593         Reviewed by Tim H.
1594
1595         http://bugs.webkit.org/show_bug.cgi?id=10394
1596         Bug 10394: WebKit Release and Production configurations should enable dead code stripping
1597
1598         * JavaScriptCore.xcodeproj/project.pbxproj:
1599
1600 2006-08-15  Mark Rowe  <opendarwin.org@bdash.net.nz>
1601
1602         Reviewed by Tim H.
1603
1604         http://bugs.webkit.org/show_bug.cgi?id=10384
1605         Bug 10384: Switch to DWARF for Release configuration
1606
1607         * JavaScriptCore.xcodeproj/project.pbxproj:
1608
1609 2006-08-13  Maks Orlovich  <maksim@kde.org>
1610
1611         Reviewed (and tweaked a little) by Maciej.
1612         
1613         - shrank the size of JSObject by 8 bytes and made the corresponding reduction to the cell size, resulting
1614         in a 1.2% speed improvement on JS iBench (and probably overall memory savings).
1615
1616         This was done by removing _scope and _internalValue data members
1617         from JSObject and moving them only to the subclasses that actually
1618         make use of them.
1619         
1620         * kjs/object.cpp: 
1621         (KJS::JSObject::mark): No need to mark scope or internal value here.
1622         * kjs/object.h:
1623         (KJS::JSObject::JSObject): Don't initialize them.
1624         * kjs/JSWrapperObject.cpp: Added. New base class for object types that
1625         wrap primitive values (Number, String, Boolean, Date).
1626         (KJS::JSWrapperObject::mark): 
1627         * kjs/JSWrapperObject.h: Added.
1628         (KJS::JSWrapperObject::JSWrapperObject):
1629         (KJS::JSWrapperObject::internalValue):
1630         (KJS::JSWrapperObject::setInternalValue):
1631         * kjs/array_object.cpp:
1632         (ArrayPrototype::ArrayPrototype): Don't set useless internal value.
1633         * kjs/bool_object.cpp:
1634         (BooleanInstance::BooleanInstance): Inherit from JSWrapperObject.
1635         (BooleanProtoFunc::callAsFunction): Fixed to account for fact that not all
1636         JSObjects have an internal value.
1637         (BooleanObjectImp::construct): ditto.
1638         * kjs/bool_object.h:
1639         * kjs/collector.cpp: Lowered cell size to 48.
1640         (KJS::Collector::allocate): meaningless whitespace change
1641         * kjs/date_object.cpp:
1642         (KJS::DateInstance::DateInstance): Inherit from JSWrapperObject.
1643         (KJS::DateProtoFunc::callAsFunction): adjusted for move of internalValue
1644         (KJS::DateObjectImp::construct): ditto
1645         * kjs/date_object.h:
1646         * kjs/error_object.cpp:
1647         (ErrorPrototype::ErrorPrototype): don't set internal value
1648         * kjs/function.cpp: move _scope and related handling here
1649         (KJS::FunctionImp::mark): mark scope
1650         * kjs/function.h:
1651         (KJS::FunctionImp::scope): moved here from JSObject
1652         (KJS::FunctionImp::setScope): ditto
1653         * kjs/number_object.cpp:
1654         (NumberInstance::NumberInstance): inherit from JSWrapperObject
1655         (NumberProtoFunc::callAsFunction): adjusted
1656         (NumberObjectImp::construct): adjusted
1657         * kjs/number_object.h: shring RegExp-related objects a little
1658         * kjs/regexp_object.cpp:
1659         (RegExpPrototype::RegExpPrototype): Adjust for size tweaks
1660         (RegExpObjectImp::RegExpObjectImp): ditto
1661         * kjs/regexp_object.h:
1662         * kjs/string_object.cpp:
1663         (StringInstance::StringInstance): inherit from JSWrapperObject
1664         (StringProtoFunc::callAsFunction): adjusted
1665         * kjs/string_object.h:
1666         * JavaScriptCore.exp: Exported new methods as needed.
1667         * JavaScriptCore.xcodeproj/project.pbxproj: Added new files to build.
1668
1669 2006-08-04  Brady Eidson  <beidson@apple.com>
1670
1671         Reviewed by Geoff's rubber stamp
1672
1673         Fix a build break on Intel hardware causes by adapting stricter
1674         compiler warnings (-Wshorten-64-to-32)
1675
1676         * API/testapi.c:
1677         (assertEqualsAsNumber): manually cast some doubles to floats
1678         (main): ditto
1679
1680 2006-08-04  Sam Weinig  <sam.weinig@gmail.com>
1681
1682         Reviewed by Darin.
1683
1684         - patch for http://bugs.webkit.org/show_bug.cgi?id=10192
1685           Make WebCore (and friends) compile with -Wshorten-64-to-32
1686
1687           * Adds -Wshorten-64-to-32 flag to Xcode project.
1688           * Adds explicit casts where OK.
1689
1690         * API/JSNodeList.c:
1691         (JSNodeList_item):
1692         (JSNodeList_getProperty):
1693         * JavaScriptCore.xcodeproj/project.pbxproj:
1694
1695 2006-08-04  Adam Roben  <aroben@apple.com>
1696
1697         Reviewed by Anders.
1698
1699         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Convert
1700         spaces to tabs
1701
1702 2006-08-03  Sam Weinig  <sam.weinig@gmail.com>
1703
1704         Reviewed by Darin.
1705
1706         - patch for http://bugs.webkit.org/show_bug.cgi?id=10176
1707           Make WebCore compile with -Wundef
1708
1709           * Adds -Wundef flag to Xcode project
1710           * Converts #ifs to #ifdef and #ifndefs where needed.
1711           * Added #define YYMAXDEPTH 10000 in kjs/grammar.y
1712             to fix a warning from within Bison.
1713
1714         * JavaScriptCore.xcodeproj/project.pbxproj:
1715         * bindings/jni/jni_jsobject.cpp:
1716         (JavaJSObject::getSlot):
1717         (JavaJSObject::setSlot):
1718         * bindings/npapi.h:
1719         * bindings/objc/objc_class.mm:
1720         (KJS::Bindings::ObjcClass::methodsNamed):
1721         (KJS::Bindings::ObjcClass::fieldNamed):
1722         * bindings/objc/objc_instance.mm:
1723         (ObjcInstance::invokeMethod):
1724         * bindings/objc/objc_runtime.mm:
1725         (ObjcMethod::getMethodSignature):
1726         (ObjcField::name):
1727         (ObjcField::type):
1728         * kjs/grammar.y:
1729         * kjs/identifier.h:
1730
1731 2006-08-03  Anders Carlsson  <acarlsson@apple.com>
1732
1733         Reviewed by John Sullivan.
1734
1735        * wtf/HashSet.h:
1736         (WTF::::operator):
1737         Return *this in operator=
1738
1739 2006-08-03  Adam Roben  <aroben@apple.com>
1740
1741         Reviewed by Anders.
1742
1743         - Fixed Windows build
1744
1745         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1746         * wtf/MathExtras.h: Implement inline versions of these functions
1747         (nextafter):
1748         (nextafterf):
1749
1750 2006-08-02  Adam Roben  <aroben@apple.com>
1751
1752         Reviewed by Darin.
1753
1754         - Fixed build
1755
1756         * kjs/date_object.cpp:
1757         (KJS::formatTime):
1758
1759 2006-07-29  Darin Adler  <darin@apple.com>
1760
1761         - Removed tabs from these source files that still had them.
1762           We don't use them; that way source files look fine in editors
1763           that have tabs set to 8 spaces or to 4 spaces.
1764         - Removed allow-tabs Subversion property from the files too.
1765
1766         * bindings/NP_jsobject.cpp:
1767         * bindings/c/c_utility.cpp:
1768         * bindings/jni/jni_runtime.cpp:
1769         * bindings/jni/jni_utility.cpp:
1770         * bindings/objc/objc_utility.mm:
1771         * bindings/runtime.cpp:
1772         * bindings/runtime_method.cpp:
1773         * bindings/testbindings.cpp:
1774         * bindings/testbindings.mm:
1775         * kjs/date_object.cpp:
1776         * kjs/function.cpp:
1777         * kjs/list.cpp:
1778         * kjs/nodes.cpp:
1779         * kjs/nodes.h:
1780         * kjs/string_object.cpp:
1781         * kjs/ustring.cpp:
1782
1783 2006-07-29  Darin Adler  <darin@apple.com>
1784
1785         * tests/mozilla/expected.html: Update test results now that regress-185165.js
1786         is succeeding. I suspect Anders fix for bug 4620655 is the reason.
1787
1788 2006-07-29  Sam Weinig  <sam.weinig@gmail.com>
1789
1790         Reviewed by Darin.
1791
1792         - patch for http://bugs.webkit.org/show_bug.cgi?id=10080
1793           Adopt pedantic changes from the Unity project to improve 
1794           cross-compiler compatibility
1795
1796           Changes include:
1797           * Removing trailing semicolon from namespace braces.
1798           * Removing trailing comma from last enum declaration.
1799           * Updating to match style guidelines.
1800           * Adding missing newline to the end of the file.
1801           * Turning on gcc warning for missing newline at the end of a source file
1802             (GCC_WARN_ABOUT_MISSING_NEWLINE in Xcode, -Wnewline in gcc).
1803           * Alphabetical sorting of Xcode source list files. 
1804           * Replace use of non-portable variable-size array with Vector.
1805           * Use C-style comments instead of C++ comments in files that might
1806             be included by either C or C++ files.
1807
1808         * API/JSCallbackConstructor.cpp:
1809         (KJS::JSCallbackConstructor::construct):
1810         * API/JSCallbackFunction.cpp:
1811         (KJS::JSCallbackFunction::callAsFunction):
1812         * API/JSCallbackObject.cpp:
1813         (KJS::JSCallbackObject::construct):
1814         (KJS::JSCallbackObject::callAsFunction):
1815         * JavaScriptCore.xcodeproj/project.pbxproj:
1816         * JavaScriptCorePrefix.h:
1817         * bindings/jni/jni_class.cpp:
1818         (JavaClass::fieldNamed):
1819         * bindings/jni/jni_class.h:
1820         * bindings/jni/jni_instance.cpp:
1821         (JavaInstance::JavaInstance):
1822         (JavaInstance::valueOf):
1823         * bindings/jni/jni_objc.mm:
1824         (KJS::Bindings::dispatchJNICall):
1825         * bindings/jni/jni_runtime.cpp:
1826         (JavaParameter::JavaParameter):
1827         (JavaArray::JavaArray):
1828         * bindings/jni/jni_runtime.h:
1829         * bindings/jni/jni_utility.h:
1830         * bindings/objc/objc_instance.h:
1831         * bindings/runtime_array.h:
1832         * kjs/collector.h:
1833         * kjs/config.h:
1834         * kjs/ustring.cpp:
1835         * wtf/Platform.h:
1836
1837 2006-07-29  Mike Emmel  <mike.emmel@gmail.com>
1838
1839         Reviewed by Darin.
1840
1841         - fixes for Linux build
1842
1843         * JavaScriptCoreSources.bkl: Added new files to build, kjs/PropertyNameArray.cpp
1844         and kjs/testkjs.cpp, and removed old files.
1845
1846 2006-07-24  Dan Waylonis  <waylonis@google.com>
1847
1848         Reviewed and tweaked a bit by Darin.
1849
1850         - fix http://bugs.webkit.org/show_bug.cgi?id=9902
1851           jsNull and NSNull not properly converted between JS and ObjC
1852
1853         * bindings/objc/objc_utility.mm: (KJS::Bindings::convertObjcValueToValue):
1854         Added case for converting NSNull to jsNull.
1855
1856 2006-07-24  Rob Buis  <buis@kde.org>
1857
1858         Reviewed by Darin.
1859
1860         http://bugs.webkit.org/show_bug.cgi?id=4258
1861         Date().toString() only includes GMT offset, not timezone string
1862
1863         Use the info in tm_zone to append timezone abbreviation
1864         to Date().toString().
1865
1866         * kjs/date_object.cpp:
1867         (KJS::formatTime):
1868
1869 2006-07-24  Rob Buis  <buis@kde.org>
1870
1871         Reviewed by Darin.
1872
1873         http://bugs.webkit.org/show_bug.cgi?id=5257
1874         setYear() does not match FireFox/IE behavior
1875
1876         Make sure the right values end up in tm_year.
1877
1878         * kjs/date_object.cpp:
1879         (KJS::formatTime):
1880
1881 2006-07-23  Mark Rowe  <opendarwin.org@bdash.net.nz>
1882
1883         Reviewed by Maciej.
1884
1885         Bug 9686: [Drosera] Need the ability to break into Drosera on Javascript exceptions
1886         http://bugs.webkit.org/show_bug.cgi?id=9686
1887
1888         JavaScriptCore portion of the fix.
1889
1890         * JavaScriptCore.exp: Update symbol for change in argument type.
1891         * kjs/debugger.cpp:
1892         (Debugger::detach): Clear map of recent exceptions.
1893         (Debugger::hasHandledException): Track the most recent exception
1894         thrown by an interpreter.
1895         (Debugger::exception): Change exception argument to a JSValue.
1896         * kjs/debugger.h:
1897         * kjs/nodes.cpp:
1898         (Node::debugExceptionIfNeeded): Notify the debugger of an exception
1899         if it hasn't seen it before.
1900         (ThrowNode::execute): Notify the debugger that an exception is being thrown.
1901         * kjs/nodes.h:
1902
1903     2006-07-23  Geoffrey Garen  <ggaren@apple.com>
1904
1905         Patch by Eric Albert, reviewed by Darin and me.
1906         
1907         - Fixed <rdar://problem/4645931> JavaScriptCore stack-scanning code 
1908         crashes (Collector::markStackObjectsConservatively)
1909         
1910         * bindings/jni/jni_jsobject.cpp: On 64bit systems, jint is a long, not an
1911         int.
1912         (JavaJSObject::getSlot):
1913         (JavaJSObject::setSlot):
1914         * kjs/collector.cpp:
1915         (KJS::Collector::markCurrentThreadConservatively): Use a pointer instead of
1916         an int as 'dummy,' because on LP64 systems, an int is not pointer-aligned,
1917         and we want to scan the stack for pointers.
1918         * JavaScriptCore.xcodeproj/project.pbxproj: After a tense cease-fire, the 
1919         XCode war has started up again!
1920
1921 === Safari-521.20 ===
1922
1923 2006-07-21  Geoffrey Garen  <ggaren@apple.com>
1924
1925         Reviewed by Darin.
1926
1927         <rdar://problem/4507265> REGRESSION: overlays don't work on HousingMaps.com (Google Maps-based site)
1928
1929         - Added support for strings that masquerade as undefined. Currently used
1930         by WebCore to implement undetectable style.filter.
1931         
1932         The name is a little long, but it's only used in one line of code, so I
1933         thought clarity should win over brevity.
1934
1935         * JavaScriptCore.exp:
1936         * JavaScriptCore.xcodeproj/project.pbxproj:
1937         * kjs/object.h:
1938         * kjs/string_object.h:
1939         (KJS::StringInstanceThatMasqueradesAsUndefined::StringInstanceThatMasqueradesAsUndefined):
1940         (KJS::StringInstanceThatMasqueradesAsUndefined::masqueradeAsUndefined):
1941         (KJS::StringInstanceThatMasqueradesAsUndefined::toBoolean):
1942
1943 === Safari-521.19 ===
1944
1945 2006-07-20  Steve Falkenburg  <sfalken@apple.com>
1946
1947         Fix the build
1948
1949         * kjs/function.cpp:
1950         (KJS::escapeStringForPrettyPrinting):
1951
1952 2006-07-19  Anders Carlsson  <acarlsson@apple.com>
1953
1954         Reviewed by Darin.
1955
1956         <rdar://problem/4620655> REGRESSION(10.4.7-10.5): preview button for a blogger.com post doesn't work
1957         
1958         * kjs/nodes2string.cpp:
1959         (StringNode::streamTo):
1960         Return the escaped string.
1961         
1962         (RegExpNode::streamTo):
1963         Use the correct syntax.
1964         
1965         * kjs/function.cpp:
1966         (KJS::escapeStringForPrettyPrinting):
1967         * kjs/function.h:
1968         Add escape function which escapes a string for pretty-printing so it can be parsed again.
1969         
1970         * wtf/unicode/icu/UnicodeIcu.h:
1971         (WTF::Unicode::isPrintableChar):
1972         New function.
1973
1974 2006-07-18  Maciej Stachowiak  <mjs@apple.com>
1975
1976         Reviewed by Adele Peterson.
1977         
1978         <rdar://problem/4589530> REGRESSION: null character in JS string causes parse error (works in Tiger and in other browsers)
1979
1980         * kjs/lexer.cpp:
1981         (Lexer::shift):
1982         (Lexer::lex):
1983         (Lexer::record16):
1984         (Lexer::scanRegExp):
1985         * kjs/lexer.h:
1986
1987 2006-07-18  Tim Omernick  <timo@apple.com>
1988
1989         Reviewed by Tim Hatcher.
1990
1991         Removed a misleading comment; we recently added support for the NPNVPluginElementNPObject
1992         variable.
1993
1994         * bindings/npapi.h:
1995
1996 === Safari-521.18 ===
1997
1998 2006-07-18  Timothy Hatcher  <timothy@apple.com>
1999
2000         Made the following headers public:
2001
2002         * JavaScriptCore.h
2003         * JSBase.h
2004         * JSContextRef.h
2005         * JSObjectRef.h
2006         * JSStringRef.h
2007         * JSValueRef.h
2008
2009         * JavaScriptCore.xcodeproj/project.pbxproj:
2010
2011 2006-07-17  Geoffrey Garen  <ggaren@apple.com>
2012
2013         Reviewed by Maciej.
2014         
2015         - Added automatic prototype creation for classes.
2016         
2017         A class stores a weak reference to a prototype, which is cleared when
2018         the prototype is garbage collected, to avoid a reference cycle.
2019         
2020         We now have an attributes field in JSClassDefinition, that currently is
2021         used only to override automatic prototype creation when you want to manage your
2022         own prototypes, but can be extended in the future for other nefarious purposes.
2023         
2024         Similarly, we have JSObjectMake and JSObjectMakeWithPrototype, the latter
2025         allowing you to manage your own prototypes.
2026         
2027         JSObjectMakeConstructor is more interesting now, able to make a constructor
2028         on your behalf if you just give it a class.
2029         
2030         - Removed bogus old code from minidom.js.
2031         
2032         - Tweaked the headerdocs.
2033         
2034         - Added more GC testing, which caught some leaks, and tested more funny 
2035         edge cases in lookup, which caught a lookup bug. Removed some testing 
2036         we used to do with MyObject because it was redundant with the new, cool 
2037         stuff.
2038         
2039         While fixing the lookup bug I retracted this change:
2040         
2041             "If a static setProperty callback returns 'false', to indicate that the
2042             property was not set, we no longer forward the set request up the class
2043             chain, because that's almost certainly not what the programmer expected."
2044
2045         Returning false when setting a static property is a little silly, but you can see
2046         it being useful when shadowing a base class's static properties, and, regardless
2047         of usefullness, this is the defined behavior of the setProperty callback.
2048         
2049         - Plus a little ASCII art, for the kids.
2050
2051 2006-07-17  Timothy Hatcher  <timothy@apple.com>
2052
2053         Reviewed by Maciej.
2054
2055         <rdar://problem/4634874> WebScriptObject and WebUndefined are no longer defined by WebKit
2056
2057         Moves WebScriptObject and WebUndefined up to WebCore.
2058         This change does create an upwards-dependancy on WebScriptObject existing
2059         in the loaded process, but this code path in JavaScriptCore does not get used
2060         unless it is through WebKit/WebCore. Moving all of the binding code out of
2061         JavaScriptCore might make sense in the future.
2062
2063         * JavaScriptCore.exp:
2064         * JavaScriptCore.xcodeproj/project.pbxproj:
2065         * bindings/objc/WebScriptObject.h: Replaced.
2066         * bindings/objc/WebScriptObject.mm: Removed.
2067         * bindings/objc/WebScriptObjectPrivate.h: Removed.
2068         * bindings/objc/objc_class.h:
2069         * bindings/objc/objc_instance.h:
2070         * bindings/objc/objc_instance.mm:
2071         (ObjcInstance::~ObjcInstance):
2072         * bindings/objc/objc_runtime.h:
2073         * bindings/objc/objc_runtime.mm:
2074         (convertValueToObjcObject):
2075         * bindings/objc/objc_utility.mm:
2076         (KJS::Bindings::convertValueToObjcValue):
2077         (KJS::Bindings::convertObjcValueToValue):
2078         (KJS::Bindings::createObjcInstanceForValue):
2079
2080 2006-07-17  Darin Adler  <darin@apple.com>
2081
2082         * API/JSBase.h: Fix comment formatting where things used to be lined up but
2083         are now ragged. Got rid of spaces that attempted to line things up.
2084         * API/JSObjectRef.h: Ditto. Also add missing periods for a couple of comments.
2085
2086 2006-07-17  Geoffrey Garen  <ggaren@apple.com>
2087
2088         Reviewed by Maciej.
2089         
2090         - Removed the exception parameter from the initialize callback and, by extension,
2091         JSObjectMake. We have never had a need for exceptions when iniitializing,
2092         so the parameter seemed likely to "get in the way." 
2093         
2094         Also, an exception in JavaScript is thrown in response to input -- 
2095         "invalid URL", "index not a number", etc., so it's the job of the 
2096         constructor function, not the initialize method, to throw.
2097         
2098         If initialize *really* wants to throw, it can communicate the throw to
2099         the constructor through the constructed object's private data (e.g., set
2100         it to NULL, signaling to the consntructor that initialization failed.)
2101         
2102         - Added JSObjectMakeWithData, which enables a constructor to set private
2103         data on an object *before* it has been initialized. That way, the initialize
2104         methods can properly operate on the data. 
2105
2106         * API/JSNode.c: Moved ref into the initialize method, for better encapsulation,
2107         now that it's possible.
2108         * API/JSNodeList.c: ditto
2109         * API/minidom.c:
2110         (main): Do more aggressive garbage collection to test ref/deref and 
2111         initialize/finalize.
2112         * API/minidom.js: store childNodes in a temporary so it doesn't get re-created
2113         like a thousand times. This makes debugging ref/deref easier
2114
2115 2006-07-17  Geoffrey Garen  <ggaren@apple.com>
2116
2117         Reviewed by Maciej.
2118         
2119         - Changed the initialize callback to run from least derived class (parent
2120         class) to most derived class. This enables C++ style initialization,
2121         and derived class overriding of member data.
2122         
2123         - Added excpetion propopgation to JSObjectMake, to support initialize
2124         exceptions, and generally round out our policy of making function
2125         signatures as long as possible.
2126
2127         * API/JSCallbackObject.h: Use ExecState instead of ContextRef, cuz we're
2128         in C++ land now.
2129
2130 2006-07-17  Geoffrey Garen  <ggaren@apple.com>
2131
2132         Reviewed by Maciej.
2133         
2134         - Changed JSObjectMakeConstructor to JSObjectMakeConstructorWithCallback,
2135         to match JSObjectMakeFunctionWithCallback.
2136         
2137         - Added prototype parameter, so the generated constructor
2138         automatically works with hasInstance / instanceof
2139         
2140         - Moved hasInstance implementation from InternalFunctionImp to JSObject
2141         so that subclasses can inherit it without inheriting function-related baggage.
2142         More refactoring here would be good, but this seems like a good short-term
2143         solution.
2144
2145         (KJS::JSCallbackFunction::implementsHasInstance): override and return false,
2146         because callback functions aren't constructors.
2147
2148 2006-07-17  Maciej Stachowiak  <mjs@apple.com>
2149
2150         Reviewed by Geoff.
2151         
2152         - add a JSContextRef parameter to all JSValueRef, JSObjectRef, and JSContextRef operations;
2153         except JSObject{Get,Set}PrivateData which can be assumed to be simple pure accessors.
2154         
2155         Also renamed the parameter "context" to "ctx" because it makes the code read better with this pervasive
2156         but usually uninteresting parameter.
2157
2158         * API/JSBase.cpp:
2159         (JSEvaluateScript):
2160         (JSCheckScriptSyntax):
2161         (JSGarbageCollect):
2162         * API/JSBase.h:
2163         * API/JSCallbackObject.cpp:
2164         (KJS::JSCallbackObject::JSCallbackObject):
2165         (KJS::JSCallbackObject::init):
2166         (KJS::JSCallbackObject::getOwnPropertySlot):
2167         (KJS::JSCallbackObject::put):
2168         (KJS::JSCallbackObject::deleteProperty):
2169         (KJS::JSCallbackObject::toNumber):
2170         (KJS::JSCallbackObject::toString):
2171         * API/JSContextRef.cpp:
2172         (JSGlobalContextCreate):
2173         (JSGlobalContextRetain):
2174         (JSGlobalContextRelease):
2175         (JSContextGetGlobalObject):
2176         * API/JSContextRef.h:
2177         * API/JSNode.c:
2178         (JSNodePrototype_appendChild):
2179         (JSNodePrototype_removeChild):
2180         (JSNodePrototype_replaceChild):
2181         (JSNode_getNodeType):
2182         (JSNode_getFirstChild):
2183         (JSNode_prototype):
2184         * API/JSNodeList.c:
2185         (JSNodeListPrototype_item):
2186         (JSNodeList_length):
2187         (JSNodeList_getProperty):
2188         (JSNodeList_prototype):
2189         * API/JSObjectRef.cpp:
2190         (JSObjectMake):
2191         (JSObjectMakeFunctionWithCallback):
2192         (JSObjectMakeConstructor):
2193         (JSObjectMakeFunction):
2194         (JSObjectGetPrototype):
2195         (JSObjectSetPrototype):
2196         (JSObjectHasProperty):
2197         (JSObjectGetProperty):
2198         (JSObjectSetProperty):
2199         (JSObjectGetPropertyAtIndex):
2200         (JSObjectSetPropertyAtIndex):
2201         (JSObjectDeleteProperty):
2202         (JSObjectIsFunction):
2203         (JSObjectCallAsFunction):
2204         (JSObjectIsConstructor):
2205         (JSObjectCallAsConstructor):
2206         (JSObjectCopyPropertyNames):
2207         * API/JSObjectRef.h:
2208         * API/JSStringRef.cpp:
2209         * API/JSValueRef.cpp:
2210         (JSValueGetType):
2211         (JSValueIsUndefined):
2212         (JSValueIsNull):
2213         (JSValueIsBoolean):
2214         (JSValueIsNumber):
2215         (JSValueIsString):
2216         (JSValueIsObject):
2217         (JSValueIsObjectOfClass):
2218         (JSValueIsEqual):
2219         (JSValueIsStrictEqual):
2220         (JSValueIsInstanceOfConstructor):
2221         (JSValueMakeUndefined):
2222         (JSValueMakeNull):
2223         (JSValueMakeBoolean):
2224         (JSValueMakeNumber):
2225         (JSValueMakeString):
2226         (JSValueToBoolean):
2227         (JSValueToNumber):
2228         (JSValueToStringCopy):
2229         (JSValueToObject):
2230         (JSValueProtect):
2231         (JSValueUnprotect):
2232         * API/JSValueRef.h:
2233         * API/minidom.c:
2234         (print):
2235         * API/testapi.c:
2236         (MyObject_getProperty):
2237         (MyObject_deleteProperty):
2238         (MyObject_callAsFunction):
2239         (MyObject_callAsConstructor):
2240         (MyObject_convertToType):
2241         (print_callAsFunction):
2242         (main):
2243
2244 2006-07-16  Geoffrey Garen  <ggaren@apple.com>
2245
2246         Approved by Maciej, RS by Beth.
2247         
2248         JSObjectMakeFunction -> JSObjectMakeFunctionWithCallback
2249         JSObjectMakeFunctionWithBody -> JSObjectMakeFunction
2250         
2251         because the latter is more common, and more fundamental, than the former.
2252
2253         * API/APICast.h:
2254         (toJS):
2255         * API/JSBase.h:
2256         * API/JSCallbackObject.cpp:
2257         (KJS::JSCallbackObject::getOwnPropertySlot):
2258         (KJS::JSCallbackObject::put):
2259         (KJS::JSCallbackObject::deleteProperty):
2260         (KJS::JSCallbackObject::getPropertyNames):
2261         (KJS::JSCallbackObject::staticValueGetter):
2262         (KJS::JSCallbackObject::staticFunctionGetter):
2263         * API/JSClassRef.cpp:
2264         (OpaqueJSClass::OpaqueJSClass):
2265         (OpaqueJSClass::~OpaqueJSClass):
2266         * API/JSClassRef.h:
2267         * API/JSObjectRef.cpp:
2268         (JSClassCreate):
2269         (JSObjectMakeFunctionWithCallback):
2270         (JSObjectMakeFunction):
2271         (OpaqueJSPropertyNameArray::OpaqueJSPropertyNameArray):
2272         (JSObjectCopyPropertyNames):
2273         * API/JSObjectRef.h:
2274         * API/minidom.c:
2275         (main):
2276         * API/testapi.c:
2277         (main):
2278         * ChangeLog:
2279         * JavaScriptCore.exp:
2280
2281 2006-07-16  Geoffrey Garen  <ggaren@apple.com>
2282
2283         Laughed at by Beth.
2284         
2285         Replace __JS with OpaqueJS because the former, while used by CF, is
2286         a prefix that's triply-reserved by the compiler. (_* is reserved in global 
2287         names, _[A-Z] is reserved in all names, and __ is reserved in all names 
2288         in C++.)
2289         
2290         Opaque is an alternative used by other Mac OS X framewokrs.
2291
2292         * API/APICast.h:
2293         (toJS):
2294         * API/JSBase.h:
2295         * API/JSCallbackObject.cpp:
2296         (KJS::JSCallbackObject::getOwnPropertySlot):
2297         (KJS::JSCallbackObject::put):
2298         (KJS::JSCallbackObject::deleteProperty):
2299         (KJS::JSCallbackObject::getPropertyNames):
2300         (KJS::JSCallbackObject::staticValueGetter):
2301         (KJS::JSCallbackObject::staticFunctionGetter):
2302         * API/JSClassRef.cpp:
2303         (OpaqueJSClass::OpaqueJSClass):
2304         (OpaqueJSClass::~OpaqueJSClass):
2305         * API/JSClassRef.h:
2306         * API/JSObjectRef.cpp:
2307         (JSClassCreate):
2308         (OpaqueJSPropertyNameArray::OpaqueJSPropertyNameArray):
2309         (JSObjectCopyPropertyNames):
2310
2311 2006-07-16  Darin Adler  <darin@apple.com>
2312
2313         - try to fix Windows build
2314
2315         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2316         Added some recently added files, removed some recently removed.
2317
2318 2006-07-16  Geoffrey Garen  <ggaren@apple.com>
2319
2320         Reviewed by Maciej.
2321         
2322         - Change getProperty* to return undefined, rather than NULL, for missing
2323         properties, since that's what the spec says. Also added exception out
2324         parameters to the *Index functions, because they can call through to the
2325         regular functions, which can throw for custom objects.
2326
2327         * API/JSObjectRef.cpp:
2328         (JSObjectGetProperty):
2329         (JSObjectGetPropertyAtIndex):
2330         (JSObjectSetPropertyAtIndex):
2331         * API/JSObjectRef.h:
2332         * API/testapi.c:
2333         (main):
2334
2335 2006-07-16  Geoffrey Garen  <ggaren@apple.com>
2336
2337         Reviewed by Maciej.
2338         
2339         - Properly document and handle NULL callbacks for static properties. We
2340         throw an exception in any case other than a ReadOnly property with a NULL
2341         setProperty callback, because a NULL callback almost certainly indicates 
2342         a programming error. Also throw an exception if hasProperty returns true
2343         for a property that getProperty can't get.
2344         
2345         - If a static setProperty callback returns 'false', to indicate that the
2346         property was not set, we no longer forward the set request up the class
2347         chain, because that's almost certainly not what the programmer expected.
2348
2349         * API/JSCallbackObject.cpp:
2350         (KJS::JSCallbackObject::getOwnPropertySlot):
2351         (KJS::JSCallbackObject::put):
2352         (KJS::JSCallbackObject::staticValueGetter):
2353         (KJS::JSCallbackObject::staticFunctionGetter):
2354         (KJS::JSCallbackObject::callbackGetter):
2355         * API/JSObjectRef.h:
2356         * API/minidom.js:
2357         * API/testapi.c:
2358         (MyObject_hasProperty):
2359         * API/testapi.js:
2360
2361 2006-07-16  Geoffrey Garen  <ggaren@apple.com>
2362
2363         Reviewed by Maciej.
2364         
2365         - Added names to functions.
2366         
2367         - Removed GetPrivate/SetPrivate from callbackFunctions and callbackConstructors.
2368         The private data idiom is that a JS object stores its native implementation
2369         as private data. For functions and constructors, the native implementation is nothing
2370         more than the callback they already store, so supporting private data, too,
2371         confuses the idiom. If you *really* want, you can still create a custom 
2372         function with private data.
2373
2374         * API/JSCallbackConstructor.cpp:
2375         * API/JSCallbackConstructor.h:
2376         * API/JSCallbackFunction.cpp:
2377         (KJS::JSCallbackFunction::JSCallbackFunction):
2378         * API/JSCallbackFunction.h:
2379         * API/JSCallbackObject.cpp:
2380         (KJS::JSCallbackObject::staticFunctionGetter):
2381         * API/JSObjectRef.cpp:
2382         (JSObjectMakeFunction):
2383         (JSObjectMakeFunctionWithBody):
2384         (JSObjectGetPrivate):
2385         (JSObjectSetPrivate):
2386         * API/JSObjectRef.h:
2387         * API/minidom.c:
2388         (main):
2389         * API/testapi.c:
2390         (main):
2391
2392 2006-07-15  Maciej Stachowiak  <mjs@apple.com>
2393
2394         Reviewed by Darin.
2395         
2396         - switch property lists to be vector+set of Identifiers instead of list of References
2397         
2398         This has the following benefits:
2399         
2400         - no duplicates in property lists
2401         - simplifies API calls
2402         - probably more efficient, since linked list is gone
2403         - entirely removed Reference, ReferenceList and ProtectedReference types from the API
2404
2405         * kjs/PropertyNameArray.cpp: Added.
2406         (KJS::PropertyNameArray::add): Check set, if not already there, add to
2407         vector.
2408         * kjs/PropertyNameArray.h: Added.
2409         (KJS::PropertyNameArray::PropertyNameArray): Newly added type, combines
2410         a set and a vector to make a unique but ordered list of identifiers.
2411         (KJS::PropertyNameArray::begin): ditto
2412         (KJS::PropertyNameArray::end): ditto
2413         (KJS::PropertyNameArray::size): ditto
2414         (KJS::PropertyNameArray::operator[]): ditto
2415         * kjs/array_instance.h:
2416         * kjs/array_object.cpp:
2417         (ArrayInstance::getPropertyNames): renamed from getPropertyList, updated
2418         for PropertyNameArray
2419         (ArrayInstance::setLength): updated for PropertyNameArray
2420         (ArrayInstance::pushUndefinedObjectsToEnd): ditto
2421         * kjs/nodes.cpp:
2422         (ForInNode::execute): updated for PropertyNameArray
2423         * kjs/nodes.h:
2424         * kjs/object.cpp:
2425         (KJS::JSObject::getPropertyNames): renamed from getPropertyList, updated
2426         for PropertyNameArray
2427         * kjs/object.h:
2428         * kjs/property_map.cpp:
2429         (KJS::PropertyMap::getEnumerablePropertyNames): updated for PropertyNameArray
2430         (KJS::PropertyMap::getSparseArrayPropertyNames): ditto
2431         * kjs/property_map.h:
2432         * kjs/protected_reference.h: Removed.
2433         * kjs/reference.cpp: Removed.
2434         * kjs/reference.h: Removed.
2435         * kjs/reference_list.cpp: Removed.
2436         * kjs/reference_list.h: Removed.
2437         * kjs/scope_chain.cpp:
2438         (KJS::ScopeChain::print): Use PropertyNamesArray instead of ReferenceList.
2439         * kjs/string_object.cpp:
2440         (StringInstance::getPropertyNames): Updated for new approach.
2441         * kjs/string_object.h:
2442         * kjs/ustring.h:
2443         * API/APICast.h:
2444         (toJS): Added overload for PropertyNameAccumulatorRef / PropertyNameArray*
2445         (toRef): ditto
2446         * API/JSBase.h:
2447         * API/JSCallbackObject.cpp:
2448         (KJS::JSCallbackObject::getPropertyNames): Fixed for new API.
2449         * API/JSCallbackObject.h:
2450         * API/JSObjectRef.cpp:
2451         (__JSPropertyNameArray::__JSPropertyNameArray): Type used for a publicly vended
2452         JSPropertyNameArrayRef.
2453         (JSObjectCopyPropertyNames): New API call - renamed / refactored from 
2454         JSObjectCreatePropertyList
2455         (JSPropertyNameArrayRetain): new retain call for JSPropertyNameArray.
2456         (JSPropertyNameArrayRelease): new release call for - " -.
2457         (JSPropertyNameArrayGetCount): Instead of having to use a stateful enumerator you
2458         can now get the count and items in any order.
2459         (JSPropertyNameArrayGetNameAtIndex): See above.
2460         (JSPropertyNameAccumulatorAddName): What you add properties to is now an opaque 
2461         accumulator object.
2462         * API/JSObjectRef.h: Prototyped new functions, removed old ones
2463         * JavaScriptCore.exp: Updated exported symbols.
2464         * JavaScriptCore.xcodeproj/project.pbxproj: Added new files, removed old.
2465         * API/testapi.c:
2466         (MyObject_getPropertyNames): Renamed / fixed callback to fit new paradigm.
2467         (main): Updated for new API.
2468
2469 2006-07-15  Darin Adler  <darin@apple.com>
2470
2471         - oops, missed a few more arrays that had to be const
2472
2473         * API/JSNode.c:
2474         (JSNodePrototype_appendChild): Added const.
2475         (JSNodePrototype_removeChild): Ditto.
2476         (JSNodePrototype_replaceChild): Ditto.
2477         (JSNode_construct): Ditto.
2478         * API/JSNodeList.c:
2479         (JSNodeListPrototype_item): Ditto.
2480         * API/JSObjectRef.cpp:
2481         (JSObjectMakeFunctionWithBody): Ditto.
2482         (JSObjectCallAsFunction): Ditto.
2483         (JSObjectCallAsConstructor): Ditto.
2484         * API/minidom.c:
2485         (print): Ditto.
2486         * API/testapi.c:
2487         (MyObject_callAsFunction): Ditto.
2488         (MyObject_callAsConstructor): Ditto.
2489         (print_callAsFunction): Ditto.
2490         (myConstructor_callAsConstructor): Ditto.
2491
2492 2006-07-15  Darin Adler  <darin@apple.com>
2493
2494         Reviewed by Maciej.
2495
2496         * API/JSNode.h: Made an array parameter const.
2497         * API/JSObjectRef.h: Made array parameters const. Fixed a comment.
2498
2499 2006-07-15  Geoffrey Garen  <ggaren@apple.com>
2500
2501         Reviewed by Maciej.
2502         
2503         - JSObjectMakeFunctionWithBody includes a function name and named parameters now.
2504
2505         * API/JSObjectRef.cpp:
2506         (JSObjectMakeFunctionWithBody):
2507         * API/JSObjectRef.h:
2508         * API/testapi.c:
2509         (assertEqualsAsUTF8String): More informative failure reporting.
2510         (main): Test more function cases.
2511
2512 2006-07-15  Geoffrey Garen  <ggaren@apple.com>
2513
2514         Reviewed by Maciej.
2515
2516         - Moved the arguments passed to JSClassCreate into a single structure,
2517         called JSClassDefinition. This will enable easier structure 
2518         migration/versioning in the future, if necessary.
2519         
2520         - Added support for class names.
2521         
2522         - kJSClassDefinitionNull replaces kJSObjectCallbacksNone.
2523         
2524         - JSClass is becoming a fairly complex struct, so I migrated all of its
2525         implementation other than reference counting to the sruct.
2526         
2527         - Also moved JSClass* functions in the API to JSObjectRef.cpp, since they're
2528         declared in JSObjectRef.h
2529         
2530         - Also added some more informative explanation to the class structure doc.
2531         
2532 2006-07-15  Darin Adler  <darin@apple.com>
2533
2534         Reviewed by Geoff.
2535
2536         - fix http://bugs.webkit.org/show_bug.cgi?id=8395
2537           <rdar://problem/4613467>
2538           REGRESSION: RegEx seems broken for hex escaped non breaking space
2539
2540         Test: fast/js/regexp-extended-characters-more.html
2541
2542         * pcre/pcre_exec.c:
2543         (match): Got rid of utf16Length local variable to guarantee there's no
2544         extra stack usage in recursive calls. Fixed two places in the PCRE_UTF16
2545         code that were using the length variable, which is the UTF-8 length of
2546         a character in the pattern, to move in the UTF-16 subject string. Instead
2547         they hardcode lengths of 1 and 2 since the code already handles BMP
2548         characters and surrogate pairs separately. Also fixed some DPRINTF so
2549         I could compile with DEBUG on.
2550         (pcre_exec): Changed a place that was checking for multibyte characters
2551         in the subject string to use ISMIDCHAR. Instead it was using hardcoded
2552         logic that was right for UTF-8 but wrong for UTF-16.
2553
2554         * pcre/pcre_compile.c: (pcre_compile2): Fixed a DPRINTF so I could compile
2555         with DEBUG on.
2556
2557 2006-07-14  Geoffrey Garen  <ggaren@apple.com>
2558
2559         RS by Maciej.
2560         
2561         Global replace in the API of argc/argv with argumentCount/arguments.
2562
2563 2006-07-14  Geoffrey Garen  <ggaren@apple.com>
2564
2565         Reviewed by Maciej.
2566         
2567         - Finalized exception handling in the API.
2568         
2569         setProperty can throw because it throws for built-in arrays. getProperty
2570         and deleteProperty can throw because setProperty can throw and we want
2571         to be consistent, and also because they seem like "actions." callAsFunction,
2572         callAsConstructor, and hasInstance can throw, because they caan throw for
2573         all built-ins.
2574         
2575         toBoolean can't throw because it's defined that way in the spec.
2576         
2577         - Documented that toBoolean and toObject can't be overridden by custom 
2578         objects because they're defined that way in the spec.
2579
2580 === Safari-521.17 ===
2581
2582 2006-07-14  Geoffrey Garen  <ggaren@apple.com>
2583
2584         Reviewed by Maciej.
2585         
2586         - Implemented ref-counting of JSContexts by splitting into two datatypes:
2587         JSGlobalContext, which you can create/retain/release, and JSContext, which
2588         you can't.
2589         
2590         Internally, you retain a JSGlobalContext/ExecState by retaining its
2591         interpreter, which, in the case of a global ExecState, owns it.
2592         
2593         - Also made ~Interpreter() protected to catch places where Interpreter
2594         is manually deleted. (Can't make it private because some crazy fool
2595         decided it would be a good idea to subclass Interpreter in other frameworks.
2596         I pity da fool.)
2597
2598         * API/APICast.h: 
2599         (toJS): Added cast for new JSGlobalContext
2600         * API/JSStringRef.h: Changed vague "you must" language to more specific
2601         (but, ultimately, equally vague) "behavior is undefined if you don't" 
2602         language.
2603         (KJS::Interpreter::Interpreter): Factored more common initialization into
2604         init()
2605         * kjs/interpreter.h:
2606         (KJS::Interpreter::ref): new
2607         (KJS::Interpreter::deref): new
2608         (KJS::Interpreter::refCount): new
2609         * kjs/testkjs.cpp: 
2610         (doIt): Ref-count the interpreter.
2611
2612 2006-07-14  Maciej Stachowiak  <mjs@apple.com>
2613
2614         Reviewed by Geoff.
2615         
2616         - removed bool return value from JSObjectSetProperty, since it is inefficient and
2617         also doesn't work quite right
2618         - added JSObjectGetPropertyAtIndex and JSObjectSetPropertyAtIndex
2619
2620         * API/JSObjectRef.cpp:
2621         (JSObjectSetProperty): Removed return value and canPut stuff.
2622         (JSObjectGetPropertyAtIndex): Added.
2623         (JSObjectSetPropertyAtIndex): Added.
2624         * API/JSObjectRef.h: Prototyped and documented new functions.
2625
2626 2006-07-14  Geoffrey Garen  <ggaren@apple.com>
2627
2628         Reviewed by Beth.
2629         
2630         Moved JSCheckScriptSyntax, JSEvaluateScript, and JSGarbageCollect into
2631         JSBase.h/.cpp. They don't belong in the value-specific or context-specific 
2632         files because they're not part of the value or context implementations.
2633
2634         * API/JSBase.h:
2635         * API/JSContextRef.cpp:
2636         (JSContextGetGlobalObject):
2637         * API/JSContextRef.h:
2638         * API/JSValueRef.cpp:
2639         (JSValueUnprotect):
2640         * API/JSValueRef.h:
2641         * JavaScriptCore.xcodeproj/project.pbxproj:
2642
2643 2006-07-13  Timothy Hatcher  <timothy@apple.com>
2644
2645         Reviewed by Maciej.
2646
2647         Moved JavaScriptCore to be a public framework.
2648
2649         * JavaScriptCore.xcodeproj/project.pbxproj:
2650
2651 2006-07-13  Mark Rowe  <opendarwin.org@bdash.net.nz>
2652
2653         Reviewed by Geoffrey.
2654
2655         http://bugs.webkit.org/show_bug.cgi?id=9742
2656         Bug 9742: REGRESSION: WebKit hangs when loading <http://www.vtbook.com>
2657
2658         * kjs/value.h:
2659         (KJS::JSValue::getUInt32): Only types tagged as numeric can be converted to UInt32.
2660
2661 2006-07-13  Geoffrey Garen  <ggaren@apple.com>
2662
2663         Pleasing to Maciej.
2664         
2665         - Renamed JSEvaluate -> JSEvaluateScript, JSCheckSyntax -> JSCheckScriptSyntax
2666         - Added exception out parameters to JSValueTo* and JSValueIsEqual because
2667         they can throw
2668         - Removed JSObjectGetDescription because it's useless and vague, and 
2669         JSValueToString/JSValueIsObjectOfClass do a better job, anyway
2670         - Clarified comments about "IsFunction/Constructor" to indicate that they
2671         are true of all functions/constructors, not just those created by JSObjectMake*
2672
2673 2006-07-12  Geoffrey Garen  <ggaren@apple.com>
2674
2675         RS by Beth.
2676         
2677         Finished previously approved JSInternalString -> JSString conversion 
2678         by renaming the files.
2679
2680         * API/JSCallbackObject.cpp:
2681         * API/JSInternalStringRef.cpp: Removed.
2682         * API/JSInternalStringRef.h: Removed.
2683         * API/JSStringRef.cpp: Added.
2684         * API/JSStringRef.h: Added.
2685         * API/JavaScriptCore.h:
2686         * JavaScriptCore.xcodeproj/project.pbxproj:
2687
2688 2006-07-12  Geoffrey Garen  <ggaren@apple.com>
2689
2690         Reviewed by Maciej.
2691         
2692         - Removed context and exception parameters from JSObjectGetPropertyEnumerator,
2693         removing the spurious use of ExecState inside JavaScriptCore that made
2694         us think this was necessary in the first place.
2695
2696         (StringInstance::getPropertyList): Use getString instead of toString because
2697         we know we're dealing with a string -- we put it there in the first place.
2698         While we're at it, store the string's size instead of retrieving it each time 
2699         through the loop, to avoid the unnecessary killing of puppies.
2700         * kjs/string_object.h:
2701
2702 2006-07-12  Maciej Stachowiak  <mjs@apple.com>
2703
2704         Reviewed by Geoff.
2705         
2706         - add handling of hasInstance callback for API objects
2707
2708         * API/JSCallbackObject.cpp:
2709         (KJS::JSCallbackObject::implementsHasInstance): Check if callback is present.
2710         (KJS::JSCallbackObject::hasInstance): Invoke appropriate callback.
2711         * API/JSCallbackObject.h:
2712         * API/JSClassRef.cpp:
2713         * API/JSObjectRef.h:
2714         * API/testapi.c:
2715         (MyObject_hasInstance): Test case; should match what construct would do.
2716         * API/testapi.js:
2717
2718 2006-07-11  Geoffrey Garen  <ggaren@apple.com>
2719
2720         Reviewed by Maciej.
2721         
2722         - Implemented a vast number of renames and comment clarifications 
2723         suggested during API review.
2724         
2725         JSInternalString -> JSString
2726         JS*Make -> JSValueMake*, JSObjectMake*
2727         JSTypeCode -> JSType
2728         JSValueIsInstanceOf -> JSValueIsInstanceOfConstructor (reads strangely well in client code)
2729         JSGC*Protect -> JSValue*Protect
2730         JS*Callback -> JSObject*Callback
2731         JSGetPropertyListCallback -> JSObjectAddPropertiesToListCallback
2732         JSPropertyEnumeratorGetNext -> JSPropertyEnumeratorGetNextName
2733         JSString* -> 
2734             JSStringCreateWithUTF8CString, JSStringGetUTF8CString,
2735             JSStringGetMaximumUTF8CStringSize JSStringIsEqualToUTF8CString, 
2736             JSStringCreateWithCFString, JSStringCopyCFString, JSStringCreateWithCharacters.
2737         
2738         - Changed functions taking a JSValue out arg and returning a bool indicating
2739         whether it was set to simply return a JSValue or NULL.
2740         
2741         - Removed JSStringGetCharacters because it's more documentation than code,
2742         and it's just a glorified memcpy built on existing API functionality.
2743         
2744         - Moved standard library includes into the headers that actually require them.
2745         
2746         - Standardized use of the phrase "Create Rule."
2747         
2748         - Removed JSLock from make functions that don't allocate.
2749         
2750         - Added exception handling to JSValueToBoolean, since we now allow
2751         callback objects to throw exceptions upon converting to boolean.
2752         
2753         - Renamed JSGCCollect to JSGarbageCollect.
2754
2755 2006-07-10  Geoffrey Garen  <ggaren@apple.com>
2756
2757         Reviewed by Darin.
2758         
2759         - Changed public header includes to the <JavaScriptCore/ style.
2760         - Changed instances of 'buffer' to 'string' since we decided on
2761         JSInternalString instead of JSStringBuffer.
2762
2763         * API/JSContextRef.h:
2764         * API/JSInternalStringRef.cpp:
2765         (JSStringMake):
2766         (JSInternalStringRetain):
2767         (JSInternalStringRelease):
2768         (JSValueCopyStringValue):
2769         (JSInternalStringGetLength):
2770         (JSInternalStringGetCharactersPtr):
2771         (JSInternalStringGetCharacters):
2772         (JSInternalStringGetMaxLengthUTF8):
2773         (JSInternalStringGetCharactersUTF8):
2774         (CFStringCreateWithJSInternalString):
2775         * API/JSInternalStringRef.h:
2776         * API/JSNode.c:
2777         (JSNodePrototype_appendChild):
2778         (JSNode_getNodeType):
2779         * API/JSObjectRef.cpp:
2780         (JSObjectCallAsConstructor):
2781         * API/JSValueRef.h:
2782         * API/JavaScriptCore.h:
2783         * API/minidom.c:
2784         (main):
2785         (print):
2786         * API/testapi.c:
2787         (MyObject_getPropertyList):
2788         (myConstructor_callAsConstructor):
2789         (main): I noticed that we were prematurely releasing some string buffers,
2790         so I moved their release calls to the end of main(). I got rid of 'Buf' in *Buf
2791         (sometimes changing to 'IString', when necessary to differentiate a variable) 
2792         to match the buffer->string change.
2793
2794 === Safari-521.16 ===
2795
2796 2006-07-10  Darin Adler  <darin@apple.com>
2797
2798         * kjs/value.cpp: (KJS::JSValue::toInt32Inline): Added inline keyword one more place.
2799         Just in case.
2800
2801 2006-07-10  Darin Adler  <darin@apple.com>
2802
2803         - fix the release build
2804
2805         * kjs/value.h:
2806         * kjs/value.cpp:
2807         (KJS::JSValue::toInt32Inline): Move the code here to an inline.
2808         (KJS::JSValue::toInt32): Call the inline from both overloaded toInt32 functions.
2809
2810 2006-07-10  David Kilzer  <ddkilzer@kilzer.net>
2811
2812         Reviewed by Darin.
2813
2814         - fix http://bugs.webkit.org/show_bug.cgi?id=9179
2815           Implement select.options.add() method
2816
2817         * JavaScriptCore.exp: Added overloaded KJS::JSValue::toInt32() method.
2818         * JavaScriptCore.xcodeproj/project.pbxproj: Altered attributes metadata for
2819         kjs/value.h to make it available as a forwarded header.
2820         * kjs/lookup.h:
2821         (KJS::lookupPut): Extracted a lookupPut() method from the existing lookupPut() method.
2822         The new method returns a boolean value if no entry is found in the lookup table.
2823         * kjs/value.cpp:
2824         (KJS::JSValue::toInt32): Overloaded toInt32() method with boolean "Ok" argument.
2825         * kjs/value.h: Ditto.
2826
2827 2006-07-10  Geoffrey Garen  <ggaren@apple.com>
2828
2829         No review necessary. Removed bogus file I accidentally checked in before.
2830
2831         * API/JSInternalSringRef.h: Removed.
2832
2833 2006-07-10  Geoffrey Garen  <ggaren@apple.com>
2834
2835         Reviewed by Darin.
2836         
2837         Added exception out parameter to API object callbacks, removed semi-bogus
2838         JSContext(.*)Exception functions.
2839         
2840         To make these calls syntactically simple, I added an exceptionSlot()
2841         method to the ExecState class, which provides a JSValue** slot in which to 
2842         store a JSValue* exception.
2843
2844         * API/APICast.h:
2845         (toRef):
2846         * API/JSCallbackConstructor.cpp:
2847         (KJS::JSCallbackConstructor::construct):
2848         * API/JSCallbackFunction.cpp:
2849         (KJS::JSCallbackFunction::callAsFunction):
2850         * API/JSCallbackObject.cpp:
2851         (KJS::JSCallbackObject::init):
2852         (KJS::JSCallbackObject::getOwnPropertySlot):
2853         (KJS::JSCallbackObject::put):
2854         (KJS::JSCallbackObject::deleteProperty):
2855         (KJS::JSCallbackObject::construct):
2856         (KJS::JSCallbackObject::callAsFunction):
2857         (KJS::JSCallbackObject::getPropertyList):
2858         (KJS::JSCallbackObject::toBoolean):
2859         (KJS::JSCallbackObject::toNumber):
2860         (KJS::JSCallbackObject::toString):
2861         (KJS::JSCallbackObject::staticValueGetter):
2862         (KJS::JSCallbackObject::callbackGetter):
2863         * API/JSContextRef.cpp:
2864         (JSCheckSyntax):
2865         * API/JSContextRef.h:
2866         * API/JSNode.c:
2867         (JSNodePrototype_appendChild):
2868         (JSNodePrototype_removeChild):
2869         (JSNodePrototype_replaceChild):
2870         (JSNode_getNodeType):
2871         (JSNode_getChildNodes):
2872         (JSNode_getFirstChild):
2873         (JSNode_construct):
2874         * API/JSNode.h:
2875         * API/JSNodeList.c:
2876         (JSNodeListPrototype_item):
2877         (JSNodeList_length):
2878         (JSNodeList_getProperty):
2879         * API/JSObjectRef.h:
2880         * API/minidom.c:
2881         (print):
2882         * API/testapi.c:
2883         (MyObject_initialize):
2884         (MyObject_hasProperty):
2885         (MyObject_getProperty):
2886         (MyObject_setProperty):
2887         (MyObject_deleteProperty):
2888         (MyObject_getPropertyList):
2889         (MyObject_callAsFunction):
2890         (MyObject_callAsConstructor):
2891         (MyObject_convertToType):
2892         (print_callAsFunction):
2893         (myConstructor_callAsConstructor):
2894         (main):
2895         * JavaScriptCore.exp:
2896         * kjs/ExecState.h:
2897         (KJS::ExecState::exceptionHandle):
2898
2899 2006-07-10  Geoffrey Garen  <ggaren@apple.com>
2900
2901         Reviewed by Darin.
2902
2903         Improved type safety by implementing opaque JSValue/JSObject typing through 
2904         abuse of 'const', not void*. Also fixed an alarming number of bugs
2905         exposed by this new type safety.
2906         
2907         I made one design change in JavaScriptCore, which is that the JSObject
2908         constructor should take a JSValue* as its prototype argument, not a JSObject*,
2909         since we allow the prototype to be any JSValue*, including jsNull(), for
2910         example.
2911         
2912         * API/APICast.h:
2913         (toJS):
2914         * API/JSBase.h:
2915         * API/JSCallbackConstructor.cpp:
2916         (KJS::JSCallbackConstructor::construct):
2917         * API/JSCallbackFunction.cpp:
2918         (KJS::JSCallbackFunction::callAsFunction):
2919         * API/JSCallbackObject.cpp:
2920         (KJS::JSCallbackObject::JSCallbackObject):
2921         (KJS::JSCallbackObject::getOwnPropertySlot):
2922         (KJS::JSCallbackObject::put):
2923         (KJS::JSCallbackObject::construct):
2924         (KJS::JSCallbackObject::callAsFunction):
2925         (KJS::JSCallbackObject::staticFunctionGetter):
2926         * API/JSCallbackObject.h:
2927         * API/JSContextRef.cpp:
2928         (JSEvaluate):
2929         * API/JSNode.c:
2930         (JSNodePrototype_appendChild):
2931         (JSNodePrototype_removeChild):
2932         (JSNodePrototype_replaceChild):
2933         * API/JSObjectRef.cpp:
2934         (JSObjectMake):
2935         (JSFunctionMakeWithBody):
2936         (JSObjectGetProperty):
2937         (JSObjectCallAsFunction):
2938         (JSObjectCallAsConstructor):
2939         * API/JSObjectRef.h:
2940         * API/testapi.c:
2941         (main):
2942         * ChangeLog:
2943         * kjs/object.h:
2944         (KJS::JSObject::JSObject):
2945
2946 2006-07-10  Geoffrey Garen  <ggaren@apple.com>
2947
2948         Approved by Maciej, Darin.
2949         
2950         Renamed JSStringBufferRef to JSInternalStringRef. "Internal string" means the 
2951         JavaScript engine's internal string representation, which is the most 
2952         low-level and efficient representation to use when interfacing with JavaScript.
2953
2954         * API/APICast.h:
2955         (toJS):
2956         (toRef):
2957         * API/JSBase.h:
2958         * API/JSCallbackObject.cpp:
2959         (KJS::JSCallbackObject::getOwnPropertySlot):
2960         (KJS::JSCallbackObject::put):
2961         (KJS::JSCallbackObject::deleteProperty):
2962         (KJS::JSCallbackObject::staticValueGetter):
2963         (KJS::JSCallbackObject::callbackGetter):
2964         * API/JSContextRef.cpp:
2965         (JSEvaluate):
2966         (JSCheckSyntax):
2967         * API/JSContextRef.h:
2968         * API/JSInternalStringRef.cpp: Added.
2969         (JSStringMake):
2970         (JSInternalStringCreate):
2971         (JSInternalStringCreateUTF8):
2972         (JSInternalStringRetain):
2973         (JSInternalStringRelease):
2974         (JSValueCopyStringValue):
2975         (JSInternalStringGetLength):
2976         (JSInternalStringGetCharactersPtr):
2977         (JSInternalStringGetCharacters):
2978         (JSInternalStringGetMaxLengthUTF8):
2979         (JSInternalStringGetCharactersUTF8):
2980         (JSInternalStringIsEqual):
2981         (JSInternalStringIsEqualUTF8):
2982         (JSInternalStringCreateCF):
2983         (CFStringCreateWithJSInternalString):
2984         * API/JSInternalStringRef.h: Added.
2985         * API/JSNode.c:
2986         (JSNodePrototype_appendChild):
2987         (JSNode_getNodeType):
2988         (JSNode_getChildNodes):
2989         (JSNode_getFirstChild):
2990         * API/JSNodeList.c:
2991         (JSNodeList_length):
2992         (JSNodeList_getProperty):
2993         * API/JSObjectRef.cpp:
2994         (JSFunctionMakeWithBody):
2995         (JSObjectGetDescription):
2996         (JSObjectHasProperty):
2997         (JSObjectGetProperty):
2998         (JSObjectSetProperty):
2999         (JSObjectDeleteProperty):
3000         (JSPropertyEnumeratorGetNext):
3001         (JSPropertyListAdd):
3002         * API/JSObjectRef.h:
3003         * API/JSStringBufferRef.cpp: Removed.
3004         * API/JSStringBufferRef.h: Removed.
3005         * API/JSValueRef.h:
3006         * API/JavaScriptCore.h:
3007         * API/minidom.c:
3008         (main):
3009         (print):
3010         * API/testapi.c:
3011         (assertEqualsAsUTF8String):
3012         (assertEqualsAsCharactersPtr):
3013         (assertEqualsAsCharacters):
3014         (MyObject_hasProperty):
3015         (MyObject_getProperty):
3016         (MyObject_setProperty):
3017         (MyObject_deleteProperty):
3018         (MyObject_getPropertyList):
3019         (print_callAsFunction):
3020         (myConstructor_callAsConstructor):
3021         (main):
3022         * JavaScriptCore.exp:
3023         * JavaScriptCore.xcodeproj/project.pbxproj:
3024
3025 2006-07-08  Tim Omernick  <timo@apple.com>
3026
3027         Reviewed by Maciej.
3028
3029         Added an OpenGL drawing model to the Netscape Plug-in API.
3030
3031         * bindings/npapi.h:
3032
3033 2006-07-08  Timothy Hatcher  <timothy@apple.com>
3034
3035         Reviewed by Maciej.
3036
3037         Moved KJS_GetCreatedJavaVMs to jni_utility.cpp.
3038         Switched KJS_GetCreatedJavaVMs over to use dlopen and dlsym
3039         now that NSAddImage, NSLookupSymbolInImage and NSAddressOfSymbol
3040         are deprecated in Leopard.
3041
3042         * JavaScriptCore.exp:
3043         * JavaScriptCore.xcodeproj/project.pbxproj:
3044         * bindings/jni/jni_utility.cpp:
3045         (KJS::Bindings::KJS_GetCreatedJavaVMs):
3046         * bindings/softlinking.c: Removed.
3047         * bindings/softlinking.h: Removed.
3048
3049 2006-07-08  Geoffrey Garen  <ggaren@apple.com>
3050
3051         Reviewed by Anders.
3052         
3053         - Make JSObjectGetProperty return a JSValue or NULL, like JSEvaluate does.
3054
3055         * API/JSObjectRef.cpp:
3056         (JSObjectGetProperty):
3057         * API/JSObjectRef.h:
3058         * API/testapi.c:
3059         (main):
3060
3061 2006-07-08  Geoffrey Garen  <ggaren@apple.com>
3062
3063         Style change -- no review necessary.
3064         
3065         Use 0 instead of NULL in API .cpp files, to match our style guidelines.
3066
3067         * API/JSContextRef.cpp:
3068         (JSEvaluate):
3069         * API/JSObjectRef.cpp:
3070         (JSFunctionMakeWithBody):
3071         (JSObjectCallAsFunction):
3072         (JSObjectCallAsConstructor):
3073         * API/JSValueRef.cpp:
3074         (JSValueToObject):
3075
3076 2006-07-08  Geoffrey Garen  <ggaren@apple.com>
3077
3078         Reviewed by TimO.
3079
3080         - Added ability to pass NULL for thisObject when calling JSObjectCallAsFunction,
3081         to match JSEvaluate.
3082         
3083         * API/JSObjectRef.cpp:
3084         (JSObjectCallAsFunction):
3085         * API/JSObjectRef.h:
3086         * API/testapi.c:
3087         (main):
3088
3089 === Safari-521.15 ===
3090
3091 2006-07-07  Geoffrey Garen  <ggaren@apple.com>
3092
3093         Reviewed by Maciej.
3094         
3095         - Standardized which functions take a JSContext as an argument. The rule is:
3096         if you might execute JavaScript, you take a JSContext, otherwise you don't.
3097         
3098         The FIXME in JSObjectRef.h requires refactoring some parts of Interpreter,
3099         but not API changes, so I'm putting it off until later.
3100
3101         * API/JSCallbackObject.cpp:
3102         (KJS::JSCallbackObject::JSCallbackObject):
3103         (KJS::JSCallbackObject::init):
3104         * API/JSCallbackObject.h:
3105         * API/JSContextRef.cpp:
3106         (JSContextCreate):
3107         * API/JSContextRef.h:
3108         * API/JSObjectRef.cpp:
3109         (JSObjectMake):
3110         (JSPropertyEnumeratorGetNext):
3111         * API/JSObjectRef.h:
3112         * API/testapi.c:
3113         (MyObject_initialize):
3114         (main):
3115         * JavaScriptCore.exp:
3116         * kjs/array_object.cpp:
3117         (ArrayInstance::setLength):
3118         (ArrayInstance::pushUndefinedObjectsToEnd):
3119         * kjs/nodes.cpp:
3120         (ForInNode::execute):
3121         * kjs/reference.cpp:
3122         (KJS::Reference::getPropertyName):
3123         (KJS::Reference::getValue):
3124         * kjs/reference.h:
3125         * kjs/scope_chain.cpp:
3126         (KJS::ScopeChain::print):
3127
3128 2006-07-06  Geoffrey Garen  <ggaren@apple.com>
3129
3130         Reviewed by Maciej.
3131         
3132         More API action.
3133         
3134         - Headerdoc finished
3135
3136         Semantic Changes:
3137         - Added a JSContextRef argument to many functions, because you need a 
3138         JSContextRef for doing virtually anything. I expect to add this argument
3139         to even more functions in a future patch.
3140         
3141         - Removed the globalObjectPrototype argument to JSContextCreate because
3142         you can't create an object until you have a context, so it's impossible
3143         to pass a prototype object to JSContextCreate. That's OK because (1) there's
3144         no reason to give the global object a prototype and (2) if you really want
3145         to, you can just use a separate call to JSObjectSetPrototype.
3146         
3147         - Removed the JSClassRef argument to JSClassCreate because it was unnecessary,
3148         and you need to be able to make the global object's class before you've
3149         created a JSContext.
3150         
3151         - Added an optional exception parameter to JSFunctionMakeWithBody because anything
3152         less would be uncivilized.
3153         
3154         - Made the return value parameter to JSObjectGetProperty optional to match
3155         all other return value parameters in the API.
3156         
3157         - Made JSObjectSetPrivate/JSObjectGetPrivate work on JSCallbackFunctions
3158         and JSCallbackConstructors. You could use an abstract base class or strategic
3159         placement of m_privateData in the class structure to implement this, but 
3160         the former seemed like overkill, and the latter seemed too dangerous.
3161         
3162         - Fixed a bug where JSPropertyEnumeratorGetNext would skip the first property.
3163
3164         Cosmetic Changes:
3165         - Reversed the logic of the JSChar #ifdef to avoid confusing headerdoc
3166         
3167         - Removed function names from @function declarations because headeroc
3168         can parse them automatically, and I wanted to rule out manual mismatch.
3169
3170         - Changed Error::create to take a const UString& instead of a UString*
3171         because it was looking at me funny.
3172         
3173         - Renamed JSStringBufferCreateWithCFString to JSStringBufferCreateCF
3174         because the latter is more concise and it matches JSStringBufferCreateUTF8.
3175         
3176         * API/JSCallbackObject.cpp:
3177         (KJS::JSCallbackObject::getOwnPropertySlot):
3178         (KJS::JSCallbackObject::put):
3179         (KJS::JSCallbackObject::deleteProperty):
3180         (KJS::JSCallbackObject::getPropertyList):
3181         (KJS::JSCallbackObject::toBoolean):
3182         (KJS::JSCallbackObject::toNumber):
3183         (KJS::JSCallbackObject::toString):
3184         * API/JSClassRef.cpp:
3185         (JSClassCreate):
3186         * API/JSContextRef.cpp:
3187         (JSContextCreate):
3188         (JSContextSetException):
3189         * API/JSContextRef.h:
3190         * API/JSNode.c:
3191         (JSNodePrototype_class):
3192         (JSNode_class):
3193         * API/JSNodeList.c:
3194         (JSNodeListPrototype_class):
3195         (JSNodeList_class):
3196         * API/JSObjectRef.cpp:
3197         (JSObjectGetProperty):
3198         (JSObjectGetPrivate):
3199         (JSObjectSetPrivate):
3200         (JSObjectCallAsFunction):
3201         (JSObjectCallAsConstructor):
3202         (JSPropertyEnumeratorGetNext):
3203         * API/JSObjectRef.h:
3204         * API/JSStringBufferRef.cpp:
3205         (JSStringBufferCreateCF):
3206         * API/JSStringBufferRef.h:
3207         * API/JSValueRef.cpp:
3208         (JSValueIsInstanceOf):
3209         * API/JSValueRef.h:
3210         * API/minidom.c:
3211         (main):
3212         * API/minidom.js:
3213         * API/testapi.c:
3214         (MyObject_hasProperty):
3215         (MyObject_setProperty):
3216         (MyObject_deleteProperty):
3217         (MyObject_getPropertyList):
3218         (MyObject_convertToType):
3219         (MyObject_class):
3220         (main):
3221         * JavaScriptCore.exp:
3222
3223 2006-07-07  Geoffrey Garen  <ggaren@apple.com>
3224
3225         Reviewed by John.
3226         
3227         - Fixed a few crashes resulting from NULL parameters to JSClassCreate.
3228
3229         * API/JSClassRef.cpp:
3230         (JSClassCreate):
3231         (JSClassRelease):
3232         * API/testapi.c: Added test for NULL parameters.
3233         (main):
3234
3235 2006-07-07  Geoffrey Garen  <ggaren@apple.com>
3236
3237         Reviewed by John, mocked by Darin.
3238         
3239         - Changed JSEvaluate to take a JSObjectRef instead of a JSValueRef as
3240         "this," since "this" must be an object.
3241
3242         * API/JSContextRef.cpp:
3243         (JSEvaluate):
3244         * API/JSContextRef.h:
3245
3246 2006-07-07  Geoffrey Garen  <ggaren@apple.com>
3247
3248         Reviewed by John.
3249         
3250         - More headerdoc
3251
3252         * API/JSBase.h:
3253         * JavaScriptCore.xcodeproj/project.pbxproj:
3254
3255 2006-07-05  Geoffrey Garen  <ggaren@apple.com>
3256
3257         RS by Beth.
3258         
3259         Renamed JSCharBufferRef, which was universally unpopular, to JSStringBufferRef,
3260         which, hopefully, will be less unpopular.
3261
3262         * API/APICast.h:
3263         (toJS):
3264         (toRef):
3265         * API/JSBase.h:
3266         * API/JSCallbackObject.cpp:
3267         (KJS::JSCallbackObject::getOwnPropertySlot):
3268         (KJS::JSCallbackObject::put):
3269         (KJS::JSCallbackObject::deleteProperty):
3270         (KJS::JSCallbackObject::staticValueGetter):
3271         (KJS::JSCallbackObject::callbackGetter):
3272         * API/JSCharBufferRef.cpp: Removed.
3273         * API/JSCharBufferRef.h: Removed.
3274         * API/JSContextRef.cpp:
3275         (JSEvaluate):
3276         (JSCheckSyntax):
3277         * API/JSContextRef.h:
3278         * API/JSNode.c:
3279         (JSNodePrototype_appendChild):
3280         (JSNode_getNodeType):
3281         (JSNode_getChildNodes):
3282         (JSNode_getFirstChild):
3283         * API/JSNodeList.c:
3284         (JSNodeList_length):
3285         (JSNodeList_getProperty):
3286         * API/JSObjectRef.cpp:
3287         (JSFunctionMakeWithBody):
3288         (JSObjectGetDescription):
3289         (JSObjectHasProperty):
3290         (JSObjectGetProperty):
3291         (JSObjectSetProperty):
3292         (JSObjectDeleteProperty):
3293         (JSPropertyEnumeratorGetNext):
3294         (JSPropertyListAdd):
3295         * API/JSObjectRef.h:
3296         * API/JSStringBufferRef.cpp: Added.
3297         (JSStringMake):
3298         (JSStringBufferCreate):
3299         (JSStringBufferCreateUTF8):
3300         (JSStringBufferRetain):
3301         (JSStringBufferRelease):
3302         (JSValueCopyStringValue):
3303         (JSStringBufferGetLength):
3304         (JSStringBufferGetCharactersPtr):
3305         (JSStringBufferGetCharacters):
3306         (JSStringBufferGetMaxLengthUTF8):
3307         (JSStringBufferGetCharactersUTF8):
3308         (JSStringBufferIsEqual):
3309         (JSStringBufferIsEqualUTF8):
3310         (JSStringBufferCreateWithCFString):
3311         (CFStringCreateWithJSStringBuffer):
3312         * API/JSStringBufferRef.h: Added.
3313         * API/JSValueRef.h:
3314         * API/JavaScriptCore.h:
3315         * API/minidom.c:
3316         (main):
3317         (print):
3318         * API/testapi.c:
3319         (assertEqualsAsUTF8String):
3320         (assertEqualsAsCharactersPtr):
3321         (assertEqualsAsCharacters):
3322         (MyObject_hasProperty):
3323         (MyObject_getProperty):
3324         (MyObject_setProperty):
3325         (MyObject_deleteProperty):
3326         (MyObject_getPropertyList):
3327         (print_callAsFunction):
3328         (myConstructor_callAsConstructor):
3329         (main):
3330         * JavaScriptCore.exp:
3331         * JavaScriptCore.xcodeproj/project.pbxproj:
3332
3333 2006-07-05  Geoffrey Garen  <ggaren@apple.com>
3334
3335         RS by Beth.
3336         
3337         Moved some code around for more logical file separation.
3338
3339         * API/JSBase.h:
3340         * API/JSContextRef.h:
3341         * API/JSObjectRef.cpp:
3342         * API/JSValueRef.cpp:
3343         (JSValueToObject):
3344         * API/JSValueRef.h:
3345
3346 2006-07-03  Geoffrey Garen  <ggaren@apple.com>
3347
3348         Reviewed by Maciej.
3349         
3350         Implemented JSFunctionMakeWithBody, which parses a script as a function body
3351         in the global scope, and returns the resulting anonymous function.
3352         
3353         I also removed private data from JSCallbackFunction. It never worked,
3354         since JSCallbackFunction doesn't inherit from JSCallbackObject.
3355
3356         * API/JSCallbackConstructor.cpp: Removed.
3357         * API/JSCallbackConstructor.h: Removed.
3358         * API/JSCallbackFunction.cpp:
3359         (KJS::JSCallbackFunction::JSCallbackFunction):
3360         (KJS::JSCallbackFunction::implementsConstruct):
3361         (KJS::JSCallbackFunction::construct):
3362         (KJS::JSCallbackFunction::implementsCall):
3363         (KJS::JSCallbackFunction::callAsFunction):
3364         * API/JSCallbackFunction.h:
3365         * API/JSCallbackObject.cpp:
3366         (KJS::JSCallbackObject::staticFunctionGetter):
3367         * API/JSObjectRef.cpp:
3368         (JSFunctionMake):
3369         (JSFunctionMakeWithCallbacks):
3370         * API/JSObjectRef.h:
3371         * API/JSValueRef.h:
3372         * API/minidom.c:
3373         (main):
3374         * API/testapi.c:
3375         (main):
3376         * JavaScriptCore.exp: Programmatically added all symbols exported by
3377         API object files, and sorted results
3378         * JavaScriptCore.xcodeproj/project.pbxproj:
3379
3380 2006-07-03  Geoffrey Garen  <ggaren@apple.com>
3381
3382         Reviewed by Maciej.
3383
3384         - Return syntax error in JSCheckSyntax through a JSValueRef* exception
3385         argument
3386         
3387         * API/JSBase.h:
3388         * API/JSContextRef.cpp:
3389         (JSCheckSyntax):
3390         * API/testapi.c:
3391         (main):
3392         * JavaScriptCore.exp:
3393         * kjs/interpreter.cpp:
3394         (KJS::Interpreter::checkSyntax):
3395         * kjs/interpreter.h:
3396
3397 2006-07-04  Darin Adler  <darin@apple.com>
3398
3399         - fixed build
3400
3401         * wtf/MathExtras.h: Oops. Added missing #endif.
3402
3403 2006-07-04  Bjoern Graf  <bjoern.graf@gmail.com>
3404
3405         Reviewed by Maciej.
3406         Tweaked a bit by Darin.
3407
3408         - http://bugs.webkit.org/show_bug.cgi?id=9678
3409           work around MSVCRT's fmod function returning NaN for fmod(x, infinity) instead of x
3410
3411         * wtf/MathExtras.h: Added include of <float.h>.
3412         (isinf): Fix to return false for NAN.
3413         (wtf_fmod): Added. An inline that works around the bug.
3414
3415         * kjs/nodes.cpp:
3416         * kjs/number_object.cpp:
3417         * kjs/operations.cpp:
3418         * kjs/value.cpp:
3419         Added includes of MathExtras.h to all files using fmod.
3420
3421         * JavaScriptCore.xcodeproj/project.pbxproj: Let Xcode 2.3 have its way with
3422         the project.
3423
3424 2006-07-01  Geoffrey Garen  <ggaren@apple.com>
3425
3426         Reviewed by Darin.
3427         
3428         - Refined value conversions in the API:
3429             - failed toNumber returns NaN
3430             - failed toObject returns NULL
3431             - failed toString returns empty string
3432         
3433         - Refined excpetion handling in the API:
3434             - failed value conversions do not throw exceptions
3435             - uncaught exceptions in JSEvaluate, JSObjectCallAsFunction, and 
3436               JSObjectCallAsConstructor are returned through a JSValueRef* exception
3437               argument
3438             - removed JSContextHasException, because JSContextGetException does
3439               the same job
3440             
3441         * API/JSBase.h:
3442         * API/JSCharBufferRef.cpp:
3443         (JSValueCopyStringValue):
3444         * API/JSContextRef.cpp:
3445         (JSEvaluate):
3446         * API/JSContextRef.h:
3447         * API/JSNodeList.c: Added test code demonstrating how you would use
3448         toNumber, and why you probably don't need toUInt32, etc.
3449         (JSNodeListPrototype_item):
3450         (JSNodeList_getProperty):
3451         * API/JSObjectRef.cpp:
3452         (JSValueToObject):
3453         (JSObjectCallAsFunction):
3454         (JSObjectCallAsConstructor):
3455         * API/JSObjectRef.h:
3456         * API/JSValueRef.cpp:
3457         (JSValueToNumber):
3458         * API/JSValueRef.h:
3459         * API/minidom.c:
3460         (main):
3461         * API/testapi.c:
3462         (main): Added tests for new rules, and call to JSGCProtect to fix Intel 
3463         crash
3464         * JavaScriptCore.exp:
3465
3466 2006-07-03  Darin Adler  <darin@apple.com>
3467
3468         - Rolled out HashMap implementation of NPRuntime, at least temporarily.
3469
3470         Fixes hang in the bindings section of layout tests seen on the
3471         buildbot.
3472
3473         This code was using HashMap<const char*, PrivateIdentifier*>.
3474         But that hashes based on pointer identity, not string value.
3475         The default hash for any pointer type is to hash based on the pointer.
3476         And WTF doesn't currently have a string hash for char*.
3477         We'll need to fix that before re-landing this patch.
3478
3479         (Formatting was also incorrect -- extra spaces in parentheses.)
3480
3481         * bindings/npruntime.cpp: Rolled out last change.
3482
3483 2006-07-02  Justin Haygood  <jhaygood@spsu.edu>
3484
3485         Reviewed, tweaked, landed by ggaren.
3486
3487         - Port NPRuntime from CFDictionary to HashMap.
3488
3489         * bindings/npruntime.cpp:
3490         (getStringIdentifierDictionary):
3491         (getIntIdentifierDictionary):
3492         (_NPN_GetStringIdentifier):
3493         (_NPN_GetIntIdentifier):
3494         * bindings/npruntime.h:
3495
3496 2006-07-01  Geoffrey Garen  <ggaren@apple.com>
3497
3498         Reviewed by Adele.
3499         
3500         - Fixed <rdar://problem/4611197> REGRESSION: Liveconnect with Java test 
3501         fails at http://www-sor.inria.fr/~dedieu/notes/liveconnect/simple_example.html
3502
3503         * JavaScriptCore.exp: Export symbols used by liveconnect
3504
3505 2006-06-29  Geoffrey Garen  <ggaren@apple.com>
3506
3507         Reviewed by Maciej.
3508         
3509         - Phase 2 in the JS API.
3510         
3511         - Added support for specifying static tables of values -- this should
3512         obviate the need for using complicated callbacks for most lookups.
3513         
3514         -  API objects are now created with classes (JSClassRef) -- in order to support
3515         static values, and in order to prevent API objects from storing their
3516         data inline, and thus falling into the oversized (read: slow and prone to
3517         giving Maciej the frowny face) heap.
3518         
3519         - Added two specialized JSObject subclasses -- JSCallbackFunction and JSCallbackConstructor -- 
3520         to allow JSFunctionMake and JSConstructorMake to continue to work with
3521         the new class model. Another solution to this problem would be to create
3522         a custom class object for each function and constructor you make. This
3523         solution is more code but also more efficient.
3524         
3525         - Substantially beefed up the minidom example to demonstrate and test a
3526         lot of these techniques. Its output is still pretty haphazard, though.
3527         
3528         - Gave the <kjs/ preface to some includes -- I'm told this matters to
3529         building on some versions of Linux.
3530         
3531         - Implemented JSValueIsInstanceOf and JSValueIsObjectOfClass
3532         
3533         - Removed GetDescription callback. Something in the class datastructure
3534         should take care of this.
3535
3536         * API/JSBase.h:
3537         * API/JSCallbackConstructor.cpp: Added.
3538         (KJS::):
3539         (KJS::JSCallbackConstructor::JSCallbackConstructor):
3540         (KJS::JSCallbackConstructor::implementsConstruct):
3541         (KJS::JSCallbackConstructor::construct):
3542         (KJS::JSCallbackConstructor::setPrivate):
3543         (KJS::JSCallbackConstructor::getPrivate):
3544         * API/JSCallbackConstructor.h: Added.
3545         (KJS::JSCallbackConstructor::classInfo):
3546         * API/JSCallbackFunction.cpp: Added.
3547         (KJS::):
3548         (KJS::JSCallbackFunction::JSCallbackFunction):
3549         (KJS::JSCallbackFunction::implementsCall):
3550         (KJS::JSCallbackFunction::callAsFunction):
3551         (KJS::JSCallbackFunction::setPrivate):
3552         (KJS::JSCallbackFunction::getPrivate):
3553         * API/JSCallbackFunction.h: Added.
3554         (KJS::JSCallbackFunction::classInfo):
3555         * API/JSCallbackObject.cpp:
3556         (KJS::):
3557         (KJS::JSCallbackObject::JSCallbackObject):
3558         (KJS::JSCallbackObject::init):
3559         (KJS::JSCallbackObject::~JSCallbackObject):
3560         (KJS::JSCallbackObject::className):
3561         (KJS::JSCallbackObject::getOwnPropertySlot):
3562         (KJS::JSCallbackObject::put):
3563         (KJS::JSCallbackObject::deleteProperty):
3564         (KJS::JSCallbackObject::implementsConstruct):
3565         (KJS::JSCallbackObject::construct):
3566         (KJS::JSCallbackObject::implementsCall):
3567         (KJS::JSCallbackObject::callAsFunction):
3568         (KJS::JSCallbackObject::getPropertyList):
3569         (KJS::JSCallbackObject::toBoolean):
3570         (KJS::JSCallbackObject::toNumber):
3571         (KJS::JSCallbackObject::toString):
3572         (KJS::JSCallbackObject::inherits):
3573         (KJS::JSCallbackObject::staticValueGetter):
3574         (KJS::JSCallbackObject::staticFunctionGetter):
3575         (KJS::JSCallbackObject::callbackGetter):
3576         * API/JSCallbackObject.h:
3577         * API/JSCharBufferRef.cpp:
3578         * API/JSClassRef.cpp: Added.
3579         (JSClassCreate):
3580         (JSClassRetain):
3581         (JSClassRelease):
3582         * API/JSClassRef.h: Added.
3583         (StaticValueEntry::StaticValueEntry):
3584         (StaticFunctionEntry::StaticFunctionEntry):
3585         (__JSClass::__JSClass):
3586         * API/JSContextRef.cpp:
3587         (JSContextCreate):
3588         (JSEvaluate):
3589         * API/JSContextRef.h:
3590         * API/JSNode.c: Add