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