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