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