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