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