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