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