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