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