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