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