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