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