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