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