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