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