* tests/mozilla/expected.html: Update test results now that regress-185165.js
[WebKit-https.git] / JavaScriptCore / ChangeLog
1 2006-07-29  Darin Adler  <darin@apple.com>
2
3         * tests/mozilla/expected.html: Update test results now that regress-185165.js
4         is succeeding. I suspect Anders fix for bug 4620655 is the reason.
5
6 2006-07-29  Sam Weinig  <sam.weinig@gmail.com>
7
8         Reviewed by Darin.
9
10         - patch for http://bugzilla.opendarwin.org/show_bug.cgi?id=10080
11           Adopt pedantic changes from the Unity project to improve 
12           cross-compiler compatibility
13
14           Changes include:
15           * Removing trailing semicolon from namespace braces.
16           * Removing trailing comma from last enum declaration.
17           * Updating to match style guidelines.
18           * Adding missing newline to the end of the file.
19           * Turning on gcc warning for missing newline at the end of a source file
20             (GCC_WARN_ABOUT_MISSING_NEWLINE in Xcode, -Wnewline in gcc).
21           * Alphabetical sorting of Xcode source list files. 
22           * Replace use of non-portable variable-size array with Vector.
23           * Use C-style comments instead of C++ comments in files that might
24             be included by either C or C++ files.
25
26         * API/JSCallbackConstructor.cpp:
27         (KJS::JSCallbackConstructor::construct):
28         * API/JSCallbackFunction.cpp:
29         (KJS::JSCallbackFunction::callAsFunction):
30         * API/JSCallbackObject.cpp:
31         (KJS::JSCallbackObject::construct):
32         (KJS::JSCallbackObject::callAsFunction):
33         * JavaScriptCore.xcodeproj/project.pbxproj:
34         * JavaScriptCorePrefix.h:
35         * bindings/jni/jni_class.cpp:
36         (JavaClass::fieldNamed):
37         * bindings/jni/jni_class.h:
38         * bindings/jni/jni_instance.cpp:
39         (JavaInstance::JavaInstance):
40         (JavaInstance::valueOf):
41         * bindings/jni/jni_objc.mm:
42         (KJS::Bindings::dispatchJNICall):
43         * bindings/jni/jni_runtime.cpp:
44         (JavaParameter::JavaParameter):
45         (JavaArray::JavaArray):
46         * bindings/jni/jni_runtime.h:
47         * bindings/jni/jni_utility.h:
48         * bindings/objc/objc_instance.h:
49         * bindings/runtime_array.h:
50         * kjs/collector.h:
51         * kjs/config.h:
52         * kjs/ustring.cpp:
53         * wtf/Platform.h:
54
55 2006-07-29  Mike Emmel  <mike.emmel@gmail.com>
56
57         Reviewed by Darin.
58
59         - fixes for Linux build
60
61         * JavaScriptCoreSources.bkl: Added new files to build, kjs/PropertyNameArray.cpp
62         and kjs/testkjs.cpp, and removed old files.
63
64 2006-07-24  Dan Waylonis  <waylonis@google.com>
65
66         Reviewed and tweaked a bit by Darin.
67
68         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9902
69           jsNull and NSNull not properly converted between JS and ObjC
70
71         * bindings/objc/objc_utility.mm: (KJS::Bindings::convertObjcValueToValue):
72         Added case for converting NSNull to jsNull.
73
74 2006-07-24  Rob Buis  <buis@kde.org>
75
76         Reviewed by Darin.
77
78         http://bugzilla.opendarwin.org/show_bug.cgi?id=4258
79         Date().toString() only includes GMT offset, not timezone string
80
81         Use the info in tm_zone to append timezone abbreviation
82         to Date().toString().
83
84         * kjs/date_object.cpp:
85         (KJS::formatTime):
86
87 2006-07-24  Rob Buis  <buis@kde.org>
88
89         Reviewed by Darin.
90
91         http://bugzilla.opendarwin.org/show_bug.cgi?id=5257
92         setYear() does not match FireFox/IE behavior
93
94         Make sure the right values end up in tm_year.
95
96         * kjs/date_object.cpp:
97         (KJS::formatTime):
98
99 2006-07-23  Mark Rowe  <opendarwin.org@bdash.net.nz>
100
101         Reviewed by Maciej.
102
103         Bug 9686: [Drosera] Need the ability to break into Drosera on Javascript exceptions
104         http://bugzilla.opendarwin.org/show_bug.cgi?id=9686
105
106         JavaScriptCore portion of the fix.
107
108         * JavaScriptCore.exp: Update symbol for change in argument type.
109         * kjs/debugger.cpp:
110         (Debugger::detach): Clear map of recent exceptions.
111         (Debugger::hasHandledException): Track the most recent exception
112         thrown by an interpreter.
113         (Debugger::exception): Change exception argument to a JSValue.
114         * kjs/debugger.h:
115         * kjs/nodes.cpp:
116         (Node::debugExceptionIfNeeded): Notify the debugger of an exception
117         if it hasn't seen it before.
118         (ThrowNode::execute): Notify the debugger that an exception is being thrown.
119         * kjs/nodes.h:
120
121     2006-07-23  Geoffrey Garen  <ggaren@apple.com>
122
123         Patch by Eric Albert, reviewed by Darin and me.
124         
125         - Fixed <rdar://problem/4645931> JavaScriptCore stack-scanning code 
126         crashes (Collector::markStackObjectsConservatively)
127         
128         * bindings/jni/jni_jsobject.cpp: On 64bit systems, jint is a long, not an
129         int.
130         (JavaJSObject::getSlot):
131         (JavaJSObject::setSlot):
132         * kjs/collector.cpp:
133         (KJS::Collector::markCurrentThreadConservatively): Use a pointer instead of
134         an int as 'dummy,' because on LP64 systems, an int is not pointer-aligned,
135         and we want to scan the stack for pointers.
136         * JavaScriptCore.xcodeproj/project.pbxproj: After a tense cease-fire, the 
137         XCode war has started up again!
138
139 === Safari-521.20 ===
140
141 2006-07-21  Geoffrey Garen  <ggaren@apple.com>
142
143         Reviewed by Darin.
144
145         <rdar://problem/4507265> REGRESSION: overlays don't work on HousingMaps.com (Google Maps-based site)
146
147         - Added support for strings that masquerade as undefined. Currently used
148         by WebCore to implement undetectable style.filter.
149         
150         The name is a little long, but it's only used in one line of code, so I
151         thought clarity should win over brevity.
152
153         * JavaScriptCore.exp:
154         * JavaScriptCore.xcodeproj/project.pbxproj:
155         * kjs/object.h:
156         * kjs/string_object.h:
157         (KJS::StringInstanceThatMasqueradesAsUndefined::StringInstanceThatMasqueradesAsUndefined):
158         (KJS::StringInstanceThatMasqueradesAsUndefined::masqueradeAsUndefined):
159         (KJS::StringInstanceThatMasqueradesAsUndefined::toBoolean):
160
161 === Safari-521.19 ===
162
163 2006-07-20  Steve Falkenburg  <sfalken@apple.com>
164
165         Fix the build
166
167         * kjs/function.cpp:
168         (KJS::escapeStringForPrettyPrinting):
169
170 2006-07-19  Anders Carlsson  <acarlsson@apple.com>
171
172         Reviewed by Darin.
173
174         <rdar://problem/4620655> REGRESSION(10.4.7-10.5): preview button for a blogger.com post doesn't work
175         
176         * kjs/nodes2string.cpp:
177         (StringNode::streamTo):
178         Return the escaped string.
179         
180         (RegExpNode::streamTo):
181         Use the correct syntax.
182         
183         * kjs/function.cpp:
184         (KJS::escapeStringForPrettyPrinting):
185         * kjs/function.h:
186         Add escape function which escapes a string for pretty-printing so it can be parsed again.
187         
188         * wtf/unicode/icu/UnicodeIcu.h:
189         (WTF::Unicode::isPrintableChar):
190         New function.
191
192 2006-07-18  Maciej Stachowiak  <mjs@apple.com>
193
194         Reviewed by Adele Peterson.
195         
196         <rdar://problem/4589530> REGRESSION: null character in JS string causes parse error (works in Tiger and in other browsers)
197
198         * kjs/lexer.cpp:
199         (Lexer::shift):
200         (Lexer::lex):
201         (Lexer::record16):
202         (Lexer::scanRegExp):
203         * kjs/lexer.h:
204
205 2006-07-18  Tim Omernick  <timo@apple.com>
206
207         Reviewed by Tim Hatcher.
208
209         Removed a misleading comment; we recently added support for the NPNVPluginElementNPObject
210         variable.
211
212         * bindings/npapi.h:
213
214 === Safari-521.18 ===
215
216 2006-07-18  Timothy Hatcher  <timothy@apple.com>
217
218         Made the following headers public:
219
220         * JavaScriptCore.h
221         * JSBase.h
222         * JSContextRef.h
223         * JSObjectRef.h
224         * JSStringRef.h
225         * JSValueRef.h
226
227         * JavaScriptCore.xcodeproj/project.pbxproj:
228
229 2006-07-17  Geoffrey Garen  <ggaren@apple.com>
230
231         Reviewed by Maciej.
232         
233         - Added automatic prototype creation for classes.
234         
235         A class stores a weak reference to a prototype, which is cleared when
236         the prototype is garbage collected, to avoid a reference cycle.
237         
238         We now have an attributes field in JSClassDefinition, that currently is
239         used only to override automatic prototype creation when you want to manage your
240         own prototypes, but can be extended in the future for other nefarious purposes.
241         
242         Similarly, we have JSObjectMake and JSObjectMakeWithPrototype, the latter
243         allowing you to manage your own prototypes.
244         
245         JSObjectMakeConstructor is more interesting now, able to make a constructor
246         on your behalf if you just give it a class.
247         
248         - Removed bogus old code from minidom.js.
249         
250         - Tweaked the headerdocs.
251         
252         - Added more GC testing, which caught some leaks, and tested more funny 
253         edge cases in lookup, which caught a lookup bug. Removed some testing 
254         we used to do with MyObject because it was redundant with the new, cool 
255         stuff.
256         
257         While fixing the lookup bug I retracted this change:
258         
259             "If a static setProperty callback returns 'false', to indicate that the
260             property was not set, we no longer forward the set request up the class
261             chain, because that's almost certainly not what the programmer expected."
262
263         Returning false when setting a static property is a little silly, but you can see
264         it being useful when shadowing a base class's static properties, and, regardless
265         of usefullness, this is the defined behavior of the setProperty callback.
266         
267         - Plus a little ASCII art, for the kids.
268
269 2006-07-17  Timothy Hatcher  <timothy@apple.com>
270
271         Reviewed by Maciej.
272
273         <rdar://problem/4634874> WebScriptObject and WebUndefined are no longer defined by WebKit
274
275         Moves WebScriptObject and WebUndefined up to WebCore.
276         This change does create an upwards-dependancy on WebScriptObject existing
277         in the loaded process, but this code path in JavaScriptCore does not get used
278         unless it is through WebKit/WebCore. Moving all of the binding code out of
279         JavaScriptCore might make sense in the future.
280
281         * JavaScriptCore.exp:
282         * JavaScriptCore.xcodeproj/project.pbxproj:
283         * bindings/objc/WebScriptObject.h: Replaced.
284         * bindings/objc/WebScriptObject.mm: Removed.
285         * bindings/objc/WebScriptObjectPrivate.h: Removed.
286         * bindings/objc/objc_class.h:
287         * bindings/objc/objc_instance.h:
288         * bindings/objc/objc_instance.mm:
289         (ObjcInstance::~ObjcInstance):
290         * bindings/objc/objc_runtime.h:
291         * bindings/objc/objc_runtime.mm:
292         (convertValueToObjcObject):
293         * bindings/objc/objc_utility.mm:
294         (KJS::Bindings::convertValueToObjcValue):
295         (KJS::Bindings::convertObjcValueToValue):
296         (KJS::Bindings::createObjcInstanceForValue):
297
298 2006-07-17  Darin Adler  <darin@apple.com>
299
300         * API/JSBase.h: Fix comment formatting where things used to be lined up but
301         are now ragged. Got rid of spaces that attempted to line things up.
302         * API/JSObjectRef.h: Ditto. Also add missing periods for a couple of comments.
303
304 2006-07-17  Geoffrey Garen  <ggaren@apple.com>
305
306         Reviewed by Maciej.
307         
308         - Removed the exception parameter from the initialize callback and, by extension,
309         JSObjectMake. We have never had a need for exceptions when iniitializing,
310         so the parameter seemed likely to "get in the way." 
311         
312         Also, an exception in JavaScript is thrown in response to input -- 
313         "invalid URL", "index not a number", etc., so it's the job of the 
314         constructor function, not the initialize method, to throw.
315         
316         If initialize *really* wants to throw, it can communicate the throw to
317         the constructor through the constructed object's private data (e.g., set
318         it to NULL, signaling to the consntructor that initialization failed.)
319         
320         - Added JSObjectMakeWithData, which enables a constructor to set private
321         data on an object *before* it has been initialized. That way, the initialize
322         methods can properly operate on the data. 
323
324         * API/JSNode.c: Moved ref into the initialize method, for better encapsulation,
325         now that it's possible.
326         * API/JSNodeList.c: ditto
327         * API/minidom.c:
328         (main): Do more aggressive garbage collection to test ref/deref and 
329         initialize/finalize.
330         * API/minidom.js: store childNodes in a temporary so it doesn't get re-created
331         like a thousand times. This makes debugging ref/deref easier
332
333 2006-07-17  Geoffrey Garen  <ggaren@apple.com>
334
335         Reviewed by Maciej.
336         
337         - Changed the initialize callback to run from least derived class (parent
338         class) to most derived class. This enables C++ style initialization,
339         and derived class overriding of member data.
340         
341         - Added excpetion propopgation to JSObjectMake, to support initialize
342         exceptions, and generally round out our policy of making function
343         signatures as long as possible.
344
345         * API/JSCallbackObject.h: Use ExecState instead of ContextRef, cuz we're
346         in C++ land now.
347
348 2006-07-17  Geoffrey Garen  <ggaren@apple.com>
349
350         Reviewed by Maciej.
351         
352         - Changed JSObjectMakeConstructor to JSObjectMakeConstructorWithCallback,
353         to match JSObjectMakeFunctionWithCallback.
354         
355         - Added prototype parameter, so the generated constructor
356         automatically works with hasInstance / instanceof
357         
358         - Moved hasInstance implementation from InternalFunctionImp to JSObject
359         so that subclasses can inherit it without inheriting function-related baggage.
360         More refactoring here would be good, but this seems like a good short-term
361         solution.
362
363         (KJS::JSCallbackFunction::implementsHasInstance): override and return false,
364         because callback functions aren't constructors.
365
366 2006-07-17  Maciej Stachowiak  <mjs@apple.com>
367
368         Reviewed by Geoff.
369         
370         - add a JSContextRef parameter to all JSValueRef, JSObjectRef, and JSContextRef operations;
371         except JSObject{Get,Set}PrivateData which can be assumed to be simple pure accessors.
372         
373         Also renamed the parameter "context" to "ctx" because it makes the code read better with this pervasive
374         but usually uninteresting parameter.
375
376         * API/JSBase.cpp:
377         (JSEvaluateScript):
378         (JSCheckScriptSyntax):
379         (JSGarbageCollect):
380         * API/JSBase.h:
381         * API/JSCallbackObject.cpp:
382         (KJS::JSCallbackObject::JSCallbackObject):
383         (KJS::JSCallbackObject::init):
384         (KJS::JSCallbackObject::getOwnPropertySlot):
385         (KJS::JSCallbackObject::put):
386         (KJS::JSCallbackObject::deleteProperty):
387         (KJS::JSCallbackObject::toNumber):
388         (KJS::JSCallbackObject::toString):
389         * API/JSContextRef.cpp:
390         (JSGlobalContextCreate):
391         (JSGlobalContextRetain):
392         (JSGlobalContextRelease):
393         (JSContextGetGlobalObject):
394         * API/JSContextRef.h:
395         * API/JSNode.c:
396         (JSNodePrototype_appendChild):
397         (JSNodePrototype_removeChild):
398         (JSNodePrototype_replaceChild):
399         (JSNode_getNodeType):
400         (JSNode_getFirstChild):
401         (JSNode_prototype):
402         * API/JSNodeList.c:
403         (JSNodeListPrototype_item):
404         (JSNodeList_length):
405         (JSNodeList_getProperty):
406         (JSNodeList_prototype):
407         * API/JSObjectRef.cpp:
408         (JSObjectMake):
409         (JSObjectMakeFunctionWithCallback):
410         (JSObjectMakeConstructor):
411         (JSObjectMakeFunction):
412         (JSObjectGetPrototype):
413         (JSObjectSetPrototype):
414         (JSObjectHasProperty):
415         (JSObjectGetProperty):
416         (JSObjectSetProperty):
417         (JSObjectGetPropertyAtIndex):
418         (JSObjectSetPropertyAtIndex):
419         (JSObjectDeleteProperty):
420         (JSObjectIsFunction):
421         (JSObjectCallAsFunction):
422         (JSObjectIsConstructor):
423         (JSObjectCallAsConstructor):
424         (JSObjectCopyPropertyNames):
425         * API/JSObjectRef.h:
426         * API/JSStringRef.cpp:
427         * API/JSValueRef.cpp:
428         (JSValueGetType):
429         (JSValueIsUndefined):
430         (JSValueIsNull):
431         (JSValueIsBoolean):
432         (JSValueIsNumber):
433         (JSValueIsString):
434         (JSValueIsObject):
435         (JSValueIsObjectOfClass):
436         (JSValueIsEqual):
437         (JSValueIsStrictEqual):
438         (JSValueIsInstanceOfConstructor):
439         (JSValueMakeUndefined):
440         (JSValueMakeNull):
441         (JSValueMakeBoolean):
442         (JSValueMakeNumber):
443         (JSValueMakeString):
444         (JSValueToBoolean):
445         (JSValueToNumber):
446         (JSValueToStringCopy):
447         (JSValueToObject):
448         (JSValueProtect):
449         (JSValueUnprotect):
450         * API/JSValueRef.h:
451         * API/minidom.c:
452         (print):
453         * API/testapi.c:
454         (MyObject_getProperty):
455         (MyObject_deleteProperty):
456         (MyObject_callAsFunction):
457         (MyObject_callAsConstructor):
458         (MyObject_convertToType):
459         (print_callAsFunction):
460         (main):
461
462 2006-07-16  Geoffrey Garen  <ggaren@apple.com>
463
464         Approved by Maciej, RS by Beth.
465         
466         JSObjectMakeFunction -> JSObjectMakeFunctionWithCallback
467         JSObjectMakeFunctionWithBody -> JSObjectMakeFunction
468         
469         because the latter is more common, and more fundamental, than the former.
470
471         * API/APICast.h:
472         (toJS):
473         * API/JSBase.h:
474         * API/JSCallbackObject.cpp:
475         (KJS::JSCallbackObject::getOwnPropertySlot):
476         (KJS::JSCallbackObject::put):
477         (KJS::JSCallbackObject::deleteProperty):
478         (KJS::JSCallbackObject::getPropertyNames):
479         (KJS::JSCallbackObject::staticValueGetter):
480         (KJS::JSCallbackObject::staticFunctionGetter):
481         * API/JSClassRef.cpp:
482         (OpaqueJSClass::OpaqueJSClass):
483         (OpaqueJSClass::~OpaqueJSClass):
484         * API/JSClassRef.h:
485         * API/JSObjectRef.cpp:
486         (JSClassCreate):
487         (JSObjectMakeFunctionWithCallback):
488         (JSObjectMakeFunction):
489         (OpaqueJSPropertyNameArray::OpaqueJSPropertyNameArray):
490         (JSObjectCopyPropertyNames):
491         * API/JSObjectRef.h:
492         * API/minidom.c:
493         (main):
494         * API/testapi.c:
495         (main):
496         * ChangeLog:
497         * JavaScriptCore.exp:
498
499 2006-07-16  Geoffrey Garen  <ggaren@apple.com>
500
501         Laughed at by Beth.
502         
503         Replace __JS with OpaqueJS because the former, while used by CF, is
504         a prefix that's triply-reserved by the compiler. (_* is reserved in global 
505         names, _[A-Z] is reserved in all names, and __ is reserved in all names 
506         in C++.)
507         
508         Opaque is an alternative used by other Mac OS X framewokrs.
509
510         * API/APICast.h:
511         (toJS):
512         * API/JSBase.h:
513         * API/JSCallbackObject.cpp:
514         (KJS::JSCallbackObject::getOwnPropertySlot):
515         (KJS::JSCallbackObject::put):
516         (KJS::JSCallbackObject::deleteProperty):
517         (KJS::JSCallbackObject::getPropertyNames):
518         (KJS::JSCallbackObject::staticValueGetter):
519         (KJS::JSCallbackObject::staticFunctionGetter):
520         * API/JSClassRef.cpp:
521         (OpaqueJSClass::OpaqueJSClass):
522         (OpaqueJSClass::~OpaqueJSClass):
523         * API/JSClassRef.h:
524         * API/JSObjectRef.cpp:
525         (JSClassCreate):
526         (OpaqueJSPropertyNameArray::OpaqueJSPropertyNameArray):
527         (JSObjectCopyPropertyNames):
528
529 2006-07-16  Darin Adler  <darin@apple.com>
530
531         - try to fix Windows build
532
533         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
534         Added some recently added files, removed some recently removed.
535
536 2006-07-16  Geoffrey Garen  <ggaren@apple.com>
537
538         Reviewed by Maciej.
539         
540         - Change getProperty* to return undefined, rather than NULL, for missing
541         properties, since that's what the spec says. Also added exception out
542         parameters to the *Index functions, because they can call through to the
543         regular functions, which can throw for custom objects.
544
545         * API/JSObjectRef.cpp:
546         (JSObjectGetProperty):
547         (JSObjectGetPropertyAtIndex):
548         (JSObjectSetPropertyAtIndex):
549         * API/JSObjectRef.h:
550         * API/testapi.c:
551         (main):
552
553 2006-07-16  Geoffrey Garen  <ggaren@apple.com>
554
555         Reviewed by Maciej.
556         
557         - Properly document and handle NULL callbacks for static properties. We
558         throw an exception in any case other than a ReadOnly property with a NULL
559         setProperty callback, because a NULL callback almost certainly indicates 
560         a programming error. Also throw an exception if hasProperty returns true
561         for a property that getProperty can't get.
562         
563         - If a static setProperty callback returns 'false', to indicate that the
564         property was not set, we no longer forward the set request up the class
565         chain, because that's almost certainly not what the programmer expected.
566
567         * API/JSCallbackObject.cpp:
568         (KJS::JSCallbackObject::getOwnPropertySlot):
569         (KJS::JSCallbackObject::put):
570         (KJS::JSCallbackObject::staticValueGetter):
571         (KJS::JSCallbackObject::staticFunctionGetter):
572         (KJS::JSCallbackObject::callbackGetter):
573         * API/JSObjectRef.h:
574         * API/minidom.js:
575         * API/testapi.c:
576         (MyObject_hasProperty):
577         * API/testapi.js:
578
579 2006-07-16  Geoffrey Garen  <ggaren@apple.com>
580
581         Reviewed by Maciej.
582         
583         - Added names to functions.
584         
585         - Removed GetPrivate/SetPrivate from callbackFunctions and callbackConstructors.
586         The private data idiom is that a JS object stores its native implementation
587         as private data. For functions and constructors, the native implementation is nothing
588         more than the callback they already store, so supporting private data, too,
589         confuses the idiom. If you *really* want, you can still create a custom 
590         function with private data.
591
592         * API/JSCallbackConstructor.cpp:
593         * API/JSCallbackConstructor.h:
594         * API/JSCallbackFunction.cpp:
595         (KJS::JSCallbackFunction::JSCallbackFunction):
596         * API/JSCallbackFunction.h:
597         * API/JSCallbackObject.cpp:
598         (KJS::JSCallbackObject::staticFunctionGetter):
599         * API/JSObjectRef.cpp:
600         (JSObjectMakeFunction):
601         (JSObjectMakeFunctionWithBody):
602         (JSObjectGetPrivate):
603         (JSObjectSetPrivate):
604         * API/JSObjectRef.h:
605         * API/minidom.c:
606         (main):
607         * API/testapi.c:
608         (main):
609
610 2006-07-15  Maciej Stachowiak  <mjs@apple.com>
611
612         Reviewed by Darin.
613         
614         - switch property lists to be vector+set of Identifiers instead of list of References
615         
616         This has the following benefits:
617         
618         - no duplicates in property lists
619         - simplifies API calls
620         - probably more efficient, since linked list is gone
621         - entirely removed Reference, ReferenceList and ProtectedReference types from the API
622
623         * kjs/PropertyNameArray.cpp: Added.
624         (KJS::PropertyNameArray::add): Check set, if not already there, add to
625         vector.
626         * kjs/PropertyNameArray.h: Added.
627         (KJS::PropertyNameArray::PropertyNameArray): Newly added type, combines
628         a set and a vector to make a unique but ordered list of identifiers.
629         (KJS::PropertyNameArray::begin): ditto
630         (KJS::PropertyNameArray::end): ditto
631         (KJS::PropertyNameArray::size): ditto
632         (KJS::PropertyNameArray::operator[]): ditto
633         * kjs/array_instance.h:
634         * kjs/array_object.cpp:
635         (ArrayInstance::getPropertyNames): renamed from getPropertyList, updated
636         for PropertyNameArray
637         (ArrayInstance::setLength): updated for PropertyNameArray
638         (ArrayInstance::pushUndefinedObjectsToEnd): ditto
639         * kjs/nodes.cpp:
640         (ForInNode::execute): updated for PropertyNameArray
641         * kjs/nodes.h:
642         * kjs/object.cpp:
643         (KJS::JSObject::getPropertyNames): renamed from getPropertyList, updated
644         for PropertyNameArray
645         * kjs/object.h:
646         * kjs/property_map.cpp:
647         (KJS::PropertyMap::getEnumerablePropertyNames): updated for PropertyNameArray
648         (KJS::PropertyMap::getSparseArrayPropertyNames): ditto
649         * kjs/property_map.h:
650         * kjs/protected_reference.h: Removed.
651         * kjs/reference.cpp: Removed.
652         * kjs/reference.h: Removed.
653         * kjs/reference_list.cpp: Removed.
654         * kjs/reference_list.h: Removed.
655         * kjs/scope_chain.cpp:
656         (KJS::ScopeChain::print): Use PropertyNamesArray instead of ReferenceList.
657         * kjs/string_object.cpp:
658         (StringInstance::getPropertyNames): Updated for new approach.
659         * kjs/string_object.h:
660         * kjs/ustring.h:
661         * API/APICast.h:
662         (toJS): Added overload for PropertyNameAccumulatorRef / PropertyNameArray*
663         (toRef): ditto
664         * API/JSBase.h:
665         * API/JSCallbackObject.cpp:
666         (KJS::JSCallbackObject::getPropertyNames): Fixed for new API.
667         * API/JSCallbackObject.h:
668         * API/JSObjectRef.cpp:
669         (__JSPropertyNameArray::__JSPropertyNameArray): Type used for a publicly vended
670         JSPropertyNameArrayRef.
671         (JSObjectCopyPropertyNames): New API call - renamed / refactored from 
672         JSObjectCreatePropertyList
673         (JSPropertyNameArrayRetain): new retain call for JSPropertyNameArray.
674         (JSPropertyNameArrayRelease): new release call for - " -.
675         (JSPropertyNameArrayGetCount): Instead of having to use a stateful enumerator you
676         can now get the count and items in any order.
677         (JSPropertyNameArrayGetNameAtIndex): See above.
678         (JSPropertyNameAccumulatorAddName): What you add properties to is now an opaque 
679         accumulator object.
680         * API/JSObjectRef.h: Prototyped new functions, removed old ones
681         * JavaScriptCore.exp: Updated exported symbols.
682         * JavaScriptCore.xcodeproj/project.pbxproj: Added new files, removed old.
683         * API/testapi.c:
684         (MyObject_getPropertyNames): Renamed / fixed callback to fit new paradigm.
685         (main): Updated for new API.
686
687 2006-07-15  Darin Adler  <darin@apple.com>
688
689         - oops, missed a few more arrays that had to be const
690
691         * API/JSNode.c:
692         (JSNodePrototype_appendChild): Added const.
693         (JSNodePrototype_removeChild): Ditto.
694         (JSNodePrototype_replaceChild): Ditto.
695         (JSNode_construct): Ditto.
696         * API/JSNodeList.c:
697         (JSNodeListPrototype_item): Ditto.
698         * API/JSObjectRef.cpp:
699         (JSObjectMakeFunctionWithBody): Ditto.
700         (JSObjectCallAsFunction): Ditto.
701         (JSObjectCallAsConstructor): Ditto.
702         * API/minidom.c:
703         (print): Ditto.
704         * API/testapi.c:
705         (MyObject_callAsFunction): Ditto.
706         (MyObject_callAsConstructor): Ditto.
707         (print_callAsFunction): Ditto.
708         (myConstructor_callAsConstructor): Ditto.
709
710 2006-07-15  Darin Adler  <darin@apple.com>
711
712         Reviewed by Maciej.
713
714         * API/JSNode.h: Made an array parameter const.
715         * API/JSObjectRef.h: Made array parameters const. Fixed a comment.
716
717 2006-07-15  Geoffrey Garen  <ggaren@apple.com>
718
719         Reviewed by Maciej.
720         
721         - JSObjectMakeFunctionWithBody includes a function name and named parameters now.
722
723         * API/JSObjectRef.cpp:
724         (JSObjectMakeFunctionWithBody):
725         * API/JSObjectRef.h:
726         * API/testapi.c:
727         (assertEqualsAsUTF8String): More informative failure reporting.
728         (main): Test more function cases.
729
730 2006-07-15  Geoffrey Garen  <ggaren@apple.com>
731
732         Reviewed by Maciej.
733
734         - Moved the arguments passed to JSClassCreate into a single structure,
735         called JSClassDefinition. This will enable easier structure 
736         migration/versioning in the future, if necessary.
737         
738         - Added support for class names.
739         
740         - kJSClassDefinitionNull replaces kJSObjectCallbacksNone.
741         
742         - JSClass is becoming a fairly complex struct, so I migrated all of its
743         implementation other than reference counting to the sruct.
744         
745         - Also moved JSClass* functions in the API to JSObjectRef.cpp, since they're
746         declared in JSObjectRef.h
747         
748         - Also added some more informative explanation to the class structure doc.
749         
750 2006-07-15  Darin Adler  <darin@apple.com>
751
752         Reviewed by Geoff.
753
754         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8395
755           <rdar://problem/4613467>
756           REGRESSION: RegEx seems broken for hex escaped non breaking space
757
758         Test: fast/js/regexp-extended-characters-more.html
759
760         * pcre/pcre_exec.c:
761         (match): Got rid of utf16Length local variable to guarantee there's no
762         extra stack usage in recursive calls. Fixed two places in the PCRE_UTF16
763         code that were using the length variable, which is the UTF-8 length of
764         a character in the pattern, to move in the UTF-16 subject string. Instead
765         they hardcode lengths of 1 and 2 since the code already handles BMP
766         characters and surrogate pairs separately. Also fixed some DPRINTF so
767         I could compile with DEBUG on.
768         (pcre_exec): Changed a place that was checking for multibyte characters
769         in the subject string to use ISMIDCHAR. Instead it was using hardcoded
770         logic that was right for UTF-8 but wrong for UTF-16.
771
772         * pcre/pcre_compile.c: (pcre_compile2): Fixed a DPRINTF so I could compile
773         with DEBUG on.
774
775 2006-07-14  Geoffrey Garen  <ggaren@apple.com>
776
777         RS by Maciej.
778         
779         Global replace in the API of argc/argv with argumentCount/arguments.
780
781 2006-07-14  Geoffrey Garen  <ggaren@apple.com>
782
783         Reviewed by Maciej.
784         
785         - Finalized exception handling in the API.
786         
787         setProperty can throw because it throws for built-in arrays. getProperty
788         and deleteProperty can throw because setProperty can throw and we want
789         to be consistent, and also because they seem like "actions." callAsFunction,
790         callAsConstructor, and hasInstance can throw, because they caan throw for
791         all built-ins.
792         
793         toBoolean can't throw because it's defined that way in the spec.
794         
795         - Documented that toBoolean and toObject can't be overridden by custom 
796         objects because they're defined that way in the spec.
797
798 === Safari-521.17 ===
799
800 2006-07-14  Geoffrey Garen  <ggaren@apple.com>
801
802         Reviewed by Maciej.
803         
804         - Implemented ref-counting of JSContexts by splitting into two datatypes:
805         JSGlobalContext, which you can create/retain/release, and JSContext, which
806         you can't.
807         
808         Internally, you retain a JSGlobalContext/ExecState by retaining its
809         interpreter, which, in the case of a global ExecState, owns it.
810         
811         - Also made ~Interpreter() protected to catch places where Interpreter
812         is manually deleted. (Can't make it private because some crazy fool
813         decided it would be a good idea to subclass Interpreter in other frameworks.
814         I pity da fool.)
815
816         * API/APICast.h: 
817         (toJS): Added cast for new JSGlobalContext
818         * API/JSStringRef.h: Changed vague "you must" language to more specific
819         (but, ultimately, equally vague) "behavior is undefined if you don't" 
820         language.
821         (KJS::Interpreter::Interpreter): Factored more common initialization into
822         init()
823         * kjs/interpreter.h:
824         (KJS::Interpreter::ref): new
825         (KJS::Interpreter::deref): new
826         (KJS::Interpreter::refCount): new
827         * kjs/testkjs.cpp: 
828         (doIt): Ref-count the interpreter.
829
830 2006-07-14  Maciej Stachowiak  <mjs@apple.com>
831
832         Reviewed by Geoff.
833         
834         - removed bool return value from JSObjectSetProperty, since it is inefficient and
835         also doesn't work quite right
836         - added JSObjectGetPropertyAtIndex and JSObjectSetPropertyAtIndex
837
838         * API/JSObjectRef.cpp:
839         (JSObjectSetProperty): Removed return value and canPut stuff.
840         (JSObjectGetPropertyAtIndex): Added.
841         (JSObjectSetPropertyAtIndex): Added.
842         * API/JSObjectRef.h: Prototyped and documented new functions.
843
844 2006-07-14  Geoffrey Garen  <ggaren@apple.com>
845
846         Reviewed by Beth.
847         
848         Moved JSCheckScriptSyntax, JSEvaluateScript, and JSGarbageCollect into
849         JSBase.h/.cpp. They don't belong in the value-specific or context-specific 
850         files because they're not part of the value or context implementations.
851
852         * API/JSBase.h:
853         * API/JSContextRef.cpp:
854         (JSContextGetGlobalObject):
855         * API/JSContextRef.h:
856         * API/JSValueRef.cpp:
857         (JSValueUnprotect):
858         * API/JSValueRef.h:
859         * JavaScriptCore.xcodeproj/project.pbxproj:
860
861 2006-07-13  Timothy Hatcher  <timothy@apple.com>
862
863         Reviewed by Maciej.
864
865         Moved JavaScriptCore to be a public framework.
866
867         * JavaScriptCore.xcodeproj/project.pbxproj:
868
869 2006-07-13  Mark Rowe  <opendarwin.org@bdash.net.nz>
870
871         Reviewed by Geoffrey.
872
873         http://bugzilla.opendarwin.org/show_bug.cgi?id=9742
874         Bug 9742: REGRESSION: WebKit hangs when loading <http://www.vtbook.com>
875
876         * kjs/value.h:
877         (KJS::JSValue::getUInt32): Only types tagged as numeric can be converted to UInt32.
878
879 2006-07-13  Geoffrey Garen  <ggaren@apple.com>
880
881         Pleasing to Maciej.
882         
883         - Renamed JSEvaluate -> JSEvaluateScript, JSCheckSyntax -> JSCheckScriptSyntax
884         - Added exception out parameters to JSValueTo* and JSValueIsEqual because
885         they can throw
886         - Removed JSObjectGetDescription because it's useless and vague, and 
887         JSValueToString/JSValueIsObjectOfClass do a better job, anyway
888         - Clarified comments about "IsFunction/Constructor" to indicate that they
889         are true of all functions/constructors, not just those created by JSObjectMake*
890
891 2006-07-12  Geoffrey Garen  <ggaren@apple.com>
892
893         RS by Beth.
894         
895         Finished previously approved JSInternalString -> JSString conversion 
896         by renaming the files.
897
898         * API/JSCallbackObject.cpp:
899         * API/JSInternalStringRef.cpp: Removed.
900         * API/JSInternalStringRef.h: Removed.
901         * API/JSStringRef.cpp: Added.
902         * API/JSStringRef.h: Added.
903         * API/JavaScriptCore.h:
904         * JavaScriptCore.xcodeproj/project.pbxproj:
905
906 2006-07-12  Geoffrey Garen  <ggaren@apple.com>
907
908         Reviewed by Maciej.
909         
910         - Removed context and exception parameters from JSObjectGetPropertyEnumerator,
911         removing the spurious use of ExecState inside JavaScriptCore that made
912         us think this was necessary in the first place.
913
914         (StringInstance::getPropertyList): Use getString instead of toString because
915         we know we're dealing with a string -- we put it there in the first place.
916         While we're at it, store the string's size instead of retrieving it each time 
917         through the loop, to avoid the unnecessary killing of puppies.
918         * kjs/string_object.h:
919
920 2006-07-12  Maciej Stachowiak  <mjs@apple.com>
921
922         Reviewed by Geoff.
923         
924         - add handling of hasInstance callback for API objects
925
926         * API/JSCallbackObject.cpp:
927         (KJS::JSCallbackObject::implementsHasInstance): Check if callback is present.
928         (KJS::JSCallbackObject::hasInstance): Invoke appropriate callback.
929         * API/JSCallbackObject.h:
930         * API/JSClassRef.cpp:
931         * API/JSObjectRef.h:
932         * API/testapi.c:
933         (MyObject_hasInstance): Test case; should match what construct would do.
934         * API/testapi.js:
935
936 2006-07-11  Geoffrey Garen  <ggaren@apple.com>
937
938         Reviewed by Maciej.
939         
940         - Implemented a vast number of renames and comment clarifications 
941         suggested during API review.
942         
943         JSInternalString -> JSString
944         JS*Make -> JSValueMake*, JSObjectMake*
945         JSTypeCode -> JSType
946         JSValueIsInstanceOf -> JSValueIsInstanceOfConstructor (reads strangely well in client code)
947         JSGC*Protect -> JSValue*Protect
948         JS*Callback -> JSObject*Callback
949         JSGetPropertyListCallback -> JSObjectAddPropertiesToListCallback
950         JSPropertyEnumeratorGetNext -> JSPropertyEnumeratorGetNextName
951         JSString* -> 
952             JSStringCreateWithUTF8CString, JSStringGetUTF8CString,
953             JSStringGetMaximumUTF8CStringSize JSStringIsEqualToUTF8CString, 
954             JSStringCreateWithCFString, JSStringCopyCFString, JSStringCreateWithCharacters.
955         
956         - Changed functions taking a JSValue out arg and returning a bool indicating
957         whether it was set to simply return a JSValue or NULL.
958         
959         - Removed JSStringGetCharacters because it's more documentation than code,
960         and it's just a glorified memcpy built on existing API functionality.
961         
962         - Moved standard library includes into the headers that actually require them.
963         
964         - Standardized use of the phrase "Create Rule."
965         
966         - Removed JSLock from make functions that don't allocate.
967         
968         - Added exception handling to JSValueToBoolean, since we now allow
969         callback objects to throw exceptions upon converting to boolean.
970         
971         - Renamed JSGCCollect to JSGarbageCollect.
972
973 2006-07-10  Geoffrey Garen  <ggaren@apple.com>
974
975         Reviewed by Darin.
976         
977         - Changed public header includes to the <JavaScriptCore/ style.
978         - Changed instances of 'buffer' to 'string' since we decided on
979         JSInternalString instead of JSStringBuffer.
980
981         * API/JSContextRef.h:
982         * API/JSInternalStringRef.cpp:
983         (JSStringMake):
984         (JSInternalStringRetain):
985         (JSInternalStringRelease):
986         (JSValueCopyStringValue):
987         (JSInternalStringGetLength):
988         (JSInternalStringGetCharactersPtr):
989         (JSInternalStringGetCharacters):
990         (JSInternalStringGetMaxLengthUTF8):
991         (JSInternalStringGetCharactersUTF8):
992         (CFStringCreateWithJSInternalString):
993         * API/JSInternalStringRef.h:
994         * API/JSNode.c:
995         (JSNodePrototype_appendChild):
996         (JSNode_getNodeType):
997         * API/JSObjectRef.cpp:
998         (JSObjectCallAsConstructor):
999         * API/JSValueRef.h:
1000         * API/JavaScriptCore.h:
1001         * API/minidom.c:
1002         (main):
1003         (print):
1004         * API/testapi.c:
1005         (MyObject_getPropertyList):
1006         (myConstructor_callAsConstructor):
1007         (main): I noticed that we were prematurely releasing some string buffers,
1008         so I moved their release calls to the end of main(). I got rid of 'Buf' in *Buf
1009         (sometimes changing to 'IString', when necessary to differentiate a variable) 
1010         to match the buffer->string change.
1011
1012 === Safari-521.16 ===
1013
1014 2006-07-10  Darin Adler  <darin@apple.com>
1015
1016         * kjs/value.cpp: (KJS::JSValue::toInt32Inline): Added inline keyword one more place.
1017         Just in case.
1018
1019 2006-07-10  Darin Adler  <darin@apple.com>
1020
1021         - fix the release build
1022
1023         * kjs/value.h:
1024         * kjs/value.cpp:
1025         (KJS::JSValue::toInt32Inline): Move the code here to an inline.
1026         (KJS::JSValue::toInt32): Call the inline from both overloaded toInt32 functions.
1027
1028 2006-07-10  David Kilzer  <ddkilzer@kilzer.net>
1029
1030         Reviewed by Darin.
1031
1032         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9179
1033           Implement select.options.add() method
1034
1035         * JavaScriptCore.exp: Added overloaded KJS::JSValue::toInt32() method.
1036         * JavaScriptCore.xcodeproj/project.pbxproj: Altered attributes metadata for
1037         kjs/value.h to make it available as a forwarded header.
1038         * kjs/lookup.h:
1039         (KJS::lookupPut): Extracted a lookupPut() method from the existing lookupPut() method.
1040         The new method returns a boolean value if no entry is found in the lookup table.
1041         * kjs/value.cpp:
1042         (KJS::JSValue::toInt32): Overloaded toInt32() method with boolean "Ok" argument.
1043         * kjs/value.h: Ditto.
1044
1045 2006-07-10  Geoffrey Garen  <ggaren@apple.com>
1046
1047         No review necessary. Removed bogus file I accidentally checked in before.
1048
1049         * API/JSInternalSringRef.h: Removed.
1050
1051 2006-07-10  Geoffrey Garen  <ggaren@apple.com>
1052
1053         Reviewed by Darin.
1054         
1055         Added exception out parameter to API object callbacks, removed semi-bogus
1056         JSContext(.*)Exception functions.
1057         
1058         To make these calls syntactically simple, I added an exceptionSlot()
1059         method to the ExecState class, which provides a JSValue** slot in which to 
1060         store a JSValue* exception.
1061
1062         * API/APICast.h:
1063         (toRef):
1064         * API/JSCallbackConstructor.cpp:
1065         (KJS::JSCallbackConstructor::construct):
1066         * API/JSCallbackFunction.cpp:
1067         (KJS::JSCallbackFunction::callAsFunction):
1068         * API/JSCallbackObject.cpp:
1069         (KJS::JSCallbackObject::init):
1070         (KJS::JSCallbackObject::getOwnPropertySlot):
1071         (KJS::JSCallbackObject::put):
1072         (KJS::JSCallbackObject::deleteProperty):
1073         (KJS::JSCallbackObject::construct):
1074         (KJS::JSCallbackObject::callAsFunction):
1075         (KJS::JSCallbackObject::getPropertyList):
1076         (KJS::JSCallbackObject::toBoolean):
1077         (KJS::JSCallbackObject::toNumber):
1078         (KJS::JSCallbackObject::toString):
1079         (KJS::JSCallbackObject::staticValueGetter):
1080         (KJS::JSCallbackObject::callbackGetter):
1081         * API/JSContextRef.cpp:
1082         (JSCheckSyntax):
1083         * API/JSContextRef.h:
1084         * API/JSNode.c:
1085         (JSNodePrototype_appendChild):
1086         (JSNodePrototype_removeChild):
1087         (JSNodePrototype_replaceChild):
1088         (JSNode_getNodeType):
1089         (JSNode_getChildNodes):
1090         (JSNode_getFirstChild):
1091         (JSNode_construct):
1092         * API/JSNode.h:
1093         * API/JSNodeList.c:
1094         (JSNodeListPrototype_item):
1095         (JSNodeList_length):
1096         (JSNodeList_getProperty):
1097         * API/JSObjectRef.h:
1098         * API/minidom.c:
1099         (print):
1100         * API/testapi.c:
1101         (MyObject_initialize):
1102         (MyObject_hasProperty):
1103         (MyObject_getProperty):
1104         (MyObject_setProperty):
1105         (MyObject_deleteProperty):
1106         (MyObject_getPropertyList):
1107         (MyObject_callAsFunction):
1108         (MyObject_callAsConstructor):
1109         (MyObject_convertToType):
1110         (print_callAsFunction):
1111         (myConstructor_callAsConstructor):
1112         (main):
1113         * JavaScriptCore.exp:
1114         * kjs/ExecState.h:
1115         (KJS::ExecState::exceptionHandle):
1116
1117 2006-07-10  Geoffrey Garen  <ggaren@apple.com>
1118
1119         Reviewed by Darin.
1120
1121         Improved type safety by implementing opaque JSValue/JSObject typing through 
1122         abuse of 'const', not void*. Also fixed an alarming number of bugs
1123         exposed by this new type safety.
1124         
1125         I made one design change in JavaScriptCore, which is that the JSObject
1126         constructor should take a JSValue* as its prototype argument, not a JSObject*,
1127         since we allow the prototype to be any JSValue*, including jsNull(), for
1128         example.
1129         
1130         * API/APICast.h:
1131         (toJS):
1132         * API/JSBase.h:
1133         * API/JSCallbackConstructor.cpp:
1134         (KJS::JSCallbackConstructor::construct):
1135         * API/JSCallbackFunction.cpp:
1136         (KJS::JSCallbackFunction::callAsFunction):
1137         * API/JSCallbackObject.cpp:
1138         (KJS::JSCallbackObject::JSCallbackObject):
1139         (KJS::JSCallbackObject::getOwnPropertySlot):
1140         (KJS::JSCallbackObject::put):
1141         (KJS::JSCallbackObject::construct):
1142         (KJS::JSCallbackObject::callAsFunction):
1143         (KJS::JSCallbackObject::staticFunctionGetter):
1144         * API/JSCallbackObject.h:
1145         * API/JSContextRef.cpp:
1146         (JSEvaluate):
1147         * API/JSNode.c:
1148         (JSNodePrototype_appendChild):
1149         (JSNodePrototype_removeChild):
1150         (JSNodePrototype_replaceChild):
1151         * API/JSObjectRef.cpp:
1152         (JSObjectMake):
1153         (JSFunctionMakeWithBody):
1154         (JSObjectGetProperty):
1155         (JSObjectCallAsFunction):
1156         (JSObjectCallAsConstructor):
1157         * API/JSObjectRef.h:
1158         * API/testapi.c:
1159         (main):
1160         * ChangeLog:
1161         * kjs/object.h:
1162         (KJS::JSObject::JSObject):
1163
1164 2006-07-10  Geoffrey Garen  <ggaren@apple.com>
1165
1166         Approved by Maciej, Darin.
1167         
1168         Renamed JSStringBufferRef to JSInternalStringRef. "Internal string" means the 
1169         JavaScript engine's internal string representation, which is the most 
1170         low-level and efficient representation to use when interfacing with JavaScript.
1171
1172         * API/APICast.h:
1173         (toJS):
1174         (toRef):
1175         * API/JSBase.h:
1176         * API/JSCallbackObject.cpp:
1177         (KJS::JSCallbackObject::getOwnPropertySlot):
1178         (KJS::JSCallbackObject::put):
1179         (KJS::JSCallbackObject::deleteProperty):
1180         (KJS::JSCallbackObject::staticValueGetter):
1181         (KJS::JSCallbackObject::callbackGetter):
1182         * API/JSContextRef.cpp:
1183         (JSEvaluate):
1184         (JSCheckSyntax):
1185         * API/JSContextRef.h:
1186         * API/JSInternalStringRef.cpp: Added.
1187         (JSStringMake):
1188         (JSInternalStringCreate):
1189         (JSInternalStringCreateUTF8):
1190         (JSInternalStringRetain):
1191         (JSInternalStringRelease):
1192         (JSValueCopyStringValue):
1193         (JSInternalStringGetLength):
1194         (JSInternalStringGetCharactersPtr):
1195         (JSInternalStringGetCharacters):
1196         (JSInternalStringGetMaxLengthUTF8):
1197         (JSInternalStringGetCharactersUTF8):
1198         (JSInternalStringIsEqual):
1199         (JSInternalStringIsEqualUTF8):
1200         (JSInternalStringCreateCF):
1201         (CFStringCreateWithJSInternalString):
1202         * API/JSInternalStringRef.h: Added.
1203         * API/JSNode.c:
1204         (JSNodePrototype_appendChild):
1205         (JSNode_getNodeType):
1206         (JSNode_getChildNodes):
1207         (JSNode_getFirstChild):
1208         * API/JSNodeList.c:
1209         (JSNodeList_length):
1210         (JSNodeList_getProperty):
1211         * API/JSObjectRef.cpp:
1212         (JSFunctionMakeWithBody):
1213         (JSObjectGetDescription):
1214         (JSObjectHasProperty):
1215         (JSObjectGetProperty):
1216         (JSObjectSetProperty):
1217         (JSObjectDeleteProperty):
1218         (JSPropertyEnumeratorGetNext):
1219         (JSPropertyListAdd):
1220         * API/JSObjectRef.h:
1221         * API/JSStringBufferRef.cpp: Removed.
1222         * API/JSStringBufferRef.h: Removed.
1223         * API/JSValueRef.h:
1224         * API/JavaScriptCore.h:
1225         * API/minidom.c:
1226         (main):
1227         (print):
1228         * API/testapi.c:
1229         (assertEqualsAsUTF8String):
1230         (assertEqualsAsCharactersPtr):
1231         (assertEqualsAsCharacters):
1232         (MyObject_hasProperty):
1233         (MyObject_getProperty):
1234         (MyObject_setProperty):
1235         (MyObject_deleteProperty):
1236         (MyObject_getPropertyList):
1237         (print_callAsFunction):
1238         (myConstructor_callAsConstructor):
1239         (main):
1240         * JavaScriptCore.exp:
1241         * JavaScriptCore.xcodeproj/project.pbxproj:
1242
1243 2006-07-08  Tim Omernick  <timo@apple.com>
1244
1245         Reviewed by Maciej.
1246
1247         Added an OpenGL drawing model to the Netscape Plug-in API.
1248
1249         * bindings/npapi.h:
1250
1251 2006-07-08  Timothy Hatcher  <timothy@apple.com>
1252
1253         Reviewed by Maciej.
1254
1255         Moved KJS_GetCreatedJavaVMs to jni_utility.cpp.
1256         Switched KJS_GetCreatedJavaVMs over to use dlopen and dlsym
1257         now that NSAddImage, NSLookupSymbolInImage and NSAddressOfSymbol
1258         are deprecated in Leopard.
1259
1260         * JavaScriptCore.exp:
1261         * JavaScriptCore.xcodeproj/project.pbxproj:
1262         * bindings/jni/jni_utility.cpp:
1263         (KJS::Bindings::KJS_GetCreatedJavaVMs):
1264         * bindings/softlinking.c: Removed.
1265         * bindings/softlinking.h: Removed.
1266
1267 2006-07-08  Geoffrey Garen  <ggaren@apple.com>
1268
1269         Reviewed by Anders.
1270         
1271         - Make JSObjectGetProperty return a JSValue or NULL, like JSEvaluate does.
1272
1273         * API/JSObjectRef.cpp:
1274         (JSObjectGetProperty):
1275         * API/JSObjectRef.h:
1276         * API/testapi.c:
1277         (main):
1278
1279 2006-07-08  Geoffrey Garen  <ggaren@apple.com>
1280
1281         Style change -- no review necessary.
1282         
1283         Use 0 instead of NULL in API .cpp files, to match our style guidelines.
1284
1285         * API/JSContextRef.cpp:
1286         (JSEvaluate):
1287         * API/JSObjectRef.cpp:
1288         (JSFunctionMakeWithBody):
1289         (JSObjectCallAsFunction):
1290         (JSObjectCallAsConstructor):
1291         * API/JSValueRef.cpp:
1292         (JSValueToObject):
1293
1294 2006-07-08  Geoffrey Garen  <ggaren@apple.com>
1295
1296         Reviewed by TimO.
1297
1298         - Added ability to pass NULL for thisObject when calling JSObjectCallAsFunction,
1299         to match JSEvaluate.
1300         
1301         * API/JSObjectRef.cpp:
1302         (JSObjectCallAsFunction):
1303         * API/JSObjectRef.h:
1304         * API/testapi.c:
1305         (main):
1306
1307 === Safari-521.15 ===
1308
1309 2006-07-07  Geoffrey Garen  <ggaren@apple.com>
1310
1311         Reviewed by Maciej.
1312         
1313         - Standardized which functions take a JSContext as an argument. The rule is:
1314         if you might execute JavaScript, you take a JSContext, otherwise you don't.
1315         
1316         The FIXME in JSObjectRef.h requires refactoring some parts of Interpreter,
1317         but not API changes, so I'm putting it off until later.
1318
1319         * API/JSCallbackObject.cpp:
1320         (KJS::JSCallbackObject::JSCallbackObject):
1321         (KJS::JSCallbackObject::init):
1322         * API/JSCallbackObject.h:
1323         * API/JSContextRef.cpp:
1324         (JSContextCreate):
1325         * API/JSContextRef.h:
1326         * API/JSObjectRef.cpp:
1327         (JSObjectMake):
1328         (JSPropertyEnumeratorGetNext):
1329         * API/JSObjectRef.h:
1330         * API/testapi.c:
1331         (MyObject_initialize):
1332         (main):
1333         * JavaScriptCore.exp:
1334         * kjs/array_object.cpp:
1335         (ArrayInstance::setLength):
1336         (ArrayInstance::pushUndefinedObjectsToEnd):
1337         * kjs/nodes.cpp:
1338         (ForInNode::execute):
1339         * kjs/reference.cpp:
1340         (KJS::Reference::getPropertyName):
1341         (KJS::Reference::getValue):
1342         * kjs/reference.h:
1343         * kjs/scope_chain.cpp:
1344         (KJS::ScopeChain::print):
1345
1346 2006-07-06  Geoffrey Garen  <ggaren@apple.com>
1347
1348         Reviewed by Maciej.
1349         
1350         More API action.
1351         
1352         - Headerdoc finished
1353
1354         Semantic Changes:
1355         - Added a JSContextRef argument to many functions, because you need a 
1356         JSContextRef for doing virtually anything. I expect to add this argument
1357         to even more functions in a future patch.
1358         
1359         - Removed the globalObjectPrototype argument to JSContextCreate because
1360         you can't create an object until you have a context, so it's impossible
1361         to pass a prototype object to JSContextCreate. That's OK because (1) there's
1362         no reason to give the global object a prototype and (2) if you really want
1363         to, you can just use a separate call to JSObjectSetPrototype.
1364         
1365         - Removed the JSClassRef argument to JSClassCreate because it was unnecessary,
1366         and you need to be able to make the global object's class before you've
1367         created a JSContext.
1368         
1369         - Added an optional exception parameter to JSFunctionMakeWithBody because anything
1370         less would be uncivilized.
1371         
1372         - Made the return value parameter to JSObjectGetProperty optional to match
1373         all other return value parameters in the API.
1374         
1375         - Made JSObjectSetPrivate/JSObjectGetPrivate work on JSCallbackFunctions
1376         and JSCallbackConstructors. You could use an abstract base class or strategic
1377         placement of m_privateData in the class structure to implement this, but 
1378         the former seemed like overkill, and the latter seemed too dangerous.
1379         
1380         - Fixed a bug where JSPropertyEnumeratorGetNext would skip the first property.
1381
1382         Cosmetic Changes:
1383         - Reversed the logic of the JSChar #ifdef to avoid confusing headerdoc
1384         
1385         - Removed function names from @function declarations because headeroc
1386         can parse them automatically, and I wanted to rule out manual mismatch.
1387
1388         - Changed Error::create to take a const UString& instead of a UString*
1389         because it was looking at me funny.
1390         
1391         - Renamed JSStringBufferCreateWithCFString to JSStringBufferCreateCF
1392         because the latter is more concise and it matches JSStringBufferCreateUTF8.
1393         
1394         * API/JSCallbackObject.cpp:
1395         (KJS::JSCallbackObject::getOwnPropertySlot):
1396         (KJS::JSCallbackObject::put):
1397         (KJS::JSCallbackObject::deleteProperty):
1398         (KJS::JSCallbackObject::getPropertyList):
1399         (KJS::JSCallbackObject::toBoolean):
1400         (KJS::JSCallbackObject::toNumber):
1401         (KJS::JSCallbackObject::toString):
1402         * API/JSClassRef.cpp:
1403         (JSClassCreate):
1404         * API/JSContextRef.cpp:
1405         (JSContextCreate):
1406         (JSContextSetException):
1407         * API/JSContextRef.h:
1408         * API/JSNode.c:
1409         (JSNodePrototype_class):
1410         (JSNode_class):
1411         * API/JSNodeList.c:
1412         (JSNodeListPrototype_class):
1413         (JSNodeList_class):
1414         * API/JSObjectRef.cpp:
1415         (JSObjectGetProperty):
1416         (JSObjectGetPrivate):
1417         (JSObjectSetPrivate):
1418         (JSObjectCallAsFunction):
1419         (JSObjectCallAsConstructor):
1420         (JSPropertyEnumeratorGetNext):
1421         * API/JSObjectRef.h:
1422         * API/JSStringBufferRef.cpp:
1423         (JSStringBufferCreateCF):
1424         * API/JSStringBufferRef.h:
1425         * API/JSValueRef.cpp:
1426         (JSValueIsInstanceOf):
1427         * API/JSValueRef.h:
1428         * API/minidom.c:
1429         (main):
1430         * API/minidom.js:
1431         * API/testapi.c:
1432         (MyObject_hasProperty):
1433         (MyObject_setProperty):
1434         (MyObject_deleteProperty):
1435         (MyObject_getPropertyList):
1436         (MyObject_convertToType):
1437         (MyObject_class):
1438         (main):
1439         * JavaScriptCore.exp:
1440
1441 2006-07-07  Geoffrey Garen  <ggaren@apple.com>
1442
1443         Reviewed by John.
1444         
1445         - Fixed a few crashes resulting from NULL parameters to JSClassCreate.
1446
1447         * API/JSClassRef.cpp:
1448         (JSClassCreate):
1449         (JSClassRelease):
1450         * API/testapi.c: Added test for NULL parameters.
1451         (main):
1452
1453 2006-07-07  Geoffrey Garen  <ggaren@apple.com>
1454
1455         Reviewed by John, mocked by Darin.
1456         
1457         - Changed JSEvaluate to take a JSObjectRef instead of a JSValueRef as
1458         "this," since "this" must be an object.
1459
1460         * API/JSContextRef.cpp:
1461         (JSEvaluate):
1462         * API/JSContextRef.h:
1463
1464 2006-07-07  Geoffrey Garen  <ggaren@apple.com>
1465
1466         Reviewed by John.
1467         
1468         - More headerdoc
1469
1470         * API/JSBase.h:
1471         * JavaScriptCore.xcodeproj/project.pbxproj:
1472
1473 2006-07-05  Geoffrey Garen  <ggaren@apple.com>
1474
1475         RS by Beth.
1476         
1477         Renamed JSCharBufferRef, which was universally unpopular, to JSStringBufferRef,
1478         which, hopefully, will be less unpopular.
1479
1480         * API/APICast.h:
1481         (toJS):
1482         (toRef):
1483         * API/JSBase.h:
1484         * API/JSCallbackObject.cpp:
1485         (KJS::JSCallbackObject::getOwnPropertySlot):
1486         (KJS::JSCallbackObject::put):
1487         (KJS::JSCallbackObject::deleteProperty):
1488         (KJS::JSCallbackObject::staticValueGetter):
1489         (KJS::JSCallbackObject::callbackGetter):
1490         * API/JSCharBufferRef.cpp: Removed.
1491         * API/JSCharBufferRef.h: Removed.
1492         * API/JSContextRef.cpp:
1493         (JSEvaluate):
1494         (JSCheckSyntax):
1495         * API/JSContextRef.h:
1496         * API/JSNode.c:
1497         (JSNodePrototype_appendChild):
1498         (JSNode_getNodeType):
1499         (JSNode_getChildNodes):
1500         (JSNode_getFirstChild):
1501         * API/JSNodeList.c:
1502         (JSNodeList_length):
1503         (JSNodeList_getProperty):
1504         * API/JSObjectRef.cpp:
1505         (JSFunctionMakeWithBody):
1506         (JSObjectGetDescription):
1507         (JSObjectHasProperty):
1508         (JSObjectGetProperty):
1509         (JSObjectSetProperty):
1510         (JSObjectDeleteProperty):
1511         (JSPropertyEnumeratorGetNext):
1512         (JSPropertyListAdd):
1513         * API/JSObjectRef.h:
1514         * API/JSStringBufferRef.cpp: Added.
1515         (JSStringMake):
1516         (JSStringBufferCreate):
1517         (JSStringBufferCreateUTF8):
1518         (JSStringBufferRetain):
1519         (JSStringBufferRelease):
1520         (JSValueCopyStringValue):
1521         (JSStringBufferGetLength):
1522         (JSStringBufferGetCharactersPtr):
1523         (JSStringBufferGetCharacters):
1524         (JSStringBufferGetMaxLengthUTF8):
1525         (JSStringBufferGetCharactersUTF8):
1526         (JSStringBufferIsEqual):
1527         (JSStringBufferIsEqualUTF8):
1528         (JSStringBufferCreateWithCFString):
1529         (CFStringCreateWithJSStringBuffer):
1530         * API/JSStringBufferRef.h: Added.
1531         * API/JSValueRef.h:
1532         * API/JavaScriptCore.h:
1533         * API/minidom.c:
1534         (main):
1535         (print):
1536         * API/testapi.c:
1537         (assertEqualsAsUTF8String):
1538         (assertEqualsAsCharactersPtr):
1539         (assertEqualsAsCharacters):
1540         (MyObject_hasProperty):
1541         (MyObject_getProperty):
1542         (MyObject_setProperty):
1543         (MyObject_deleteProperty):
1544         (MyObject_getPropertyList):
1545         (print_callAsFunction):
1546         (myConstructor_callAsConstructor):
1547         (main):
1548         * JavaScriptCore.exp:
1549         * JavaScriptCore.xcodeproj/project.pbxproj:
1550
1551 2006-07-05  Geoffrey Garen  <ggaren@apple.com>
1552
1553         RS by Beth.
1554         
1555         Moved some code around for more logical file separation.
1556
1557         * API/JSBase.h:
1558         * API/JSContextRef.h:
1559         * API/JSObjectRef.cpp:
1560         * API/JSValueRef.cpp:
1561         (JSValueToObject):
1562         * API/JSValueRef.h:
1563
1564 2006-07-03  Geoffrey Garen  <ggaren@apple.com>
1565
1566         Reviewed by Maciej.
1567         
1568         Implemented JSFunctionMakeWithBody, which parses a script as a function body
1569         in the global scope, and returns the resulting anonymous function.
1570         
1571         I also removed private data from JSCallbackFunction. It never worked,
1572         since JSCallbackFunction doesn't inherit from JSCallbackObject.
1573
1574         * API/JSCallbackConstructor.cpp: Removed.
1575         * API/JSCallbackConstructor.h: Removed.
1576         * API/JSCallbackFunction.cpp:
1577         (KJS::JSCallbackFunction::JSCallbackFunction):
1578         (KJS::JSCallbackFunction::implementsConstruct):
1579         (KJS::JSCallbackFunction::construct):
1580         (KJS::JSCallbackFunction::implementsCall):
1581         (KJS::JSCallbackFunction::callAsFunction):
1582         * API/JSCallbackFunction.h:
1583         * API/JSCallbackObject.cpp:
1584         (KJS::JSCallbackObject::staticFunctionGetter):
1585         * API/JSObjectRef.cpp:
1586         (JSFunctionMake):
1587         (JSFunctionMakeWithCallbacks):
1588         * API/JSObjectRef.h:
1589         * API/JSValueRef.h:
1590         * API/minidom.c:
1591         (main):
1592         * API/testapi.c:
1593         (main):
1594         * JavaScriptCore.exp: Programmatically added all symbols exported by
1595         API object files, and sorted results
1596         * JavaScriptCore.xcodeproj/project.pbxproj:
1597
1598 2006-07-03  Geoffrey Garen  <ggaren@apple.com>
1599
1600         Reviewed by Maciej.
1601
1602         - Return syntax error in JSCheckSyntax through a JSValueRef* exception
1603         argument
1604         
1605         * API/JSBase.h:
1606         * API/JSContextRef.cpp:
1607         (JSCheckSyntax):
1608         * API/testapi.c:
1609         (main):
1610         * JavaScriptCore.exp:
1611         * kjs/interpreter.cpp:
1612         (KJS::Interpreter::checkSyntax):
1613         * kjs/interpreter.h:
1614
1615 2006-07-04  Darin Adler  <darin@apple.com>
1616
1617         - fixed build
1618
1619         * wtf/MathExtras.h: Oops. Added missing #endif.
1620
1621 2006-07-04  Bjoern Graf  <bjoern.graf@gmail.com>
1622
1623         Reviewed by Maciej.
1624         Tweaked a bit by Darin.
1625
1626         - http://bugzilla.opendarwin.org/show_bug.cgi?id=9678
1627           work around MSVCRT's fmod function returning NaN for fmod(x, infinity) instead of x
1628
1629         * wtf/MathExtras.h: Added include of <float.h>.
1630         (isinf): Fix to return false for NAN.
1631         (wtf_fmod): Added. An inline that works around the bug.
1632
1633         * kjs/nodes.cpp:
1634         * kjs/number_object.cpp:
1635         * kjs/operations.cpp:
1636         * kjs/value.cpp:
1637         Added includes of MathExtras.h to all files using fmod.
1638
1639         * JavaScriptCore.xcodeproj/project.pbxproj: Let Xcode 2.3 have its way with
1640         the project.
1641
1642 2006-07-01  Geoffrey Garen  <ggaren@apple.com>
1643
1644         Reviewed by Darin.
1645         
1646         - Refined value conversions in the API:
1647             - failed toNumber returns NaN
1648             - failed toObject returns NULL
1649             - failed toString returns empty string
1650         
1651         - Refined excpetion handling in the API:
1652             - failed value conversions do not throw exceptions
1653             - uncaught exceptions in JSEvaluate, JSObjectCallAsFunction, and 
1654               JSObjectCallAsConstructor are returned through a JSValueRef* exception
1655               argument
1656             - removed JSContextHasException, because JSContextGetException does
1657               the same job
1658             
1659         * API/JSBase.h:
1660         * API/JSCharBufferRef.cpp:
1661         (JSValueCopyStringValue):
1662         * API/JSContextRef.cpp:
1663         (JSEvaluate):
1664         * API/JSContextRef.h:
1665         * API/JSNodeList.c: Added test code demonstrating how you would use
1666         toNumber, and why you probably don't need toUInt32, etc.
1667         (JSNodeListPrototype_item):
1668         (JSNodeList_getProperty):
1669         * API/JSObjectRef.cpp:
1670         (JSValueToObject):
1671         (JSObjectCallAsFunction):
1672         (JSObjectCallAsConstructor):
1673         * API/JSObjectRef.h:
1674         * API/JSValueRef.cpp:
1675         (JSValueToNumber):
1676         * API/JSValueRef.h:
1677         * API/minidom.c:
1678         (main):
1679         * API/testapi.c:
1680         (main): Added tests for new rules, and call to JSGCProtect to fix Intel 
1681         crash
1682         * JavaScriptCore.exp:
1683
1684 2006-07-03  Darin Adler  <darin@apple.com>
1685
1686         - Rolled out HashMap implementation of NPRuntime, at least temporarily.
1687
1688         Fixes hang in the bindings section of layout tests seen on the
1689         buildbot.
1690
1691         This code was using HashMap<const char*, PrivateIdentifier*>.
1692         But that hashes based on pointer identity, not string value.
1693         The default hash for any pointer type is to hash based on the pointer.
1694         And WTF doesn't currently have a string hash for char*.
1695         We'll need to fix that before re-landing this patch.
1696
1697         (Formatting was also incorrect -- extra spaces in parentheses.)
1698
1699         * bindings/npruntime.cpp: Rolled out last change.
1700
1701 2006-07-02  Justin Haygood  <jhaygood@spsu.edu>
1702
1703         Reviewed, tweaked, landed by ggaren.
1704
1705         - Port NPRuntime from CFDictionary to HashMap.
1706
1707         * bindings/npruntime.cpp:
1708         (getStringIdentifierDictionary):
1709         (getIntIdentifierDictionary):
1710         (_NPN_GetStringIdentifier):
1711         (_NPN_GetIntIdentifier):
1712         * bindings/npruntime.h:
1713
1714 2006-07-01  Geoffrey Garen  <ggaren@apple.com>
1715
1716         Reviewed by Adele.
1717         
1718         - Fixed <rdar://problem/4611197> REGRESSION: Liveconnect with Java test 
1719         fails at http://www-sor.inria.fr/~dedieu/notes/liveconnect/simple_example.html
1720
1721         * JavaScriptCore.exp: Export symbols used by liveconnect
1722
1723 2006-06-29  Geoffrey Garen  <ggaren@apple.com>
1724
1725         Reviewed by Maciej.
1726         
1727         - Phase 2 in the JS API.
1728         
1729         - Added support for specifying static tables of values -- this should
1730         obviate the need for using complicated callbacks for most lookups.
1731         
1732         -  API objects are now created with classes (JSClassRef) -- in order to support
1733         static values, and in order to prevent API objects from storing their
1734         data inline, and thus falling into the oversized (read: slow and prone to
1735         giving Maciej the frowny face) heap.
1736         
1737         - Added two specialized JSObject subclasses -- JSCallbackFunction and JSCallbackConstructor -- 
1738         to allow JSFunctionMake and JSConstructorMake to continue to work with
1739         the new class model. Another solution to this problem would be to create
1740         a custom class object for each function and constructor you make. This
1741         solution is more code but also more efficient.
1742         
1743         - Substantially beefed up the minidom example to demonstrate and test a
1744         lot of these techniques. Its output is still pretty haphazard, though.
1745         
1746         - Gave the <kjs/ preface to some includes -- I'm told this matters to
1747         building on some versions of Linux.
1748         
1749         - Implemented JSValueIsInstanceOf and JSValueIsObjectOfClass
1750         
1751         - Removed GetDescription callback. Something in the class datastructure
1752         should take care of this.
1753
1754         * API/JSBase.h:
1755         * API/JSCallbackConstructor.cpp: Added.
1756         (KJS::):
1757         (KJS::JSCallbackConstructor::JSCallbackConstructor):
1758         (KJS::JSCallbackConstructor::implementsConstruct):
1759         (KJS::JSCallbackConstructor::construct):
1760         (KJS::JSCallbackConstructor::setPrivate):
1761         (KJS::JSCallbackConstructor::getPrivate):
1762         * API/JSCallbackConstructor.h: Added.
1763         (KJS::JSCallbackConstructor::classInfo):
1764         * API/JSCallbackFunction.cpp: Added.
1765         (KJS::):
1766         (KJS::JSCallbackFunction::JSCallbackFunction):
1767         (KJS::JSCallbackFunction::implementsCall):
1768         (KJS::JSCallbackFunction::callAsFunction):
1769         (KJS::JSCallbackFunction::setPrivate):
1770         (KJS::JSCallbackFunction::getPrivate):
1771         * API/JSCallbackFunction.h: Added.
1772         (KJS::JSCallbackFunction::classInfo):
1773         * API/JSCallbackObject.cpp:
1774         (KJS::):
1775         (KJS::JSCallbackObject::JSCallbackObject):
1776         (KJS::JSCallbackObject::init):
1777         (KJS::JSCallbackObject::~JSCallbackObject):
1778         (KJS::JSCallbackObject::className):
1779         (KJS::JSCallbackObject::getOwnPropertySlot):
1780         (KJS::JSCallbackObject::put):
1781         (KJS::JSCallbackObject::deleteProperty):
1782         (KJS::JSCallbackObject::implementsConstruct):
1783         (KJS::JSCallbackObject::construct):
1784         (KJS::JSCallbackObject::implementsCall):
1785         (KJS::JSCallbackObject::callAsFunction):
1786         (KJS::JSCallbackObject::getPropertyList):
1787         (KJS::JSCallbackObject::toBoolean):
1788         (KJS::JSCallbackObject::toNumber):
1789         (KJS::JSCallbackObject::toString):
1790         (KJS::JSCallbackObject::inherits):
1791         (KJS::JSCallbackObject::staticValueGetter):
1792         (KJS::JSCallbackObject::staticFunctionGetter):
1793         (KJS::JSCallbackObject::callbackGetter):
1794         * API/JSCallbackObject.h:
1795         * API/JSCharBufferRef.cpp:
1796         * API/JSClassRef.cpp: Added.
1797         (JSClassCreate):
1798         (JSClassRetain):
1799         (JSClassRelease):
1800         * API/JSClassRef.h: Added.
1801         (StaticValueEntry::StaticValueEntry):
1802         (StaticFunctionEntry::StaticFunctionEntry):
1803         (__JSClass::__JSClass):
1804         * API/JSContextRef.cpp:
1805         (JSContextCreate):
1806         (JSEvaluate):
1807         * API/JSContextRef.h:
1808         * API/JSNode.c: Added.
1809         (JSNodePrototype_appendChild):
1810         (JSNodePrototype_removeChild):
1811         (JSNodePrototype_replaceChild):
1812         (JSNodePrototype_class):
1813         (JSNode_getNodeType):
1814         (JSNode_getChildNodes):
1815         (JSNode_getFirstChild):
1816         (JSNode_finalize):
1817         (JSNode_class):
1818         (JSNode_prototype):
1819         (JSNode_new):
1820         (JSNode_construct):
1821         * API/JSNode.h: Added.
1822         * API/JSNodeList.c: Added.
1823         (JSNodeListPrototype_item):
1824         (JSNodeListPrototype_class):
1825         (JSNodeList_length):
1826         (JSNodeList_getProperty):
1827         (JSNodeList_finalize):
1828         (JSNodeList_class):
1829         (JSNodeList_prototype):
1830         (JSNodeList_new):
1831         * API/JSNodeList.h: Added.
1832         * API/JSObjectRef.cpp:
1833         (JSObjectMake):
1834         (JSFunctionMake):
1835         (JSConstructorMake):
1836         (__JSPropertyEnumerator::__JSPropertyEnumerator):
1837         (JSObjectCreatePropertyEnumerator):
1838         (JSPropertyEnumeratorGetNext):
1839         (JSPropertyEnumeratorRetain):
1840         (JSPropertyEnumeratorRelease):
1841         * API/JSObjectRef.h:
1842         (__JSObjectCallbacks::):
1843         * API/JSValueRef.cpp:
1844         (JSValueIsObjectOfClass):
1845         (JSValueIsInstanceOf):
1846         * API/JSValueRef.h:
1847         * API/Node.c: Added.
1848         (Node_new):
1849         (Node_appendChild):
1850         (Node_removeChild):
1851         (Node_replaceChild):
1852         (Node_ref):
1853         (Node_deref):
1854         * API/Node.h: Added.
1855         * API/NodeList.c: Added.
1856         (NodeList_new):
1857         (NodeList_length):
1858         (NodeList_item):
1859         (NodeList_ref):
1860         (NodeList_deref):
1861         * API/NodeList.h: Added.
1862         * API/minidom.c:
1863         (main):
1864         (print):
1865         (createStringWithContentsOfFile):
1866         * API/minidom.js:
1867         * API/testapi.c:
1868         (assertEqualsAsCharacters):
1869         (MyObject_getProperty):
1870         (MyObject_class):
1871         (myConstructor_callAsConstructor):
1872         (main):
1873         * API/testapi.js:
1874         * JavaScriptCore.xcodeproj/project.pbxproj:
1875
1876 2006-06-26  Kevin Ollivier  <kevino@theolliviers.com>
1877         
1878         Reviewed and tweaked by Darin.
1879
1880         - Compile fixes for wx port / gcc 4.0.2
1881
1882         * kjs/array_object.cpp:
1883         Added missing headers. 
1884
1885         * kjs/ExecState.h:
1886         gcc needs class prototypes before defining those classes as friend classes
1887
1888 2006-06-30  Mike Emmel  <mike.emmel@gmail.com>
1889
1890         Reviewed by Darin.
1891
1892         Compilation fixes for Linux/Gdk.
1893
1894         * JavaScriptCore/kjs/interpreter.cpp: added include of signal.h
1895         * JavaScriptCore/kjs/ExecState.h: added missing class declaration 
1896         * JavaScriptCore/kjs/ExecState.cpp: case wrong on include of context.h 
1897         * JavaScriptCore/JavaScriptCoreSources.bkl: added Context.cpp and ExecState.cpp
1898
1899 === Safari-521.14 ===
1900
1901 2006-06-29  Maciej Stachowiak  <mjs@apple.com>
1902
1903         Reviewed by Geoff.
1904         
1905         - add headerdoc comments to some of the new JS API headers
1906
1907         * API/JSBase.h:
1908         * API/JSValueRef.h:
1909
1910 2006-06-28  Timothy Hatcher  <timothy@apple.com>
1911
1912         Prefer the Stabs debugging symbols format until DWARF bugs are fixed.
1913
1914         * JavaScriptCore.xcodeproj/project.pbxproj:
1915
1916 2006-06-27  Timothy Hatcher  <timothy@apple.com>
1917
1918         Reviewed by Tim O.
1919
1920         <rdar://problem/4448350> Deprecated ObjC language API used in JavaScriptCore, WebCore, WebKit and WebBrowser
1921
1922         Switch to the new ObjC 2 API, ifdefed the old code around OBJC_API_VERSION so it still works on Tiger.
1923         Removed the use of the old stringWithCString, switched to the new Tiger version that accepts an encoding.
1924         Lots of code style cleanup.
1925
1926         * JavaScriptCore.xcodeproj/project.pbxproj:
1927         * bindings/objc/objc_class.h:
1928         * bindings/objc/objc_class.mm:
1929         (KJS::Bindings::ObjcClass::~ObjcClass):
1930         (KJS::Bindings::_createClassesByIsAIfNecessary):
1931         (KJS::Bindings::ObjcClass::classForIsA):
1932         (KJS::Bindings::ObjcClass::name):
1933         (KJS::Bindings::ObjcClass::methodsNamed):
1934         (KJS::Bindings::ObjcClass::fieldNamed):
1935         (KJS::Bindings::ObjcClass::fallbackObject):
1936         * bindings/objc/objc_header.h:
1937         * bindings/objc/objc_instance.h:
1938         * bindings/objc/objc_instance.mm:
1939         (ObjcInstance::ObjcInstance):
1940         (ObjcInstance::~ObjcInstance):
1941         (ObjcInstance::operator=):
1942         (ObjcInstance::begin):
1943         (ObjcInstance::end):
1944         (ObjcInstance::getClass):
1945         (ObjcInstance::invokeMethod):
1946         (ObjcInstance::invokeDefaultMethod):
1947         (ObjcInstance::setValueOfField):
1948         (ObjcInstance::supportsSetValueOfUndefinedField):
1949         (ObjcInstance::setValueOfUndefinedField):
1950         (ObjcInstance::getValueOfField):
1951         (ObjcInstance::getValueOfUndefinedField):
1952         (ObjcInstance::defaultValue):
1953         (ObjcInstance::stringValue):
1954         (ObjcInstance::numberValue):
1955         (ObjcInstance::booleanValue):
1956         (ObjcInstance::valueOf):
1957         * bindings/objc/objc_runtime.h:
1958         * bindings/objc/objc_runtime.mm:
1959         (ObjcMethod::ObjcMethod):
1960         (ObjcMethod::name):
1961         (ObjcMethod::getMethodSignature):
1962         (ObjcMethod::setJavaScriptName):
1963         (ObjcField::name):
1964         (ObjcField::type):
1965         (ObjcField::valueFromInstance):
1966         (convertValueToObjcObject):
1967         (ObjcField::setValueToInstance):
1968         (ObjcArray::operator=):
1969         (ObjcArray::setValueAt):
1970         (ObjcArray::valueAt):
1971         (ObjcFallbackObjectImp::ObjcFallbackObjectImp):
1972         (ObjcFallbackObjectImp::callAsFunction):
1973         (ObjcFallbackObjectImp::defaultValue):
1974
1975 2006-06-28  Anders Carlsson  <acarlsson@apple.com>
1976
1977         Reviewed by Geoff.
1978
1979         http://bugzilla.opendarwin.org/show_bug.cgi?id=8636
1980         REGRESSION: JavaScript access to Java applet causes hang (_webViewURL not implemented)
1981
1982         * bindings/jni/jni_objc.mm:
1983         (KJS::Bindings::dispatchJNICall):
1984         Just pass nil as the calling URL. This will cause the Java plugin to use the URL of the page
1985         containing the applet (which is what we used to do).
1986
1987 2006-06-27  Timothy Hatcher  <timothy@apple.com>
1988
1989         Reviewed by Darin.
1990
1991         <rdar://problem/4406785> Add an export file to TOT JavaScriptCore like the Safari-2-0-branch
1992
1993         * JavaScriptCore.exp: Added.
1994         * JavaScriptCore.xcodeproj/project.pbxproj:
1995
1996 2006-06-25  Geoffrey Garen  <ggaren@apple.com>
1997
1998         Reviewed by Adele.
1999         
2000         - Added JSConstructorMake to match JSFunctionMake, along with test code.
2001         
2002         [ I checked in the ChangeLog before without the actual files. ]
2003
2004         * API/JSObjectRef.cpp:
2005         (JSConstructorMake):
2006         * API/JSObjectRef.h:
2007         * API/testapi.c:
2008         (myConstructor_callAsConstructor):
2009         (main):
2010         * API/testapi.js:
2011         * ChangeLog:
2012         * JavaScriptCore.xcodeproj/project.pbxproj: Moved testapi.c to the testapi
2013         target -- this was an oversight in my earlier check-in.
2014
2015 2006-06-25  Timothy Hatcher  <timothy@apple.com>
2016
2017         Reviewed by Darin.
2018
2019         Bug 9574: Drosera should show inline scripts within the original HTML
2020         http://bugzilla.opendarwin.org/show_bug.cgi?id=9574
2021
2022         Pass the starting line number and error message to the debugger.
2023
2024         * kjs/debugger.cpp:
2025         (Debugger::sourceParsed):
2026         * kjs/debugger.h:
2027         * kjs/function.cpp:
2028         (KJS::GlobalFuncImp::callAsFunction):
2029         * kjs/function_object.cpp:
2030         (FunctionObjectImp::construct):
2031         * kjs/interpreter.cpp:
2032         (KJS::Interpreter::evaluate):
2033
2034 2006-06-24  Alexey Proskuryakov  <ap@nypop.com>
2035
2036         Rubber-stamped by Eric.
2037
2038         Add a -h (do not follow symlinks) option to ln in derived sources build script (without it,
2039         a symlink was created inside the source directory on second build).
2040
2041         * JavaScriptCore.xcodeproj/project.pbxproj:
2042
2043 2006-06-24  David Kilzer  <ddkilzer@kilzer.net>
2044
2045         Reviewed by Timothy.
2046
2047         * Info.plist: Fixed copyright to include 2003-2006.
2048
2049 2006-06-24  Alexey Proskuryakov  <ap@nypop.com>
2050
2051         Reviewed by Darin.
2052
2053         - http://bugzilla.opendarwin.org/show_bug.cgi?id=9418
2054         WebKit will not build when Space exists in path
2055
2056         * JavaScriptCore.xcodeproj/project.pbxproj: Enclose search paths in quotes; create symlinks to 
2057         avoid passing paths with spaces to make.
2058
2059 2006-06-23  Timothy Hatcher  <timothy@apple.com>
2060
2061         Reviewed by Darin.
2062
2063         Adding more operator[] overloads for long and short types.
2064
2065         * wtf/Vector.h:
2066         (WTF::Vector::operator[]):
2067
2068 === JavaScriptCore-521.13 ===
2069
2070 2006-06-22  Alexey Proskuryakov  <ap@nypop.com>
2071
2072         Build fix.
2073
2074         - http://bugzilla.opendarwin.org/show_bug.cgi?id=9539
2075         Another case error preventing build
2076
2077         * API/JSObjectRef.cpp: Changed "identifier.h" to "Identifier.h"
2078         
2079 2006-06-22  David Kilzer  <ddkilzer@kilzer.net>
2080
2081         Build fix.
2082
2083         http://bugzilla.opendarwin.org/show_bug.cgi?id=9539
2084         Another case error preventing build
2085
2086         * API/APICast.h: Changed "UString.h" to "ustring.h".
2087
2088 2006-06-21  Geoffrey Garen  <ggaren@apple.com>
2089
2090         Fixed release build, fixed accidental infinite recursion due to
2091         last minute global replace gone awry.
2092         
2093         * API/APICast.h:
2094         (toRef):
2095         * API/testapi.c:
2096         (assertEqualsAsBoolean):
2097         (assertEqualsAsNumber):
2098         (assertEqualsAsUTF8String):
2099         (assertEqualsAsCharactersPtr):
2100         * JavaScriptCore.xcodeproj/project.pbxproj:
2101
2102 2006-06-21  Geoffrey Garen  <ggaren@apple.com>
2103
2104         Reviewed by Anders.
2105         
2106         - First cut at C API to JavaScript. Includes a unit test, 'testapi.c', 
2107         and the outline of a test app, 'minidom.c'.
2108         
2109         Includes one change to JSC internals: Rename propList to getPropertyList and have it
2110         take its target property list by reference so that subclasses can
2111         add properties to the list before calling through to their superclasses.
2112         
2113         Also, I just ran prepare-ChangeLog in about 10 seconds, and I would like
2114         to give a shout-out to that.
2115         
2116         * API/APICast.h: Added.
2117         (toJS):
2118         (toRef):
2119         * API/JSBase.h: Added.
2120         * API/JSCallbackObject.cpp: Added.
2121         (KJS::):
2122         (KJS::JSCallbackObject::JSCallbackObject):
2123         (KJS::JSCallbackObject::~JSCallbackObject):
2124         (KJS::JSCallbackObject::className):
2125         (KJS::JSCallbackObject::getOwnPropertySlot):
2126         (KJS::JSCallbackObject::put):
2127         (KJS::JSCallbackObject::deleteProperty):
2128         (KJS::JSCallbackObject::implementsConstruct):
2129         (KJS::JSCallbackObject::construct):
2130         (KJS::JSCallbackObject::implementsCall):
2131         (KJS::JSCallbackObject::callAsFunction):
2132         (KJS::JSCallbackObject::getPropertyList):
2133         (KJS::JSCallbackObject::toBoolean):
2134         (KJS::JSCallbackObject::toNumber):
2135         (KJS::JSCallbackObject::toString):
2136         (KJS::JSCallbackObject::setPrivate):
2137         (KJS::JSCallbackObject::getPrivate):
2138         (KJS::JSCallbackObject::cachedValueGetter):
2139         (KJS::JSCallbackObject::callbackGetter):
2140         * API/JSCallbackObject.h: Added.
2141         (KJS::JSCallbackObject::classInfo):
2142         * API/JSCharBufferRef.cpp: Added.
2143         (JSStringMake):
2144         (JSCharBufferCreate):
2145         (JSCharBufferCreateUTF8):
2146         (JSCharBufferRetain):
2147         (JSCharBufferRelease):
2148         (JSValueCopyStringValue):
2149         (JSCharBufferGetLength):
2150         (JSCharBufferGetCharactersPtr):
2151         (JSCharBufferGetCharacters):
2152         (JSCharBufferGetMaxLengthUTF8):
2153         (JSCharBufferGetCharactersUTF8):
2154         (JSCharBufferIsEqual):
2155         (JSCharBufferIsEqualUTF8):
2156         (JSCharBufferCreateWithCFString):
2157         (CFStringCreateWithJSCharBuffer):
2158         * API/JSCharBufferRef.h: Added.
2159         * API/JSContextRef.cpp: Added.
2160         (JSContextCreate):
2161         (JSContextDestroy):
2162         (JSContextGetGlobalObject):
2163         (JSEvaluate):
2164         (JSCheckSyntax):
2165         (JSContextHasException):
2166         (JSContextGetException):
2167         (JSContextClearException):
2168         (JSContextSetException):
2169         * API/JSContextRef.h: Added.
2170         * API/JSObjectRef.cpp: Added.
2171         (JSValueToObject):
2172         (JSObjectMake):
2173         (JSFunctionMake):
2174         (JSObjectGetDescription):
2175         (JSObjectGetPrototype):
2176         (JSObjectSetPrototype):
2177         (JSObjectHasProperty):
2178         (JSObjectGetProperty):
2179         (JSObjectSetProperty):
2180         (JSObjectDeleteProperty):
2181         (JSObjectGetPrivate):
2182         (JSObjectSetPrivate):
2183         (JSObjectIsFunction):
2184         (JSObjectCallAsFunction):
2185         (JSObjectIsConstructor):
2186         (JSObjectCallAsConstructor):
2187         (__JSPropertyListEnumerator::__JSPropertyListEnumerator):
2188         (JSObjectCreatePropertyEnumerator):
2189         (JSPropertyEnumeratorGetNext):
2190         (JSPropertyEnumeratorRetain):
2191         (JSPropertyEnumeratorRelease):
2192         (JSPropertyListAdd):
2193         * API/JSObjectRef.h: Added.
2194         * API/JSValueRef.cpp: Added.
2195         (JSValueGetType):
2196         (JSValueIsUndefined):
2197         (JSValueIsNull):
2198         (JSValueIsBoolean):
2199         (JSValueIsNumber):
2200         (JSValueIsString):
2201         (JSValueIsObject):
2202         (JSValueIsEqual):
2203         (JSValueIsStrictEqual):
2204         (JSUndefinedMake):
2205         (JSNullMake):
2206         (JSBooleanMake):
2207         (JSNumberMake):
2208         (JSValueToBoolean):
2209         (JSValueToNumber):
2210         (JSGCProtect):
2211         (JSGCUnprotect):
2212         (JSGCCollect):
2213         * API/JSValueRef.h: Added.
2214         * API/JavaScriptCore.h: Added.
2215         * API/minidom.c: Added.
2216         (main):
2217         * API/minidom.html: Added.
2218         * API/minidom.js: Added.
2219         * API/testapi.c: Added.
2220         (assertEqualsAsBoolean):
2221         (assertEqualsAsNumber):
2222         (assertEqualsAsUTF8String):
2223         (assertEqualsAsCharactersPtr):
2224         (assertEqualsAsCharacters):
2225         (MyObject_initialize):
2226         (MyObject_copyDescription):
2227         (MyObject_hasProperty):
2228         (MyObject_getProperty):
2229         (MyObject_setProperty):
2230         (MyObject_deleteProperty):
2231         (MyObject_getPropertyList):
2232         (MyObject_callAsFunction):
2233         (MyObject_callAsConstructor):
2234         (MyObject_convertToType):
2235         (MyObject_finalize):
2236         (print_callAsFunction):
2237         (main):
2238         (createStringWithContentsOfFile):
2239         * API/testapi.js: Added.
2240         * ChangeLog:
2241         * JavaScriptCore.xcodeproj/project.pbxproj:
2242         * bindings/npruntime_impl.h:
2243         * kjs/array_instance.h:
2244         * kjs/array_object.cpp:
2245         (ArrayInstance::getPropertyList):
2246         * kjs/interpreter.cpp:
2247         (KJS::Interpreter::evaluate):
2248         * kjs/nodes.cpp:
2249         (ForInNode::execute):
2250         * kjs/object.cpp:
2251         (KJS::JSObject::put):
2252         (KJS::JSObject::canPut):
2253         (KJS::JSObject::deleteProperty):
2254         (KJS::JSObject::propertyIsEnumerable):
2255         (KJS::JSObject::getPropertyAttributes):
2256         (KJS::JSObject::getPropertyList):
2257         * kjs/object.h:
2258         * kjs/property_map.cpp:
2259         (KJS::PropertyMap::get):
2260         * kjs/property_map.h:
2261         * kjs/scope_chain.cpp:
2262         (KJS::ScopeChain::print):
2263         * kjs/string_object.cpp:
2264         (StringInstance::getPropertyList):
2265         * kjs/string_object.h:
2266         * kjs/ustring.h:
2267         (KJS::UString::Rep::ref):
2268
2269 2006-06-20  Timothy Hatcher  <timothy@apple.com>
2270
2271         Reviewed by Geoff.
2272
2273         Make sure we clear the exception before returning so
2274         that future calls will not fail because of an earlier
2275         exception state. Assert on entry that the WebScriptObject
2276         is working with an ExecState that dose not have an exception. 
2277         Document that evaluateWebScript and callWebScriptMethod return
2278         WebUndefined when an exception is thrown.
2279
2280         * bindings/objc/WebScriptObject.h:
2281         * bindings/objc/WebScriptObject.mm:
2282         (-[WebScriptObject callWebScriptMethod:withArguments:]):
2283         (-[WebScriptObject evaluateWebScript:]):
2284         (-[WebScriptObject setValue:forKey:]):
2285         (-[WebScriptObject valueForKey:]):
2286         (-[WebScriptObject removeWebScriptKey:]):
2287         (-[WebScriptObject webScriptValueAtIndex:]):
2288         (-[WebScriptObject setWebScriptValueAtIndex:value:]):
2289
2290 2006-06-19  Anders Carlsson  <acarlsson@apple.com>
2291
2292         Reviewed by John.
2293
2294         * kjs/interpreter.cpp:
2295         (KJS::TimeoutChecker::pauseTimeoutCheck):
2296         (KJS::TimeoutChecker::resumeTimeoutCheck):
2297         Fix argument order in setitimer calls.
2298
2299 2006-06-18  Anders Carlsson  <acarlsson@apple.com>
2300
2301         Reviewed by Geoff.
2302
2303         * kjs/interpreter.cpp:
2304         (KJS::TimeoutChecker::pauseTimeoutCheck):
2305         Do nothing if the timeout check hasn't been started.
2306         
2307         (KJS::TimeoutChecker::resumeTimeoutCheck):
2308         Do nothing if the timeout check hasn't been started.
2309         Use the right signal handler when unblocking.
2310         
2311         (KJS::Interpreter::handleTimeout):
2312         pause/resume the timeout check around the call to
2313         shouldInterruptScript().
2314         
2315 2006-06-16  Ben Goodger <beng@google.com>
2316         
2317         Reviewed by Maciej
2318
2319         http://bugzilla.opendarwin.org/show_bug.cgi?id=9491
2320         Windows build breaks in interpreter.cpp 
2321
2322         * kjs/interpreter.cpp
2323         (KJS::TimeoutChecker::pauseTimeoutCheck):
2324         (KJS::TimeoutChecker::resumeTimeoutCheck):
2325         Make sure to only assert equality with s_executingInterpreter when it 
2326         is being used (i.e. when HAVE(SYS_TIME_H) == true)
2327
2328 2006-06-17  David Kilzer  <ddkilzer@kilzer.net>
2329
2330         Reviewed by darin.
2331
2332         http://bugzilla.opendarwin.org/show_bug.cgi?id=9477
2333         REGRESSION: fast/dom/replaceChild.html crashes on WebKit ToT in debug build
2334
2335         * kjs/function.cpp:
2336         (KJS::FunctionImp::callAsFunction): Refetch the debugger after executing the function
2337         in case the WebFrame it was running in has since been destroyed.
2338
2339 2006-06-17  David Kilzer  <ddkilzer@kilzer.net>
2340
2341         Reviewed by ggaren.
2342
2343         http://bugzilla.opendarwin.org/show_bug.cgi?id=9476
2344         REGRESSION: Reproducible crash after closing window after viewing
2345         css2.1/t0803-c5501-imrgn-t-00-b-ag.html
2346
2347         * kjs/debugger.cpp:
2348         (Debugger::detach): Call setDebugger(0) for all interpreters removed from
2349         the 'attached to a debugger' list.
2350
2351 2006-06-17  Anders Carlsson  <acarlsson@apple.com>
2352
2353         Reviewed by Maciej and Geoff.
2354
2355         http://bugzilla.opendarwin.org/show_bug.cgi?id=7080
2356         Provide some way to stop a JavaScript infinite loop
2357         
2358         * kjs/completion.h:
2359         (KJS::):
2360         Add Interrupted completion type.
2361         
2362         * kjs/function.cpp:
2363         (KJS::FunctionImp::callAsFunction):
2364         (KJS::GlobalFuncImp::callAsFunction):
2365         Only set the exception on the new ExecState if the current one has had one.
2366         
2367         * kjs/interpreter.cpp:
2368         (KJS::TimeoutChecker::startTimeoutCheck):
2369         (KJS::TimeoutChecker::stopTimeoutCheck):
2370         (KJS::TimeoutChecker::alarmHandler):
2371         (KJS::TimeoutChecker::pauseTimeoutCheck):
2372         (KJS::TimeoutChecker::resumeTimeoutCheck):
2373         New TimeoutChecker class which handles setting Interpreter::m_timedOut flag after a given
2374         period of time. This currently only works on Unix platforms where setitimer and signals are used.
2375         
2376         (KJS::Interpreter::Interpreter):
2377         Initialize new member variables.
2378         
2379         (KJS::Interpreter::~Interpreter):
2380         Destroy the timeout checker.
2381         
2382         (KJS::Interpreter::startTimeoutCheck):
2383         (KJS::Interpreter::stopTimeoutCheck):
2384         (KJS::Interpreter::pauseTimeoutCheck):
2385         (KJS::Interpreter::resumeTimeoutCheck):
2386         Call the timeout checker.
2387         
2388         (KJS::Interpreter::handleTimeout):
2389         Called on timeout. Resets the m_timedOut flag and calls shouldInterruptScript.
2390         
2391         * kjs/interpreter.h:
2392         (KJS::Interpreter::setTimeoutTime):
2393         New function for setting the timeout time.
2394         
2395         (KJS::Interpreter::shouldInterruptScript):
2396         New function. The idea is that this should be overridden by subclasses in order to for example
2397         pop up a dialog asking the user if the script should be interrupted.
2398         
2399         (KJS::Interpreter::checkTimeout):
2400         New function which checks the m_timedOut flag and calls handleTimeout if it's set.
2401         
2402         * kjs/nodes.cpp:
2403         (DoWhileNode::execute):
2404         (WhileNode::execute):
2405         (ForNode::execute):
2406         Call Interpreter::checkTimeout after each iteration of the loop.
2407
2408 2006-06-15  Timothy Hatcher  <timothy@apple.com>
2409
2410         Reviewed by Geoff and Darin.
2411         
2412         Prefer the DWARF debugging symbols format for use in Xcode 2.3.
2413
2414         * JavaScriptCore.xcodeproj/project.pbxproj:
2415
2416 2006-06-14  Geoffrey Garen  <ggaren@apple.com>
2417
2418         Reviewed by Beth.
2419         
2420         - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=9438
2421         Someone broke ToT: cannot build
2422
2423         * JavaScriptCore.xcodeproj/project.pbxproj:
2424         * bindings/runtime_root.h: Changed "Interpreter.h" to "interpreter.h"
2425
2426 2006-06-12  Geoffrey Garen  <ggaren@apple.com>
2427
2428         build fix
2429         
2430         * bindings/objc/WebScriptObject.mm:
2431         (+[WebScriptObject throwException:]): Restore assignment I accidentally
2432         deleted in previous commit
2433
2434 2006-06-12  Geoffrey Garen  <ggaren@apple.com>
2435
2436         Reviewed by TimO, Maciej.
2437         
2438         - Merged InterpreterImp code into Interpreter, which implements
2439         all interpreter functionality now. This is part of my continuing quest
2440         to create an external notion of JS "execution context" that is unified and simple --
2441         something to replace the mix of Context, ContextImp, ExecState, Interpreter,
2442         InterpreterImp, and JSRun.
2443         
2444         All tests pass. Leaks test has not regressed from its baseline ~207 leaks
2445         with ~3460 leaked nodes.
2446
2447         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2448         * JavaScriptCore.xcodeproj/project.pbxproj:
2449         * bindings/NP_jsobject.cpp:
2450         * bindings/objc/WebScriptObject.mm:
2451         (+[WebScriptObject throwException:]):
2452         * bindings/runtime_root.cpp:
2453         * bindings/runtime_root.h:
2454         * kjs/Context.cpp:
2455         (KJS::Context::Context):
2456         * kjs/ExecState.cpp: Added.
2457         (KJS::ExecState::lexicalInterpreter):
2458         * kjs/ExecState.h: Added.
2459         (KJS::ExecState::dynamicInterpreter):
2460         * kjs/SavedBuiltins.h: Added.
2461         * kjs/bool_object.cpp:
2462         (BooleanPrototype::BooleanPrototype):
2463         * kjs/collector.cpp:
2464         (KJS::Collector::collect):
2465         (KJS::Collector::numInterpreters):
2466         * kjs/context.h:
2467         * kjs/debugger.cpp:
2468         (Debugger::attach):
2469         (Debugger::detach):
2470         * kjs/function.cpp:
2471         (KJS::FunctionImp::callAsFunction):
2472         (KJS::GlobalFuncImp::callAsFunction):
2473         * kjs/function_object.cpp:
2474         (FunctionObjectImp::construct):
2475         * kjs/internal.cpp:
2476         * kjs/internal.h:
2477         * kjs/interpreter.cpp:
2478         (KJS::interpreterMap):
2479         (KJS::Interpreter::Interpreter):
2480         (KJS::Interpreter::init):
2481         (KJS::Interpreter::~Interpreter):
2482         (KJS::Interpreter::globalObject):
2483         (KJS::Interpreter::initGlobalObject):
2484         (KJS::Interpreter::globalExec):
2485         (KJS::Interpreter::checkSyntax):
2486         (KJS::Interpreter::evaluate):
2487         (KJS::Interpreter::builtinObject):
2488         (KJS::Interpreter::builtinFunction):
2489         (KJS::Interpreter::builtinArray):
2490         (KJS::Interpreter::builtinBoolean):
2491         (KJS::Interpreter::builtinString):
2492         (KJS::Interpreter::builtinNumber):
2493         (KJS::Interpreter::builtinDate):
2494         (KJS::Interpreter::builtinRegExp):
2495         (KJS::Interpreter::builtinError):
2496         (KJS::Interpreter::builtinObjectPrototype):
2497         (KJS::Interpreter::builtinFunctionPrototype):
2498         (KJS::Interpreter::builtinArrayPrototype):
2499         (KJS::Interpreter::builtinBooleanPrototype):
2500         (KJS::Interpreter::builtinStringPrototype):
2501         (KJS::Interpreter::builtinNumberPrototype):
2502         (KJS::Interpreter::builtinDatePrototype):
2503         (KJS::Interpreter::builtinRegExpPrototype):
2504         (KJS::Interpreter::builtinErrorPrototype):
2505         (KJS::Interpreter::builtinEvalError):
2506         (KJS::Interpreter::builtinRangeError):
2507         (KJS::Interpreter::builtinReferenceError):
2508         (KJS::Interpreter::builtinSyntaxError):
2509         (KJS::Interpreter::builtinTypeError):
2510         (KJS::Interpreter::builtinURIError):
2511         (KJS::Interpreter::builtinEvalErrorPrototype):
2512         (KJS::Interpreter::builtinRangeErrorPrototype):
2513         (KJS::Interpreter::builtinReferenceErrorPrototype):
2514         (KJS::Interpreter::builtinSyntaxErrorPrototype):
2515         (KJS::Interpreter::builtinTypeErrorPrototype):
2516         (KJS::Interpreter::builtinURIErrorPrototype):
2517         (KJS::Interpreter::mark):
2518         (KJS::Interpreter::interpreterWithGlobalObject):
2519         (KJS::Interpreter::saveBuiltins):
2520         (KJS::Interpreter::restoreBuiltins):
2521         * kjs/interpreter.h:
2522         (KJS::Interpreter::setCompatMode):
2523         (KJS::Interpreter::compatMode):
2524         (KJS::Interpreter::firstInterpreter):
2525         (KJS::Interpreter::nextInterpreter):
2526         (KJS::Interpreter::prevInterpreter):
2527         (KJS::Interpreter::debugger):
2528         (KJS::Interpreter::setDebugger):
2529         (KJS::Interpreter::setContext):
2530         (KJS::Interpreter::context):
2531         * kjs/nodes.cpp:
2532         (StatementNode::hitStatement):
2533         (RegExpNode::evaluate):
2534         * kjs/protect.h:
2535
2536 2006-06-12  Geoffrey Garen  <ggaren@apple.com>
2537
2538         Reviewed by Maciej.
2539         
2540         - Have *.lut.h files #include lookup.h to eliminate surprising header
2541         include order dependency.
2542
2543         * DerivedSources.make:
2544         * kjs/array_object.cpp:
2545         * kjs/date_object.cpp:
2546         * kjs/date_object.h:
2547         (KJS::DateProtoFunc::):
2548         * kjs/lexer.cpp:
2549         * kjs/math_object.cpp:
2550         * kjs/number_object.cpp:
2551         * kjs/regexp_object.cpp:
2552         * kjs/string_object.cpp:
2553
2554 2006-06-10  Geoffrey Garen  <ggaren@apple.com>
2555
2556         - http://bugzilla.opendarwin.org/show_bug.cgi?id=8515
2557         Linux porting compile bug
2558         
2559         Fix by Mike Emmel, Reviewed by Darin.
2560
2561         * JavaScriptCoreSources.bkl:
2562         * jscore.bkl:
2563         * wtf/Platform.h:
2564
2565 2006-06-09  Geoffrey Garen  <ggaren@apple.com>
2566
2567         Build fix -- I think :).
2568
2569         * JavaScriptCore.xcodeproj/project.pbxproj:
2570         * kjs/context.h:
2571
2572 2006-06-09  Geoffrey Garen  <ggaren@apple.com>
2573
2574         Reviewed by Eric (yay!).
2575         
2576         - Removed Context wrapper for ContextImp, renamed ContextImp to Context,
2577         split Context into its own file -- Context.cpp -- renamed _var to m_var,
2578         change ' *' to '* '.
2579
2580         * JavaScriptCore.xcodeproj/project.pbxproj:
2581         * kjs/Context.cpp: Added.
2582         (KJS::Context::Context):
2583         (KJS::Context::~Context):
2584         (KJS::Context::mark):
2585         * kjs/context.h:
2586         (KJS::Context::scopeChain):
2587         (KJS::Context::variableObject):
2588         (KJS::Context::setVariableObject):
2589         (KJS::Context::thisValue):
2590         (KJS::Context::callingContext):
2591         (KJS::Context::activationObject):
2592         (KJS::Context::currentBody):
2593         (KJS::Context::function):
2594         (KJS::Context::arguments):
2595         (KJS::Context::pushScope):
2596         (KJS::Context::seenLabels):
2597         * kjs/function.cpp:
2598         (KJS::FunctionImp::callAsFunction):
2599         (KJS::FunctionImp::processParameters):
2600         (KJS::FunctionImp::argumentsGetter):
2601         (KJS::GlobalFuncImp::callAsFunction):
2602         * kjs/internal.cpp:
2603         (KJS::InterpreterImp::evaluate):
2604         * kjs/internal.h:
2605         (KJS::InterpreterImp::setContext):
2606         (KJS::InterpreterImp::context):
2607         * kjs/interpreter.cpp:
2608         * kjs/interpreter.h:
2609         (KJS::ExecState::context):
2610         (KJS::ExecState::ExecState):
2611         * kjs/nodes.cpp:
2612         (currentSourceId):
2613         (currentSourceURL):
2614         (ThisNode::evaluate):
2615         (ResolveNode::evaluate):
2616         (FunctionCallResolveNode::evaluate):
2617         (PostfixResolveNode::evaluate):
2618         (DeleteResolveNode::evaluate):
2619         (TypeOfResolveNode::evaluate):
2620         (PrefixResolveNode::evaluate):
2621         (AssignResolveNode::evaluate):
2622         (VarDeclNode::evaluate):
2623         (VarDeclNode::processVarDecls):
2624         (DoWhileNode::execute):
2625         (WhileNode::execute):
2626         (ForNode::execute):
2627         (ForInNode::execute):
2628         (ContinueNode::execute):
2629         (BreakNode::execute):
2630         (ReturnNode::execute):
2631         (WithNode::execute):
2632         (SwitchNode::execute):
2633         (LabelNode::execute):
2634         (TryNode::execute):
2635         (FuncDeclNode::processFuncDecl):
2636         (FuncExprNode::evaluate):
2637
2638 2006-06-07  Geoffrey Garen  <ggaren@apple.com>
2639
2640         Removed API directory I prematurely/accidentally added.
2641
2642         * API: Removed.
2643
2644 2006-06-05  Mitz Pettel  <opendarwin.org@mitzpettel.com>
2645
2646         Reviewed and landed by Geoff.
2647
2648         - fix a regression in ecma_3/String/regress-104375.js
2649
2650         * kjs/string_object.cpp:
2651         (substituteBackreferences): If a 2-digit back reference is out of range,
2652         parse it as a 1-digit reference (followed by the other digit). This matches
2653         Firefox's behavior.
2654
2655 2006-06-05  Geoffrey Garen  <ggaren@apple.com>
2656
2657         Reviewed By Maciej.
2658         Darin already reviewed this change on the branch. See <rdar://problem/4317701>.
2659         
2660         - Fixed <rdar://problem/4291345> PCRE overflow in Safari JavaScriptCore
2661
2662         No test case because there's no behavior change.
2663         
2664         * pcre/pcre_compile.c:
2665         (read_repeat_counts): Check for integer overflow / out of bounds
2666
2667 2006-06-05  Geoffrey Garen  <ggaren@apple.com>
2668
2669         Reviewed by aliu.
2670
2671         - Changed CString length from int to size_t. We sould probably do this
2672         for UString, too. (Darin, if you're reading this: Maciej said so.)
2673         
2674         * kjs/function.cpp:
2675         (KJS::encode):
2676         * kjs/ustring.cpp:
2677         (KJS::CString::CString):
2678         (KJS::operator==):
2679         * kjs/ustring.h:
2680         (KJS::CString::size):
2681
2682 2006-06-04  Geoffrey Garen  <ggaren@apple.com>
2683
2684         Reviewed by Maciej.
2685         
2686         - http://bugzilla.opendarwin.org/show_bug.cgi?id=9304
2687         Minor cleanup in JavaScriptCore
2688
2689         * kjs/value.h: Removed redundant declarations
2690
2691 2006-06-04  Darin Adler  <darin@apple.com>
2692
2693         Reviewed by Anders.
2694
2695         - changed deleteAllValues so it can work on "const" collections
2696           Deleting the values affects the values, not the pointers in the
2697           collection, so it's legitimate to do it to a const collection,
2698           and a case of that actually came up in the XPath code.
2699
2700         * wtf/HashMap.h:
2701         (WTF::deleteAllPairSeconds): Use const iterators.
2702         (WTF::deleteAllValues): Take const HashMap reference as a parameter.
2703         * wtf/HashSet.h:
2704         (WTF::deleteAllValues): Take const HashSet reference as a parameter,
2705         and use const iterators.
2706         * wtf/Vector.h:
2707         (WTF::deleteAllValues): Take const Vector reference as a parameter.
2708
2709         - added more functions that are present in <math.h> on some platforms,
2710           but not on others; moved here from various files in WebCore
2711
2712         * wtf/MathExtras.h:
2713         (isinf): Added.
2714         (isnan): Added.
2715         (lround): Added.
2716         (lroundf): Tweaked.
2717         (round): Added.
2718         (roundf): Tweaked.
2719         (signbit): Added.
2720
2721 2006-06-02  Mitz Pettel  <opendarwin.org@mitzpettel.com>
2722
2723         Reviewed by ggaren.
2724
2725         - http://bugzilla.opendarwin.org/show_bug.cgi?id=9234
2726           Implement $&, $' and $` replacement codes in String.prototype.replace
2727
2728         Test: fast/js/string-replace-3.html
2729
2730         * kjs/string_object.cpp:
2731         (substituteBackreferences): Added support for $& (matched substring),
2732         $` (everything preceding matched substring), $' (everything following
2733         matched substring) and 2-digit back references, and cleaned up a little.
2734
2735 2006-06-02 Adele Peterson  <adele@apple.com>
2736
2737         Reviewed by Darin.
2738
2739         Set incremental linking to no. This seems to fix a build problem I was seeing
2740         where dftables couldn't find a dll. 
2741
2742         * JavaScriptCore.vcproj/dftables/dftables.vcproj:
2743
2744 2006-05-26  Steve Falkenburg  <sfalken@apple.com>
2745
2746         Build fixes/tweaks
2747
2748         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2749
2750 === JavaScriptCore-521.11 ===
2751
2752 2006-05-24  Geoffrey Garen  <ggaren@apple.com>
2753
2754         Reviewed by mjs.
2755         
2756         - JSC half of fix for <rdar://problem/4557926> TOT REGRESSSION: Crash
2757         occurs when attempting to view image in slideshow mode at
2758         http://d.smugmug.com/gallery/581716 ( KJS::IfNode::execute
2759         (KJS::ExecState*) + 312)
2760
2761         On alternate threads, DOMObjects remain in the
2762         ScriptInterpreter's cache because they're not collected. So, they
2763         need an opportunity to mark their children.
2764         
2765         I'm not particularly happy with this solution because it fails to
2766         resolve many outstanding issues with the DOM object cache. Since none
2767         of those issues is a crasher or a serious compatibility concern,
2768         and since the behavior of other browsers is not much to go on in this
2769         case, I've filed <rdar://problem/4561439> about that, and I'm moving on 
2770         with my life.
2771
2772         * JavaScriptCore.xcodeproj/project.pbxproj:
2773         * kjs/collector.cpp:
2774         (KJS::Collector::collect):
2775         * kjs/internal.cpp:
2776         (KJS::InterpreterImp::mark):
2777         * kjs/internal.h:
2778         * kjs/interpreter.cpp:
2779         (KJS::Interpreter::mark):
2780         * kjs/interpreter.h:
2781
2782 === JavaScriptCore-521.10 ===
2783
2784 2006-05-22  Timothy Hatcher  <timothy@apple.com>
2785
2786         Reviewed by Eric, Kevin and Geoff.
2787
2788         Merge open source build fixes. <rdar://problem/4555500>
2789
2790         * kjs/collector.cpp: look at the rsp register in x86_64 
2791         (KJS::Collector::markOtherThreadConservatively):
2792         * wtf/Platform.h: add x86_64 to the platform list
2793
2794 2006-05-19  Anders Carlsson  <acarlsson@apple.com>
2795
2796         Reviewed by Geoff.
2797
2798         http://bugzilla.opendarwin.org/show_bug.cgi?id=8993
2799         Support function declaration in case statements
2800         
2801         * kjs/grammar.y: Get rid of StatementList and use SourceElements instead.
2802         
2803         * kjs/nodes.cpp:
2804         (CaseClauseNode::evalStatements):
2805         (CaseClauseNode::processVarDecls):
2806         (CaseClauseNode::processFuncDecl):
2807         (ClauseListNode::processFuncDecl):
2808         (CaseBlockNode::processFuncDecl):
2809         (SwitchNode::processFuncDecl):
2810         * kjs/nodes.h:
2811         (KJS::CaseClauseNode::CaseClauseNode):
2812         (KJS::ClauseListNode::ClauseListNode):
2813         (KJS::ClauseListNode::getClause):
2814         (KJS::ClauseListNode::getNext):
2815         (KJS::ClauseListNode::releaseNext):
2816         (KJS::SwitchNode::SwitchNode):
2817         Add processFuncDecl for the relevant nodes.        
2818
2819         * kjs/nodes2string.cpp:
2820         (CaseClauseNode::streamTo):
2821         next got renamed to source.
2822
2823 2006-05-17  George Staikos <staikos@kde.org>
2824
2825         Reviewed by Maciej, Alexey, and Eric.
2826
2827         * pcre/pcre_compile.c:
2828         * pcre/pcre_get.c:
2829         * pcre/pcre_exec.c:
2830         * wtf/UnusedParam.h:
2831         Use /**/ in .c files to compile with non-C99 and non-GCC compilers.
2832
2833         * kjs/testkjs.cpp:
2834         Change include to <wtf/HashTraits.h> from "HashTraits.h" to avoid -I
2835
2836         * wtf/unicode/qt4/UnicodeQt4.h:
2837         Use correct parentheses and correct mask for utf-32 support.
2838
2839 2006-05-17  Alexey Proskuryakov  <ap@nypop.com>
2840
2841         Reviewed by Darin.
2842
2843         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8870
2844         Crash typing in Yahoo auto-complete widget.
2845
2846         Test: fast/js/regexp-stack-overflow.html
2847
2848         * pcre/pcre-config.h: Define NO_RECURSE.
2849
2850 2006-05-16  George Staikos <staikos@kde.org>
2851
2852         Reviewed by Maciej.
2853
2854         Fix some warnings and strict compilation errors.
2855
2856         * kjs/nodes.cpp: 
2857         * kjs/value.cpp: 
2858
2859 2006-05-15  Alexey Proskuryakov  <ap@nypop.com>
2860
2861         * make-generated-sources.sh: Changed to be executable and removed
2862         text in the file generated by "svn diff".
2863
2864 2006-05-15  Geoffrey Garen  <ggaren@apple.com>
2865
2866         Reviewed by Maciej.
2867
2868         - Fixed <rdar://problem/4534904> please do not treat "debugger" as
2869         a reserved word while parsing JavaScript (and other ECMA reserved
2870         words) 
2871
2872         AKA 
2873
2874         http://bugzilla.opendarwin.org/show_bug.cgi?id=6179 
2875         We treat "char" as a reserved word in JavaScript and firefox/IE do
2876         not
2877
2878         (1) I unreserved most of the spec's "future reserved words" because 
2879         they're not reserved in IE or FF. (Most, but not all, because IE
2880         somewhat randomly *does* reserve a few of them.)
2881         (2) I made 'debugger' a legitimate statement that acts like an empty
2882         statement because FF and IE support it.
2883         
2884         * kjs/grammar.y:
2885         * kjs/keywords.table:
2886
2887 2006-05-15  Tim Omernick  <timo@apple.com>
2888
2889         Reviewed by John Sullivan.
2890
2891         Part of <rdar://problem/4466508> Add 64-bit support to the Netscape Plugin API
2892
2893         Added to the Netscape Plugin API the concept of "plugin drawing models".  The drawing model
2894         determines the kind of graphics context created by the browser for the plugin, as well as 
2895         the Mac types of various Netscape Plugin API data structures.
2896
2897         There is a drawing model to represent the old QuickDraw-based API.  It is used by default
2898         if QuickDraw is available on the system, unless the plugin specifies another drawing model.
2899
2900         The big change is the addition of the CoreGraphics drawing model.  A plugin may request this
2901         drawing model to obtain access to a CGContextRef for drawing, instead of a QuickDraw CGrafPtr.
2902
2903         * bindings/npapi.h:
2904         Define NP_NO_QUICKDRAW when compiling 64-bit; there is no 64-bit QuickDraw.
2905         Added NPNVpluginDrawingModel, NPNVsupportsQuickDrawBool, and NPNVsupportsCoreGraphicsBool
2906         variables.
2907         Added NPDrawingModel enumeration.  Currently the only drawing models are QuickDraw and
2908         CoreGraphics.
2909         NPRegion's type now depends on the drawing model specified by the plugin.
2910         NP_Port is now only defined when QuickDraw is available.
2911         Added NP_CGContext, which is the type of the NPWindow's "window" member in CoreGraphics mode.
2912
2913 2006-05-13  Kevin M. Ollivier  <kevino@theolliviers.com>
2914
2915         Reviewed by Darin, landed by ap.
2916
2917         - http://bugzilla.opendarwin.org/show_bug.cgi?id=8528
2918           Bakefiles (and generated Makefiles) for wx and gdk ports
2919
2920         * make-generated-sources.sh: 
2921         Added script to configure environment to run DerivedSources.make
2922         
2923         * JavaScriptCoreSources.bkl:
2924         Added JavaScriptCore sources list for Bakefile.
2925         
2926         * jscore.bkl:
2927         Bakefile used to generate JavaScriptCore project files 
2928         (currently only used by wx and gdk ports)
2929
2930 2006-05-09  Steve Falkenburg  <sfalken@apple.com>
2931
2932         Fix Windows build.
2933         Minor fixes to WTF headers.
2934         
2935         Reviewed by kevin.
2936
2937         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Fix include dirs, paths to files. 
2938         * JavaScriptCore.vcproj/testkjs/testkjs.vcproj: Fix include dirs.
2939         * wtf/Assertions.h: include Platform.h to get definition for COMPILER()
2940         * wtf/Vector.h: include FastMalloc.h for definition of fastMalloc, fastFree
2941
2942 2006-05-09  Maciej Stachowiak  <mjs@apple.com>
2943
2944         Rubber stamped by Anders.
2945         
2946         - renamed kxmlcore to wtf
2947         
2948         kxmlcore --> wtf
2949         KXMLCore --> WTF
2950         KXC --> WTF
2951
2952         * JavaScriptCore.xcodeproj/project.pbxproj:
2953         * bindings/c/c_instance.cpp:
2954         * bindings/objc/WebScriptObject.mm:
2955         * kjs/JSImmediate.h:
2956         * kjs/Parser.cpp:
2957         * kjs/Parser.h:
2958         * kjs/array_object.cpp:
2959         * kjs/collector.cpp:
2960         (KJS::Collector::registerThread):
2961         * kjs/collector.h:
2962         * kjs/config.h:
2963         * kjs/function.cpp:
2964         (KJS::isStrWhiteSpace):
2965         * kjs/function.h:
2966         * kjs/identifier.cpp:
2967         * kjs/internal.cpp:
2968         * kjs/internal.h:
2969         * kjs/lexer.cpp:
2970         (Lexer::shift):
2971         (Lexer::isWhiteSpace):
2972         (Lexer::isIdentStart):
2973         (Lexer::isIdentPart):
2974         * kjs/lookup.cpp:
2975         * kjs/nodes.cpp:
2976         * kjs/nodes.h:
2977         * kjs/number_object.cpp:
2978         * kjs/object.h:
2979         * kjs/property_map.cpp:
2980         * kjs/property_map.h:
2981         * kjs/string_object.cpp:
2982         (StringProtoFunc::callAsFunction):
2983         * kjs/testkjs.cpp:
2984         (testIsInteger):
2985         * kjs/ustring.cpp:
2986         * kjs/ustring.h:
2987         * kxmlcore: Removed.
2988         * kxmlcore/AlwaysInline.h: Removed.
2989         * kxmlcore/Assertions.cpp: Removed.
2990         * kxmlcore/Assertions.h: Removed.
2991         * kxmlcore/FastMalloc.cpp: Removed.
2992         * kxmlcore/FastMalloc.h: Removed.
2993         * kxmlcore/FastMallocInternal.h: Removed.
2994         * kxmlcore/Forward.h: Removed.
2995         * kxmlcore/HashCountedSet.h: Removed.
2996         * kxmlcore/HashFunctions.h: Removed.
2997         * kxmlcore/HashMap.h: Removed.
2998         * kxmlcore/HashSet.h: Removed.
2999         * kxmlcore/HashTable.cpp: Removed.
3000         * kxmlcore/HashTable.h: Removed.
3001         * kxmlcore/HashTraits.h: Removed.
3002         * kxmlcore/ListRefPtr.h: Removed.
3003         * kxmlcore/Noncopyable.h: Removed.
3004         * kxmlcore/OwnArrayPtr.h: Removed.
3005         * kxmlcore/OwnPtr.h: Removed.
3006         * kxmlcore/PassRefPtr.h: Removed.
3007         * kxmlcore/Platform.h: Removed.
3008         * kxmlcore/RefPtr.h: Removed.
3009         * kxmlcore/TCPageMap.h: Removed.
3010         * kxmlcore/TCSpinLock.h: Removed.
3011         * kxmlcore/TCSystemAlloc.cpp: Removed.
3012         * kxmlcore/TCSystemAlloc.h: Removed.
3013         * kxmlcore/UnusedParam.h: Removed.
3014         * kxmlcore/Vector.h: Removed.
3015         * kxmlcore/VectorTraits.h: Removed.
3016         * kxmlcore/unicode: Removed.
3017         * kxmlcore/unicode/Unicode.h: Removed.
3018         * kxmlcore/unicode/UnicodeCategory.h: Removed.
3019         * kxmlcore/unicode/icu: Removed.
3020         * kxmlcore/unicode/icu/UnicodeIcu.h: Removed.
3021         * kxmlcore/unicode/posix: Removed.
3022         * kxmlcore/unicode/qt3: Removed.
3023         * kxmlcore/unicode/qt4: Removed.
3024         * kxmlcore/unicode/qt4/UnicodeQt4.h: Removed.
3025         * pcre/pcre_get.c:
3026         * wtf: Added.
3027         * wtf/Assertions.cpp:
3028         * wtf/Assertions.h:
3029         * wtf/FastMalloc.cpp:
3030         (WTF::TCMalloc_ThreadCache::Scavenge):
3031         (WTF::do_malloc):
3032         (WTF::do_free):
3033         (WTF::TCMallocGuard::TCMallocGuard):
3034         (WTF::malloc):
3035         (WTF::free):
3036         (WTF::calloc):
3037         (WTF::cfree):
3038         (WTF::realloc):
3039         * wtf/FastMalloc.h:
3040         * wtf/FastMallocInternal.h:
3041         * wtf/Forward.h:
3042         * wtf/HashCountedSet.h:
3043         * wtf/HashFunctions.h:
3044         * wtf/HashMap.h:
3045         * wtf/HashSet.h:
3046         * wtf/HashTable.cpp:
3047         * wtf/HashTable.h:
3048         * wtf/HashTraits.h:
3049         * wtf/ListRefPtr.h:
3050         * wtf/Noncopyable.h:
3051         * wtf/OwnArrayPtr.h:
3052         * wtf/OwnPtr.h:
3053         * wtf/PassRefPtr.h:
3054         * wtf/RefPtr.h:
3055         * wtf/TCSystemAlloc.cpp:
3056         (TCMalloc_SystemAlloc):
3057         * wtf/Vector.h:
3058         * wtf/VectorTraits.h:
3059         * wtf/unicode/UnicodeCategory.h:
3060         * wtf/unicode/icu/UnicodeIcu.h:
3061
3062 2006-05-08  Timothy Hatcher  <timothy@apple.com>
3063
3064         Reviewed by Tim O.
3065
3066         * bindings/npapi.h: do not define #pragma options align=mac68k if we are 64-bit
3067
3068 2006-05-07  Darin Adler  <darin@apple.com>
3069
3070         Reviewed and landed by Maciej.
3071
3072         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8765
3073         Random crashes on TOT since the form state change
3074         
3075         I haven't figured out how to construct a test for this, but this does seem to fix the
3076         problem; Mitz mentioned that a double-destroy was occurring in these functions.
3077         
3078         * kxmlcore/HashMap.h: (KXMLCore::HashMap::remove): Use RefCounter::deref instead of calling
3079         ~ValueType, because ~ValueType often results in a double-destroy, since the HashTable also
3080         destroys the element based on the storage type. The RefCounter template correctly does work
3081         only in cases where ValueType and ValueStorageType differ and this class is what's used
3082         elsewhere for the same purpose; I somehow missed this case when optimizing HashMap.
3083         * kxmlcore/HashSet.h: (KXMLCore::HashSet::remove): Ditto.
3084         
3085 2006-05-05  Darin Adler  <darin@apple.com>
3086
3087         - http://bugzilla.opendarwin.org/show_bug.cgi?id=8722
3088           IE compatibility fix in date parsing
3089
3090         * kjs/date_object.cpp: (KJS::parseDate): Merged change that George Staikos provided
3091         from KDE 3.4.3 branch that allows day values of 0 and values that are > 1000.
3092
3093 2006-05-04  Anders Carlsson  <andersca@mac.com>
3094
3095         Reviewed by Maciej.
3096
3097         http://bugzilla.opendarwin.org/show_bug.cgi?id=8734
3098         Would like a Vector::append that takes another Vector
3099         
3100         * kxmlcore/Vector.h:
3101         (KXMLCore::::append):
3102         New function that takes another array.
3103
3104 2006-05-02  Steve Falkenburg  <sfalken@apple.com>
3105
3106         Reviewed by eric.
3107
3108         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: set NDEBUG for release build
3109         * kxmlcore/FastMalloc.cpp: Prevent USE_SYSTEM_MALLOC from being defined twice
3110
3111 2006-05-02  Anders Carlsson  <andersca@mac.com>
3112
3113         Reviewed by Maciej.
3114
3115         * kxmlcore/HashMap.h:
3116         (KXMLCore::::operator):
3117         Return *this
3118
3119 2006-05-01  Tim Omernick  <timo@apple.com>
3120
3121         Reviewed by Tim Hatcher.
3122
3123         <rdar://problem/4476875> Support printing for embedded Netscape plugins
3124
3125         * bindings/npapi.h:
3126         Fixed struct alignment problem in our npapi.h.  Structs must be 68k-aligned on both pre-Mac OS X
3127         and Mac OS X systems, as this is what plugins expect.
3128
3129 2006-05-01  Timothy Hatcher  <timothy@apple.com>
3130
3131         Reviewed by Maciej.
3132         
3133         <rdar://problem/4308243> 8F36 Regression: crash in malloc_consolidate if you use a .PAC file
3134
3135         The original fix missed the oversized cell case. Added a test for "currentThreadIsMainThread || 
3136         imp->m_destructorIsThreadSafe" where we collect oversized cells.
3137
3138         We don't have a way to test PAC files yet, so there's no test attached.
3139
3140         * kjs/collector.cpp:
3141         (KJS::Collector::collect): test the thread when we collect oversized cells
3142
3143 2006-05-01  Tim Omernick  <timo@apple.com>
3144
3145         Reviewed by Adele.
3146
3147         <rdar://problem/4526114> REGRESSION (two days ago): LOG() just prints @ for NSObject substitutions
3148
3149         * kxmlcore/Assertions.cpp:
3150         Changed sense of strstr("%@") check.  I already made the same fix to the WebBrowser assertions.
3151
3152 2006-04-28  Steve Falkenburg  <sfalken@apple.com>
3153
3154         Reviewed by kdecker
3155         
3156         Actually apply the change that was reviewed insted of checking it in with an #if 0 (oops).
3157
3158         * kjs/testkjs.cpp:
3159         (main): Suppress C runtime alerts
3160
3161 2006-04-28  Steve Falkenburg  <sfalken@apple.com>
3162
3163         Reviewed by kdecker
3164
3165         Suppress error reporting dialog that blocks Javascript tests from completing.
3166         
3167         Real error is due to an overflow in the date/time handling functions that needs
3168         to be addressed, but this will prevent the hang running the Javascript tests
3169         on the build bot (along with the related changes).
3170         
3171         * kjs/testkjs.cpp:
3172         (main): Suppress C runtime alerts
3173
3174 2006-04-27  Geoffrey Garen  <ggaren@apple.com>
3175
3176         Reviewed by Maciej
3177
3178         - Minor fixups I discovered while working on the autogenerator.
3179         
3180         * kjs/lookup.cpp:
3181         (findEntry): ASSERT that size is not 0, because otherwise we'll % by 0,
3182         compute a garbage address, and possibly crash.
3183         * kjs/lookup.h:
3184         (cacheGlobalObject): Don't enumerate cached objects -- ideally, they
3185         would be hidden entirely.
3186
3187 2006-04-21  Kevin M. Ollivier  <kevino@theolliviers.com>
3188
3189         Reviewed by Darin.
3190
3191         - http://bugzilla.opendarwin.org/show_bug.cgi?id=8507
3192           Compilation fixes for building on gcc 4.0.2, and without precomp headers
3193
3194         * kjs/operations.h:
3195         * kxmlcore/Assertions.cpp:
3196         * kxmlcore/FastMalloc.cpp:
3197         Added necessary headers to resolve compilation issues when not using
3198         precompiled headers.
3199         
3200         * kjs/value.h: Declare the JSCell class before friend declaration  
3201         to resolve compilation issues with gcc 4.0.2.
3202         
3203         * kxmlcore/Platform.h: Set Unicode support to use ICU on platforms
3204         other than KDE (previously only defined for Win and Mac OS)
3205                 
3206 2006-04-18  Eric Seidel  <eseidel@apple.com>
3207
3208         Reviewed by ggaren.
3209
3210         Fix "new Function()" to correctly use lexical scoping.
3211         Add ScopeChain::print() function for debugging.
3212         <rdar://problem/4067864> REGRESSION (125-407): JavaScript failure on PeopleSoft REN Server
3213
3214         * kjs/function_object.cpp:
3215         (FunctionObjectImp::construct):
3216         * kjs/scope_chain.cpp:
3217         (KJS::ScopeChain::print):
3218         * kjs/scope_chain.h:
3219
3220 2006-04-14  James G. Speth  <speth@end.com>
3221
3222         Reviewed by Timothy.
3223
3224         Bug 8389: support for Cocoa bindings - binding an NSTreeController to the WebView's DOM
3225         http://bugzilla.opendarwin.org/show_bug.cgi?id=8389
3226
3227         Adds a category to WebScriptObject with array accessors for KVC/KVO.
3228
3229         If super valueForKey: fails it will call valueForUndefinedKey:, which is
3230         important because it causes the right behavior to happen with bindings using
3231         the "Raises for Not Applicable Keys" flag and the "Not Applicable Placeholder"
3232
3233         * bindings/objc/WebScriptObject.mm:
3234         (-[WebScriptObject valueForKey:]):
3235         (-[WebScriptObject count]):
3236         (-[WebScriptObject objectAtIndex:]):
3237         (-[WebUndefined description]): return "undefined"
3238
3239 2006-04-13  Geoffrey Garen  <ggaren@apple.com>
3240
3241         Reviewed by Darin.
3242
3243         * kjs/internal.cpp:
3244         (KJS::InterpreterImp::initGlobalObject): Add the built-in object
3245         prototype to the end of the global object's prototype chain instead of
3246         just blowing away its existing prototype. We need to do this because
3247         the window object has a meaningful prototype now.
3248
3249 2006-04-13  Maciej Stachowiak  <mjs@apple.com>
3250
3251         Reviewed by Geoff.
3252         
3253         - fix testkjs to not show false-positive KJS::Node leaks in debug builds
3254
3255         * kjs/testkjs.cpp:
3256         (doIt):
3257         (kjsmain):
3258
3259 2006-04-11  Geoffrey Garen  <ggaren@apple.com>
3260
3261         Reviewed by Maciej.
3262
3263         Minor code cleanup -- passes all the JS tests.
3264
3265         * kjs/object_object.cpp:
3266         (ObjectObjectImp::construct):
3267         (ObjectObjectImp::callAsFunction):
3268
3269 2006-04-11  Darin Adler  <darin@apple.com>
3270
3271         - another attempt to fix Windows build -- Vector in Forward.h was not working
3272
3273         * kxmlcore/Forward.h: Remove Vector.
3274         * kxmlcore/Vector.h: Add back default arguments, remove include of
3275         Forward.h.
3276
3277 2006-04-11  Darin Adler  <darin@apple.com>
3278
3279         - try to fix Windows build -- HashForward.h was not working
3280
3281         * kxmlcore/HashForward.h: Removed.
3282
3283         * JavaScriptCore.xcodeproj/project.pbxproj: Remove HashForward.h.
3284         * kjs/collector.h: Remove use of HashForward.h.
3285         * kxmlcore/HashCountedSet.h: Remove include of HashForward.h, restore
3286         default arguments.
3287         * kxmlcore/HashMap.h: Ditto.
3288         * kxmlcore/HashSet.h: Ditto.
3289
3290 2006-04-11  David Harrison  <harrison@apple.com>
3291
3292         Reviewed by Darin.
3293
3294         - fixed clean build, broken by Darin's check-in
3295
3296         * kjs/date_object.cpp: Add needed include of lookup.h.
3297         * kjs/regexp_object.cpp: Move include of .lut.h file below other includes.
3298
3299 2006-04-10  Darin Adler  <darin@apple.com>
3300
3301         Rubber-stamped by John Sullivan.
3302
3303         - switched from a shell script to a makefile for generated files
3304         - removed lots of unneeded includes
3305         - added new Forward.h and HashForward.h headers that allow compiling with
3306           fewer unneeded templates
3307
3308         * DerivedSources.make: Added.
3309         * generate-derived-sources: Removed.
3310         * JavaScriptCore.xcodeproj/project.pbxproj: Added new files, changed to use
3311         DerivedSources.make.
3312
3313         * kxmlcore/Forward.h: Added.
3314         * kxmlcore/HashForward.h: Added.
3315
3316         * kxmlcore/HashCountedSet.h: Include HashForward for default args.
3317         * kxmlcore/HashMap.h: Ditto.
3318         * kxmlcore/HashSet.h: Ditto.
3319
3320         * kjs/object.h:
3321         * kjs/object.cpp:
3322         Moved KJS_MAX_STACK into the .cpp file.
3323
3324         * bindings/NP_jsobject.cpp:
3325         * bindings/c/c_instance.h:
3326         * bindings/jni/jni_class.h:
3327         * bindings/jni/jni_runtime.h:
3328         * bindings/jni/jni_utility.h:
3329         * bindings/objc/WebScriptObject.mm:
3330         * bindings/objc/WebScriptObjectPrivate.h:
3331         * bindings/objc/objc_class.h:
3332         * bindings/objc/objc_class.mm:
3333         * bindings/objc/objc_instance.h:
3334         * bindings/objc/objc_instance.mm:
3335         * bindings/objc/objc_runtime.mm:
3336         * bindings/objc/objc_utility.mm:
3337         * bindings/runtime.h:
3338         * bindings/runtime_array.cpp:
3339         * bindings/runtime_array.h:
3340         * bindings/runtime_method.cpp:
3341         * bindings/runtime_method.h:
3342         * bindings/runtime_object.cpp:
3343         * bindings/runtime_root.h:
3344         * kjs/JSImmediate.cpp:
3345         * kjs/Parser.h:
3346         * kjs/array_object.cpp:
3347         * kjs/array_object.h:
3348         * kjs/bool_object.cpp:
3349         * kjs/bool_object.h:
3350         * kjs/collector.h:
3351         * kjs/context.h:
3352         * kjs/debugger.cpp:
3353         * kjs/error_object.h:
3354         * kjs/function_object.h:
3355         * kjs/internal.h:
3356         * kjs/lexer.cpp:
3357         * kjs/math_object.cpp:
3358         * kjs/math_object.h:
3359         * kjs/nodes.cpp:
3360         * kjs/nodes.h:
3361         * kjs/number_object.cpp:
3362         * kjs/number_object.h:
3363         * kjs/object_object.cpp:
3364         * kjs/operations.cpp:
3365         * kjs/protected_reference.h:
3366         * kjs/reference.h:
3367         * kjs/reference_list.h:
3368         * kjs/regexp_object.h:
3369         * kjs/string_object.cpp:
3370         * kjs/string_object.h:
3371         * kjs/testkjs.cpp:
3372         * kjs/value.cpp:
3373         * kjs/value.h:
3374         * kxmlcore/HashTable.h:
3375         * kxmlcore/ListRefPtr.h:
3376         * kxmlcore/TCPageMap.h:
3377         * kxmlcore/Vector.h:
3378         Removed unneeded header includes.
3379
3380 2006-04-09  Geoffrey Garen  <ggaren@apple.com>
3381
3382         Reviewed by eric.
3383
3384         - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=8284
3385         prevent unnecessary entries in the "nodes with extra refs" hash table
3386
3387         This patch switches manually RefPtr exchange with use of
3388         RefPtr::release to ensure that a node's ref count never tops 1
3389         (in the normal case).
3390
3391         * kjs/nodes.cpp:
3392         (BlockNode::BlockNode):
3393         (CaseBlockNode::CaseBlockNode):
3394         * kjs/nodes.h:
3395         (KJS::ArrayNode::ArrayNode):
3396         (KJS::ObjectLiteralNode::ObjectLiteralNode):
3397         (KJS::ArgumentsNode::ArgumentsNode):
3398         (KJS::VarStatementNode::VarStatementNode):
3399         (KJS::ForNode::ForNode):
3400         (KJS::CaseClauseNode::CaseClauseNode):
3401         (KJS::FuncExprNode::FuncExprNode):
3402         (KJS::FuncDeclNode::FuncDeclNode):
3403
3404 2006-04-08  Alexey Proskuryakov  <ap@nypop.com>
3405
3406         Reviewed by Darin.
3407
3408         One more attempt - use reinterpret_cast, rather than static_cast.
3409
3410 2006-04-08  Alexey Proskuryakov  <ap@nypop.com>
3411
3412         Reviewed by Darin.
3413
3414         An attempt to fix Win32 build - ICU uses wchar_t on Windows, so we need a type cast.
3415
3416         * kxmlcore/unicode/icu/UnicodeIcu.h:
3417         (KXMLCore::Unicode::toLower):
3418         (KXMLCore::Unicode::toUpper):
3419
3420 2006-04-08  Alexey Proskuryakov  <ap@nypop.com>
3421
3422         Reviewed by Darin.
3423
3424         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8264
3425         toLowerCase and toUpperCase don't honor special mappings
3426
3427         Test: fast/js/string-capitalization.html
3428
3429         * JavaScriptCore.xcodeproj/project.pbxproj: Added KXMLCore::Unicode headers to the project.
3430         * icu/unicode/putil.h: Added (copied from WebCore).
3431         * icu/unicode/uiter.h: Ditto.
3432         * icu/unicode/ustring.h: Ditto.
3433         * kjs/string_object.cpp:
3434         (StringProtoFunc::callAsFunction): Use the new KXMLCore::Unicode::toUpper() and toLower().
3435         * kjs/ustring.cpp: Removed unused (and evil) UChar::toLower() and toUpper().
3436         * kjs/ustring.h: Ditto.
3437
3438         * kxmlcore/unicode/Unicode.h: Corrected capitalization of the word Unicode.
3439         * kxmlcore/unicode/UnicodeCategory.h: Renamed include guard macro to match file name.
3440
3441         * kxmlcore/unicode/icu/UnicodeIcu.h:
3442         (KXMLCore::Unicode::toLower): Work on strings, not individual characters. Use ICU root locale.
3443         (KXMLCore::Unicode::toUpper): Ditto.
3444         (KXMLCore::Unicode::isFormatChar): Use int32_t, which can hold a complete code point.
3445         (KXMLCore::Unicode::isSeparatorSpace): Ditto.
3446         (KXMLCore::Unicode::category): Ditto.
3447         * kxmlcore/unicode/qt4/UnicodeQt4.h:
3448         (KXMLCore::Unicode::toLower): Work on strings, not individual characters.
3449         (KXMLCore::Unicode::toUpper): Ditto.
3450         (KXMLCore::Unicode::isFormatChar): Use int32_t, which can hold a complete code point.
3451         (KXMLCore::Unicode::isSeparatorSpace): Ditto.
3452         (KXMLCore::Unicode::category): Ditto.
3453
3454         * tests/mozilla/ecma/String/15.5.4.12-1.js: Corrected expected results.
3455         * tests/mozilla/ecma/String/15.5.4.12-5.js: Corrected expected results.
3456
3457 2006-04-05  Darin Adler  <darin@apple.com>
3458
3459         - attempt to fix Windows build
3460
3461         * kxmlcore/HashMap.h: (KXMLCore::HashMap::remove): Use (*it). instead of it->.
3462         * kxmlcore/HashSet.h: (KXMLCore::HashSet::remove): Ditto.
3463
3464 2006-04-05  Darin Adler  <darin@apple.com>
3465
3466         - attempt to fix Windows build
3467
3468         * os-win32/stdint.h: Add int8_t, uint8_t, int64_t.
3469
3470 2006-04-05  Darin Adler  <darin@apple.com>
3471
3472         Reviewed by Maciej.
3473
3474         - fix memory leak introduced by the previous change
3475
3476         * kxmlcore/HashTable.h: Specialize NeedsRef so that it correctly returns true when
3477         the value in question is a pair where one of the pair needs a ref and the other
3478         of the pair does not.
3479
3480 2006-04-05  Darin Adler  <darin@apple.com>
3481
3482         Reviewed by Maciej.
3483
3484         - JavaScriptCore part of fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=8049
3485           StringImpl hash traits deleted value creates an init routine for WebCore
3486           <rdar://problem/4442248> REGRESSION: WebCore has init routines (8049)
3487
3488         Change HashMap and HashSet implementation so they fold various types together.
3489         This allows us to implement maps and sets that use RefPtr<WebCore::StringImpl>
3490         and WebCore::String in terms of the underlying raw pointer type, and hence use
3491         -1 for the deleted value.
3492
3493         * kxmlcore/HashTraits.h: Added a new type to HashTraits, StorageTraits, which is a
3494         type to be used when storing a value that has the same layout as the type itself.
3495         This is used only for non-key cases. In the case of keys, the hash function must also
3496         be considered. Moved emptyValue out of GenericHashTraitsBase into GenericHashTraits.
3497         Added a new bool to HashTraits, needsRef, which indicates whether the type needs
3498         explicit reference counting. If the type itself has needsRef true, but the storage
3499         type has needsRef false, then the HashSet or HashMap has to handle the reference
3500         counting explicitly. Added hash trait specializations for all signed integer values
3501         that give -1 as the deleted value. Gave all integers StorageTraits of the canonical
3502         integer type of the same size so int and long will share code. Gave all pointers and
3503         RefPtrs StorageTraits of the appropriately sized integer type. Removed redundant
3504         TraitType and emptyValue definitions in the pointer specialization for HashTraits.
3505         Added PairBaseHashTraits, which doesn't try to set up needsDestruction and deletedValue.
3506         Useful for types where we don't want to force the existence of deletedValue, such as
3507         the type of a pair in a HashMap which is not the actual storage type. Removed an
3508         unneeded parameter from the DeletedValueAssigner template. Added HashKeyStorageTraits
3509         template, which determines what type can be used to store a given hash key type with
3510         a given hash function, and specialized it for pointers and RefPtr so that pointer
3511         hash tables share an underlying HashTable that uses IntHash.
3512
3513         * kxmlcore/HashTable.h: Added HashTableConstIteratorAdapter, HashTableIteratorAdapter,
3514         NeedsRef, RefCountManagerBase, RefCountManager, HashTableRefCountManagerBase, and
3515         HashTableRefCountManager. All are used by both HashSet and HashMap to handle hash
3516         tables where the type stored is not the same as the real value type.
3517         
3518         * kxmlcore/HashFunctions.h: Added a new struct named IntTypes that finds an
3519         integer type given a sizeof value. Renamed pointerHash to intHash and made it
3520         use overloading and take integer parameters. Added an IntHash struct which is
3521         a hash function that works for integers. Changed PtrHash to call IntHash with
3522         an appropriately sized integer. Made IntHash the default hash function for
3523         many integer types. Made PtrHash the default hash function for RefPtr as well
3524         as for raw pointers.
3525
3526         * kxmlcore/HashSet.h: Changed implementation to use a separate "storage type"
3527         derived from the new traits. The HashTable will use the storage type and all</