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