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