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