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