ChangeLog 233 KB
Newer Older
ggaren's avatar
ggaren committed
1 2 3 4 5 6 7 8
2005-07-22  Geoffrey Garen  <ggaren@apple.com>

        
        Reviewed by darin.

        * tests/mozilla/jsDriver.pl: now takes the path to testkjs as a command-line argument
        * tests/mozilla/run-mozilla-tests: Removed.

ggaren's avatar
ggaren committed
9 10 11 12 13 14
2005-07-21  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by NOBODY (OOPS!).

        * JavaScriptCore.xcodeproj/.cvsignore: Added.

ggaren's avatar
ggaren committed
15 16 17 18 19 20 21 22 23 24
2005-07-21  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by NOBODY (OOPS!).

        * JavaScriptCore.pbproj/project.pbxproj: Removed.
        * JavaScriptCore.xcodeproj/ggaren.pbxuser: Added.
        * JavaScriptCore.xcodeproj/ggaren.perspective: Added.
        * JavaScriptCore.xcodeproj/project.pbxproj: Added.
        * Makefile.am:

mjs's avatar
mjs committed
25 26 27 28 29 30 31 32 33 34
2005-07-20  Maciej Stachowiak  <mjs@apple.com>

        Patch from Trey Matteson <trey@usa.net>, reviewed by me.

	- fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3956
	some of WebKit builds with symbols, some doesn't
	
        * JavaScriptCore.pbproj/project.pbxproj: Generate symbols even for
	Deployment.

35
2005-07-19  Geoffrey Garen  <ggaren@apple.com>
mjs's avatar
mjs committed
36

37 38 39 40 41 42 43 44 45 46 47 48 49
        -fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3991
        JSC doesn't implement Array.prototype.toLocaleString()

        -test failure: ecma_3/Array/15.4.4.3-1.js

        Reviewed by mjs.

        * kjs/array_object.cpp:
        (ArrayProtoFuncImp::call): now searches for toString and
        toLocaleString overrides in the array's elements

        * tests/mozilla/expected.html: failures are under 100! woohoo!

darin's avatar
darin committed
50 51 52 53 54 55 56 57 58 59 60
2005-07-19  Darin Adler  <darin@apple.com>

        - fixed the build

        * kjs/lookup.h: (KJS::lookupPut): Remove bogus const; was preventing WebCore from
        compiling (not sure why this didn't affect my other build machine).

        - one other tiny tweak (so sue me)

        * bindings/runtime_root.cpp: Remove unneeded declaration.

darin's avatar
darin committed
61 62 63 64 65 66 67 68 69 70 71 72
2005-07-19  Darin Adler  <darin@apple.com>

        Reviewed by Geoff Garen.

        - eliminated try wrappers for get/put/call since we don't use C++ exceptions any more

        * kjs/lookup.h: Changed tryCall in IMPLEMENT_PROTOFUNC here to call. It doesn't make
        sense for this macro to use the name tryCall anyway, since that's specific to how
        WebCore used this, so this is good anyway. On the other hand, it might be a problem
        for KDOM or KSVG, in which case we'll need another macro for them, since JavaScriptCore
        should presumably not have the C++ exception support.

73 74 75 76 77 78 79 80 81 82 83 84 85 86
2005-07-18  Geoffrey Garen  <ggaren@apple.com>

        -fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4008
        Error objects report incorrect length
        
        Reviewed by darin.

        * kjs/error_object.cpp: Error objects now include a length property
        (ErrorObjectImp::ErrorObjectImp):

        * tests/mozilla/expected.html: updated expected results to reflect fix
        * tests/mozilla/js1_5/Exceptions/regress-123002.js: test now expects 
        ecma compliant results

87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108
2005-07-15  Geoffrey Garen  <ggaren@apple.com>

        -rolled in KDE fixes for http://bugzilla.opendarwin.org/show_bug.cgi?id=3601
        Error instance type info
        
        Reviewed by mjs.

        * kjs/error_object.cpp:
        - Created ErrorInstanceImp class for Error() objects. 
        - Changed parent object for Native Errors to "Function" (matches
        ECMA spec).
        (ErrorInstanceImp::ErrorInstanceImp):
        (ErrorProtoFuncImp::call):
        (ErrorObjectImp::construct):
        (NativeErrorImp::construct):

        * kjs/error_object.h:
        (KJS::ErrorInstanceImp::classInfo):
        * kjs/object.h: made comment more informative about ClassInfo

        * tests/mozilla/expected.html:

109 110 111 112 113 114 115 116 117 118 119 120
2005-07-14  Geoffrey Garen  <ggaren@apple.com>

        - fixed: JS test suite expects an out of memory error
        that our memory efficiency avoids
        
        Reviewed by mjs.

        * tests/mozilla/js1_5/Array/regress-157652.js:
        test now expects normal execution
        
        * tests/mozilla/expected.html:

121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139
2005-07-14  Geoffrey Garen  <ggaren@apple.com>
        - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4006
        testkjs doesn't implement gc()
        
        - test failure:
        ecma_3/Function/regress-104584.js
        
        Reviewed by mjs.

        * kjs/interpreter.cpp:
        (Interpreter::finalCheck): removed misleading while && comment

        * kjs/testkjs.cpp: added "gc" function to global object
        (TestFunctionImp::):
        (TestFunctionImp::call):
        (main):

        * tests/mozilla/expected.html:

140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216
2005-07-14  Geoffrey Garen  <ggaren@apple.com>

        -rolled in patches for http://bugzilla.opendarwin.org/show_bug.cgi?id=3945
        [PATCH] Safe merges of comments and other trivialities from KDE's kjs
        
        -patch by Martijn Klingens <klingens@kde.org>
        
        * kjs/array_instance.h:
        * kjs/array_object.cpp:
        * kjs/array_object.h:
        * kjs/bool_object.cpp:
        * kjs/bool_object.h:
        * kjs/collector.cpp:
        * kjs/collector.h:
        * kjs/completion.h:
        * kjs/context.h:
        * kjs/date_object.cpp:
        * kjs/date_object.h:
        * kjs/debugger.cpp:
        * kjs/debugger.h:
        * kjs/dtoa.h:
        * kjs/error_object.cpp:
        * kjs/error_object.h:
        * kjs/function.cpp:
        * kjs/function.h:
        * kjs/function_object.cpp:
        * kjs/function_object.h:
        * kjs/grammar.y:
        * kjs/identifier.cpp:
        * kjs/identifier.h:
        * kjs/internal.cpp:
        * kjs/internal.h:
        * kjs/interpreter.cpp:
        * kjs/interpreter.h:
        * kjs/interpreter_map.cpp:
        * kjs/interpreter_map.h:
        * kjs/lexer.cpp:
        * kjs/lexer.h:
        * kjs/list.cpp:
        * kjs/list.h:
        * kjs/lookup.cpp:
        * kjs/lookup.h:
        * kjs/math_object.cpp:
        * kjs/math_object.h:
        * kjs/nodes.cpp:
        * kjs/nodes.h:
        * kjs/nodes2string.cpp:
        * kjs/number_object.cpp:
        * kjs/number_object.h:
        * kjs/object.cpp:
        * kjs/object.h:
        * kjs/object_object.cpp:
        * kjs/object_object.h:
        * kjs/operations.cpp:
        * kjs/operations.h:
        * kjs/property_map.cpp:
        * kjs/property_map.h:
        * kjs/reference.cpp:
        * kjs/reference.h:
        * kjs/reference_list.cpp:
        * kjs/reference_list.h:
        * kjs/regexp.cpp:
        * kjs/regexp.h:
        * kjs/regexp_object.cpp:
        * kjs/regexp_object.h:
        * kjs/scope_chain.cpp:
        * kjs/scope_chain.h:
        * kjs/simple_number.h:
        * kjs/string_object.cpp:
        * kjs/string_object.h:
        * kjs/testkjs.cpp:
        * kjs/types.h:
        * kjs/ustring.cpp:
        * kjs/ustring.h:
        * kjs/value.cpp:
        * kjs/value.h:

ggaren's avatar
ggaren committed
217 218
2005-07-14  Geoffrey Garen  <ggaren@apple.com>

219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246
        -fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3970
        throw statements fail inside eval statements
        
        Reviewed by mjs.

        * kjs/function.cpp:
        (KJS::GlobalFuncImp::call):
        Big change since I fixed the tabbing. The important part is:
        if (c.complType() == Throw)
          exec->setException(c.value());

        * kjs/nodes.cpp:
        (ThrowNode::execute): removed duplicate KJS_CHECKEXCEPTION
        (TryNode::execute): 
        try now clears the exception state before the finally block executes,
        and checks the state after the block executes, so that exceptions in
        finally code get caught.

        * tests/mozilla/expected.html:

2005-07-14  Geoffrey Garen  <ggaren@apple.com>
        
        -landed fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=3412
        Object.prototype is missing toLocaleString

        - patch by Mark Rowe (bdash) <opendarwin.org@bdash.net.nz>
        
        -layout test info in webcore changelog
ggaren's avatar
ggaren committed
247 248 249 250 251 252 253 254 255

        Reviewed by mjs.

        * kjs/object_object.cpp:
        (ObjectPrototypeImp::ObjectPrototypeImp):
        (ObjectProtoFuncImp::call):
        * kjs/object_object.h:
        (KJS::ObjectProtoFuncImp::):

ggaren's avatar
ggaren committed
256 257 258 259 260 261 262 263
2005-07-12  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by mjs.

        * kjs/function.cpp:
        (KJS::IndexToNameMap::operator[]): fixed infinite recursion
        bug in last checkin

264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290
2005-07-12  Geoffrey Garen  <ggaren@apple.com>

        -fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3881
        arguments object should share values with function parameters

        Reviewed by mjs.

        ArgumentsImp now uses a simple hash lookup to share values
        with the activation object.

        * kjs/function.cpp:
        (KJS::FunctionImp::getParameterName):
        (KJS::IndexToNameMap::IndexToNameMap):
        (KJS::IndexToNameMap::~IndexToNameMap):
        (KJS::IndexToNameMap::isMapped):
        (KJS::IndexToNameMap::unMap):
        (KJS::IndexToNameMap::operator[]):
        (KJS::ArgumentsImp::ArgumentsImp):
        (KJS::ArgumentsImp::mark):
        (KJS::ArgumentsImp::get):
        (KJS::ArgumentsImp::put):
        (KJS::ArgumentsImp::deleteProperty):
        (KJS::ArgumentsImp::hasOwnProperty):
        (KJS::ActivationImp::createArgumentsObject):
        * kjs/function.h:
        * tests/mozilla/expected.html: updated results

291 292 293 294 295 296 297
2005-07-09  Maciej Stachowiak  <mjs@apple.com>

        - backing out my earlier collector change, it causes a performance regression in TOT

        * kjs/collector.cpp:
        (KJS::Collector::allocate):

eseidel's avatar
eseidel committed
298 299 300 301 302 303 304 305 306
2005-07-08  Eric Seidel  <eseidel@apple.com>

        Reviewed by mjs/hyatt (only in concept).

        * JavaScriptCore.pbproj/project.pbxproj: Added JavaScriptCore+SVG
        Turns on RTTI support for JavaScriptCore.framework when
        building the JavaScriptCore+SVG target.  This is needed as
        kdom (part of WebCore+SVG) requires RTTI for the time being.

mjs's avatar
mjs committed
307 308 309 310 311 312 313 314 315 316
2005-07-08  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by hyatt.

	- When there are many live objects, GC less often, to try to make
	GC cost proportional to garbage, not proportional to total memory used.

        * kjs/collector.cpp:
        (KJS::Collector::allocate):

vicki's avatar
vicki committed
317 318 319 320 321 322 323 324 325 326 327 328
2005-07-08  Vicki Murley  <vicki@apple.com>

	Fix from Carsten Guenther, reviewed by Maciej

	- fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3644 (Error string representation)

	Switch from "-" to ":" in error strings.

        * kjs/error_object.cpp:
        (ErrorProtoFuncImp::call):
        * tests/mozilla/expected.html:

329 330 331 332 333 334 335 336 337 338 339 340 341
2005-07-08  Geoffrey Garen  <ggaren@apple.com>

        -rolled in patch for http://bugzilla.opendarwin.org/show_bug.cgi?id=3878
        arguments object should be an object not an array

        Reviewed by mjs.

        * kjs/function.cpp:
        (KJS::ArgumentsImp::ArgumentsImp): now manually handles initialization
        we used to get for free by inheriting from ArrayInstanceImp
        * kjs/function.h: ArgumentsImp now inherits from ObjectImp
        * tests/mozilla/expected.html: updated expected test results

eseidel's avatar
eseidel committed
342 343 344 345 346 347 348
2005-07-07  Eric Seidel  <eseidel@apple.com>

        Reviewed by mjs.

        * kjs/grammar.y: removed #define YYMAXDEPTH 0 for bison 2.0
        http://bugzilla.opendarwin.org/show_bug.cgi?id=3882

mjs's avatar
mjs committed
349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389
2005-07-03  Maciej Stachowiak  <mjs@apple.com>

	Original patch from Mark Rowe <opendarwin.org@bdash.net.nz>, reviewed by me.
	Fixes to patch by me, reviewed by John Sullivan.

	- fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3293

        Test cases added:
        * tests/mozilla/expected.html: Two tests newly pass.

        * bindings/objc/objc_runtime.h:
        * bindings/objc/objc_runtime.mm:
        (ObjcFallbackObjectImp::hasOwnProperty):
        * bindings/runtime_array.cpp:
        (RuntimeArrayImp::hasOwnProperty):
        * bindings/runtime_array.h:
        * bindings/runtime_object.cpp:
        (RuntimeObjectImp::hasOwnProperty):
        * bindings/runtime_object.h:
        * kjs/array_instance.h:
        * kjs/array_object.cpp:
        (ArrayInstanceImp::hasOwnProperty):
        * kjs/function.cpp:
        (KJS::FunctionImp::hasOwnProperty):
        (KJS::ActivationImp::hasOwnProperty):
        * kjs/function.h:
        * kjs/lookup.h:
        * kjs/object.cpp:
        (KJS::ObjectImp::hasProperty):
        (KJS::ObjectImp::hasOwnProperty):
        * kjs/object.h:
        (KJS::Object::hasOwnProperty):
        * kjs/object_object.cpp:
        (ObjectPrototypeImp::ObjectPrototypeImp):
        (ObjectProtoFuncImp::call):
        * kjs/object_object.h:
        (KJS::ObjectProtoFuncImp::):
        * kjs/string_object.cpp:
        (StringInstanceImp::hasOwnProperty):
        * kjs/string_object.h:

ggaren's avatar
ggaren committed
390 391 392 393 394 395 396 397 398 399 400 401 402 403
2005-07-01  Geoffrey Garen  <ggaren@apple.com>

        -landed patch by Eric Seidel <macdome@opendarwin.org>
        
        -for http://bugzilla.opendarwin.org/show_bug.cgi?id=3657
        GroundWork:  Moving some functions from khtml->jsc following kjs TOT
        
        - no layout test necessary yet - only groundwork

        Reviewed by darin.

        * kjs/lookup.h:
        (KJS::cacheGlobalObject):

ggaren's avatar
ggaren committed
404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435
2005-07-01  Geoffrey Garen  <ggaren@apple.com>

        -landed patch by Carsten Guenther <cguenther@gmail.com>

        -fixes http://bugzilla.opendarwin.org/show_bug.cgi?id=3477
        some US-centric date formats not parsed by JavaScript (clock at news8austin.com)

        -relevant tests:
               mozilla/ecma_3/Date/15.9.5.5.js 
               layout-tests/fast/js/date-parse-test.html

        Reviewed by darin.

        * kjs/date_object.cpp:
        (formatLocaleDate):
        (day):
        (dayFromYear):
        (daysInYear):
        (timeFromYear):
        (yearFromTime):
        (weekDay):
        (timeZoneOffset):
        (DateProtoFuncImp::call):
        (DateObjectImp::construct):
        (KJS::parseDate):
        (ymdhms_to_seconds):
        (KJS::makeTime):
        (findMonth):
        (KJS::KRFCDate_parseDate):
        * kjs/date_object.h:
        * tests/mozilla/expected.html: updated expected results to reflect fix

436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453
2005-07-01  Geoffrey Garen  <ggaren@apple.com>

        -fixed <rdar://problem/4168186> JavaScript fails to throw exceptions 
        for invalid return statements
        
        relevant tests:
            ecma/Statements/12.9-1-n.js
            ecma_2/Exceptions/lexical-052.js
            ecma_2/Exceptions/statement-009.js

        Reviewed by sullivan.

        * kjs/nodes.cpp:
        (ReturnNode::execute): now throws exception if return is not inside
        a function.

        * tests/mozilla/expected.html: updated to reflect fix

ggaren's avatar
ggaren committed
454 455 456 457 458 459
2005-07-01  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by sullivan.

        * tests/mozilla/expected.html: Updated test results for last fix.

460 461 462 463 464 465 466 467 468 469 470 471 472
2005-07-01  Geoffrey Garen  <ggaren@apple.com>

        -fixed <rdar://problem/4168161> JavaScript fails to throw an exception 
        for invalid function calls
        
        Reviewed by sullivan.

        Relevant mozilla test: ecma_3/Exceptions/regress-95101.js 

        * kjs/nodes.cpp:
        (FunctionCallNode::evaluate): evaluate now checks for an exception
        after resolving a function name (in case the function is undefined)

eseidel's avatar
eseidel committed
473 474 475 476 477 478 479 480 481 482
2005-07-01  Eric Seidel  <eseidel@apple.com>

        Reviewed by darin.

        * kjs/interpreter.h:
        (KJS::Context::curStmtFirstLine): stub for compatibility with KDE
        * kjs/value.h:
        (KJS::Value::isValid): compatibility with KDE
	http://bugzilla.opendarwin.org/show_bug.cgi?id=3687

eseidel's avatar
eseidel committed
483 484 485 486 487 488 489 490
2005-07-01  Eric Seidel  <eseidel@apple.com>

        Reviewed by darin.

        * kjs/create_hash_table: rolled in changes from KDE, including
	-n <namespace> support from KDOM and support for newer comments
	http://bugzilla.opendarwin.org/show_bug.cgi?id=3771

491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525
2005-06-30  Geoffrey Garen  <ggaren@apple.com>

        -rolled in KDE fix to <rdar://problem/4167660> JavaScript fails to 
        throw exceptions for invalid break/continue statements

        No layout tests because it's already covered by the Mozilla suite

        Reviewed by mjs.

        * kjs/internal.h: LabelStack now tracks where you are relative to
        switch and iteration (loop) statements
        
        (KJS::LabelStack::LabelStack):
        (KJS::LabelStack::pushIteration):
        (KJS::LabelStack::popIteration):
        (KJS::LabelStack::inIteration):
        (KJS::LabelStack::pushSwitch):
        (KJS::LabelStack::popSwitch):
        (KJS::LabelStack::inSwitch):

        * kjs/nodes.cpp: 
        These files were updated to use the new LabelStack:
        (DoWhileNode::execute): 
        (WhileNode::execute):
        (ForNode::execute):
        (ForInNode::execute):
        (SwitchNode::execute):
        
        These files were updated to throw exceptions for invalid
        break/continue statements:
        (BreakNode::execute): 
        (ContinueNode::execute):

        * tests/mozilla/expected.html: Updated expected results to reflect fix

kdecker's avatar
kdecker committed
526 527 528 529 530 531 532 533 534 535 536
2005-06-30  Kevin Decker  <kdecker@apple.com>

        Reviewed by rjw.

	fixed: <rdar://problem/4166838> failed assertion in`Interpreter::lockCount() > 0

	no layout test added; this is in the bindings code.

        * bindings/objc/WebScriptObject.mm:
        (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]): make sure to lock and unlock the interpreter around allocations. 

ggaren's avatar
ggaren committed
537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552
2005-06-29  Geoffrey Garen  <ggaren@apple.com>

	Patch by Francisco Tolmasky <tolmasky@gmail.com>

	- fixes http://bugzilla.opendarwin.org/show_bug.cgi?id=3667
	Core JavaScript 1.5 Reference:Objects:Array:forEach

	See WebCore Changelog for layout tests added.

        Reviewed by darin.

        * kjs/array_object.cpp:
        (ArrayProtoFuncImp::call):
        * kjs/array_object.h:
        (KJS::ArrayProtoFuncImp::):

ggaren's avatar
ggaren committed
553 554 555 556 557 558 559 560 561 562 563 564 565 566
2005-06-29  Geoffrey Garen  <ggaren@apple.com>

	Patch contributed by Oliver Hunt <ojh16@student.canterbury.ac.nz>

	-fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3743
	Incorrect error message given for certain calls

	See WebCore Changelog for layout test added.

        Reviewed by mjs.

        * kjs/object.cpp:
        (KJS::ObjectImp::defaultValue):

567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584
2005-06-29  Geoffrey Garen  <ggaren@apple.com>

	Rolling out date patch from 6-28-05 because it breaks 
	fast/js/date-parse-test

        Reviewed by NOBODY.

        * kjs/date_object.cpp:
        (formatLocaleDate):
        (DateProtoFuncImp::call):
        (DateObjectImp::construct):
        (KJS::parseDate):
        (ymdhms_to_seconds):
        (isSpaceOrTab):
        (KJS::KRFCDate_parseDate):
        * kjs/date_object.h:
        * tests/mozilla/expected.html:

ggaren's avatar
ggaren committed
585 586 587 588 589 590 591 592 593 594 595 596
2005-06-29  Geoffrey Garen  <ggaren@apple.com>

        Reviewed by Darin.

	-fixes http://bugzilla.opendarwin.org/show_bug.cgi?id=3750
	build fails with KJS_VERBOSE set

        * kjs/nodes.cpp: changed debug print statement to use UString
        (VarDeclNode::evaluate):
        * kjs/reference.cpp: ditto
        (KJS::Reference::putValue):

597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624
2005-06-28  Geoffrey Garen  <ggaren@apple.com>

	Patch contributed by Carsten Guenther <cguenther@gmail.com>.

	-fixes http://bugzilla.opendarwin.org/show_bug.cgi?id=3477
	some US-centric date formats not parsed by JavaScript (clock at news8austin.com)

        Reviewed by darin.

        * kjs/date_object.cpp:
        (formatLocaleDate):
        (day):
        (dayFromYear):
        (daysInYear):
        (timeFromYear):
        (yearFromTime):
        (weekDay):
        (timeZoneOffset):
        (DateProtoFuncImp::call):
        (DateObjectImp::construct):
        (KJS::parseDate):
        (ymdhms_to_seconds):
        (KJS::makeTime):
        (findMonth):
        (KJS::KRFCDate_parseDate):
        * kjs/date_object.h:
        * tests/mozilla/expected.html: updated expected test results to reflect fix

mjs's avatar
mjs committed
625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640
2005-06-26  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.

	- replace hash functions  with better ones

        * JavaScriptCore.pbproj/project.pbxproj: Add new file to build.
        * kjs/interpreter_map.cpp:
        (KJS::InterpreterMap::computeHash): Use shared pointer hash.
        * kjs/pointer_hash.h: Added.
        (KJS::pointerHash): Pointer hash based on 32-bit mix and 64-bit mix hashes.
        * kjs/protected_values.cpp:
        (KJS::ProtectedValues::computeHash): Use shared pointer hash.
        * kjs/ustring.cpp:
        (KJS::UString::Rep::computeHash): Use SuperFastHash algorithm.

darin's avatar
darin committed
641 642 643 644 645 646 647 648 649 650 651 652 653 654 655
2005-06-22  Darin Adler  <darin@apple.com>

        Change by Anders Carlsson.
        Reviewed by me.

        - fixed <http://bugzilla.opendarwin.org/show_bug.cgi?id=3294>
          String.prototype.replace() fails with function as second param

        * kjs/string_object.cpp: (replace): Added code to handle functions.

        * tests/mozilla/expected.html: Updated since ecma_3/RegExp/regress-209067.js is fixed now.

        * tests/mozilla/run-mozilla-tests: Fix a minor coding style issue that leads to a warning each
        time we run the tests.

adele's avatar
adele committed
656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691
2005-06-21  Adele Peterson  <adele@apple.com>

        rolling out fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=3293, since it caused layout test failures.
	fast/forms/element-by-name
        fast/loader/loadInProgress

        * ChangeLog:
        * bindings/objc/objc_runtime.h:
        * bindings/objc/objc_runtime.mm:
        (ObjcFallbackObjectImp::hasProperty):
        * bindings/runtime_array.cpp:
        (RuntimeArrayImp::hasProperty):
        * bindings/runtime_array.h:
        * bindings/runtime_object.cpp:
        (RuntimeObjectImp::hasProperty):
        * bindings/runtime_object.h:
        * kjs/array_instance.h:
        * kjs/array_object.cpp:
        (ArrayInstanceImp::hasProperty):
        * kjs/function.cpp:
        (KJS::FunctionImp::hasProperty):
        (KJS::ActivationImp::hasProperty):
        * kjs/function.h:
        * kjs/object.cpp:
        (KJS::ObjectImp::hasProperty):
        * kjs/object.h:
        * kjs/object_object.cpp:
        (ObjectPrototypeImp::ObjectPrototypeImp):
        (ObjectProtoFuncImp::call):
        * kjs/object_object.h:
        (KJS::ObjectProtoFuncImp::):
        * kjs/string_object.cpp:
        (StringInstanceImp::hasProperty):
        * kjs/string_object.h:
        * tests/mozilla/expected.html:

692 693 694 695 696 697 698 699
2005-06-21  Darin Adler  <darin@apple.com>

        * JavaScriptCore.pbproj/project.pbxproj: Switched to a build rule rather than a build phase for
        .y files -- this gets rid of the problem where modifying the .y file would not cause sufficient
        compilation.

        * kjs/grammar_wrapper.cpp: Removed.

700 701 702 703 704 705 706 707 708
2005-06-21  Adele Peterson  <adele@apple.com>

        Patch from Anders Carlsson <andersca@mac.com>, reviewed by Darin.

        Fixed: <http://bugzilla.opendarwin.org/show_bug.cgi?id=3450>
        <rdar://problem/3881901> String.replace() method not working when regex pattern contains {n, m}

        * pcre/pcre.c: (pcre_compile): Remember the last char length so it can be subtracted correctly if needed.

709 710 711 712 713 714 715 716 717 718 719 720 721 722
2005-06-21  Geoffrey Garen  <ggaren@apple.com>

        - fixed <rdar://problem/4155532> 'delete' succeeds on functions
        - fixed <rdar://problem/4155049> javascript function named as "opener" doesn't get called because of window.opener property
        
        Reviewed by cblu.

        * kjs/nodes.cpp:
        (FuncDeclNode::processFuncDecl): Functions now have DontDelete and Internal attributes set when appropriate.

        Test cases:
        * tests/mozilla/expected.html: Updated for one new success.
        - see also test case added in WebCore.

mjs's avatar
mjs committed
723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758
2005-06-20  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin(first pass) and Hyatt.

        - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3576
        (roll in support for "const" keyword from KDE tree)
        - make processVarDecls handle deletability of variables declared
        in an eval block the same as evaluate would
        - make eval() call processVarDecls - needed to match mozilla and
        to make the second change testable

        I started with the KDE implementation of const but I ended up changing it a bit
        to avoid the use of a global variable. Now instead of the global variable it distinguishes
        const and var at the grammar level so the appropriate node can know the right kind of
        declaration.

        Test cases:
        * tests/mozilla/expected.html: Updated for one new test that is
        failing - we used to bail on it entirely because it checks for
        const support before starting.
        - see also test cases added in WebCore

        * kjs/grammar.y: Add rules for const declarations.
        * kjs/keywords.table: Add const keyword.
        * kjs/nodes.cpp:
        (VarDeclNode::VarDeclNode): Add parameter.
        (VarDeclNode::evaluate): Add const support.
        (VarDeclNode::processVarDecls): Add const support.
        (VarStatementNode::execute): Irrelevant change.
        (ForInNode::ForInNode): Tell our variable node that it's a variable.
        * kjs/nodes.h:
        (KJS::VarDeclNode::): Add declaration of type enum, extra constructor parameter.
        (KJS::VarStatementNode::VarStatementNode): Irrelevant change.
        * kjs/function.cpp:
        (KJS::GlobalFuncImp::call): Process var decls before evaluating.

mjs's avatar
mjs committed
759 760 761 762
2005-06-20  Maciej Stachowiak  <mjs@apple.com>

        Patch from Mark Rowe <opendarwin.org@bdash.net.nz>, reviewed by me.

adele's avatar
adele committed
763
	- fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3293
mjs's avatar
mjs committed
764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798
        
        Test cases added: 
        * tests/mozilla/expected.html: Updated for two fixed tests.
	- also added a layout test

	* bindings/objc/objc_runtime.h:
        * bindings/objc/objc_runtime.mm:
        (ObjcFallbackObjectImp::hasOwnProperty):
        * bindings/runtime_array.cpp:
        (RuntimeArrayImp::hasOwnProperty):
        * bindings/runtime_array.h:
        * bindings/runtime_object.cpp:
        (RuntimeObjectImp::hasOwnProperty):
        * bindings/runtime_object.h:
        * kjs/array_instance.h:
        * kjs/array_object.cpp:
        (ArrayInstanceImp::hasOwnProperty):
        * kjs/function.cpp:
        (KJS::FunctionImp::hasOwnProperty):
        (KJS::ActivationImp::hasOwnProperty):
        * kjs/function.h:
        * kjs/object.cpp:
        (KJS::ObjectImp::hasProperty):
        (KJS::ObjectImp::hasOwnProperty):
        * kjs/object.h:
        (KJS::Object::hasOwnProperty):
        * kjs/object_object.cpp:
        (ObjectPrototypeImp::ObjectPrototypeImp):
        (ObjectProtoFuncImp::call):
        * kjs/object_object.h:
        (KJS::ObjectProtoFuncImp::):
        * kjs/string_object.cpp:
        (StringInstanceImp::hasOwnProperty):
        * kjs/string_object.h:

darin's avatar
darin committed
799 800 801 802 803 804 805
2005-06-18  Darin Adler  <darin@apple.com>

        Reviewed by Eric Seidel.

        * pcre/get.c: (pcre_get_substring): Fix some computations so this works for UTF-16.
        This is unused in the current JavaScriptCore, but still good to fix.

darin's avatar
darin committed
806 807 808 809 810 811 812 813 814 815 816 817
2005-06-18  Darin Adler  <darin@apple.com>

        Change by Finlay Dobbie.
        Reviewed by me.

        - fixed <http://bugzilla.opendarwin.org/show_bug.cgi?id=3331>
          10.3.9 Build Failure: NSString may not respond to `+stringWithCString:encoding:'

        * bindings/objc/WebScriptObject.mm: (-[WebScriptObject stringRepresentation]):
        Undo change we did a while back to work around the gcc 3.3 compiler error.
        It no longer seems to happen, and the workaround code was 10.4-specific.

818 819 820 821 822 823 824 825 826 827 828 829 830 831
2005-06-16  Geoffrey Garen  <ggaren@apple.com>

	Fixed: <rdar://problem/4151759> 'delete' fails on variables declared inside 'eval' statements.

        Reviewed by cblu.

        * kjs/context.h:
        (KJS::ContextImp::codeType): Added code type accessor for execution context objects.
        * kjs/internal.cpp:
        (ContextImp::ContextImp): Reflects change to ContextImp::codeType.
        * kjs/nodes.cpp:
        (VarDeclNode::evaluate): Added separate code path for variable declarations inside 'eval' statements.
        * tests/mozilla/expected.html: Updated expected test results to reflect fix.

832 833 834 835 836 837 838 839
2005-06-14  Geoffrey Garen  <ggaren@apple.com>

	Updated expected.html to reflect fix to <rdar://problem/4147745>.

        Reviewed by cblu.

        * tests/mozilla/expected.html:

840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856
2005-06-14  Geoffrey Garen  <ggaren@apple.com>

	Fixed: <rdar://problem/4147745> JavaScript discards locally defined "arguments" property

	No layout tests added because this change fixes existing tests:
	ecma/ExecutionContexts/10.1.6.js
        ecma_3/Function/regress-94506.js
        js1_4/Functions/function-001.js

        Reviewed by cblu.

        * kjs/function.cpp:
        (KJS::ActivationImp::get): get now checks for an "arguments" property defined in the local variable object
	before trying to return the built-in arguments array.
	
        * kjs/function.h: ActivationImp::put no longer overrides ObjectImp::put

857 858 859 860 861 862 863 864 865 866 867
2005-06-10  Darin Adler  <darin@apple.com>

        Change by Mark Rowe <opendarwin.org@bdash.net.nz>.
        Reviewed by me.

        - further improvements to exception file/line number fix

        * kjs/nodes.h: Added setExceptionDetailsIfNeeded function.
        * kjs/nodes.cpp: Updated macros to call the new setExceptionDetailsIfNeeded function.
        (Node::setExceptionDetailsIfNeeded): Added.

868 869 870 871 872 873 874
2005-06-09  Darin Adler  <darin@apple.com>

        Change by Mark Rowe <opendarwin.org@bdash.net.nz>
	Reviewed by me.

        * kjs/nodes.cpp: Get rid of unneeded this->.

875 876 877 878 879 880 881 882 883 884 885
2005-06-08  Maciej Stachowiak  <mjs@apple.com>

        Change by Mark Rowe <opendarwin.org@bdash.net.nz>
	Reviewed by me.

	- fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=3327
	(Exception When Setting Style to Invalid Value Lacks Line/File Information)

        * kjs/nodes.cpp: Include source file and line number when making exception in
	KJS_CHECKEXCEPTIONVALUE.

886 887 888 889 890 891 892 893
2005-06-07  Darin Adler  <darin@apple.com>

        Change by Toby Peterson <toby@opendarwin.org>.
        Reviewed by me.

        * JavaScriptCore.pbproj/project.pbxproj: Allow bison 2.0, which generates the file
        with a different name.

894 895 896 897 898 899 900
2005-06-07  Darin Adler  <darin@apple.com>

        Change by Toby Peterson <toby@opendarwin.org>.
        Reviewed by me.

        * kjs/grammar.y: Remove bogus extra line from grammar.y. Toby got this change from KDE KJS.

901 902 903 904 905
2005-06-06  Darin Adler  <darin@apple.com>

        * tests/mozilla/run-mozilla-tests: Wrote a perl version of this so we don't require
        the "jst" tool to run the tests.

darin's avatar
darin committed
906 907 908 909
2005-06-04  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

910
        - add libicu headers
darin's avatar
darin committed
911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926

        * JavaScriptCore.pbproj/project.pbxproj: Added icu directory to header search path.

        * icu/README: Added.
        * icu/unicode/platform.h: Added.
        * icu/unicode/uchar.h: Added.
        * icu/unicode/uconfig.h: Added.
        * icu/unicode/umachine.h: Added.
        * icu/unicode/urename.h: Added.
        * icu/unicode/utf.h: Added.
        * icu/unicode/utf16.h: Added.
        * icu/unicode/utf8.h: Added.
        * icu/unicode/utf_old.h: Added.
        * icu/unicode/utypes.h: Added.
        * icu/unicode/uversion.h: Added.

darin's avatar
darin committed
927 928 929 930 931 932 933 934 935
2005-05-19  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.
        
        - turned off exceptions and RTTI; seems to cut JavaScriptCore code size by about 22%

        * JavaScriptCore.pbproj/project.pbxproj: Turn off exceptions and RTTI for both
        the framework and testkjs tool.

darin's avatar
darin committed
936 937 938 939 940 941 942 943 944 945
2005-05-18  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - got rid of code that depended on RTTI

        * kjs/collector.cpp:
        (KJS::className): Added. Gets class name in a KJS way, rather than a C++ RTTI way.
        (KJS::Collector::rootObjectClasses): Use className instead of typeid names.

darin's avatar
darin committed
946 947 948 949 950 951 952 953 954 955 956 957
2005-05-18  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - fix a failure seen in the Mozilla JavaScript tests where a live object was garbage-collected
          when the only reference to it was in an argList on the stack

        * kjs/list.h: Moved the operator= function into the .cpp file since it's too big to be
        a good choice to inline.
        * kjs/list.cpp: (KJS::List::operator=): Moved this formerly-inline function into a separate
        file and added missing code to update valueRefCount. It's the latter that fixes the bug.

darin's avatar
darin committed
958 959 960 961 962 963 964 965 966 967 968
2005-05-16  Darin Adler  <darin@apple.com>

        Reviewed by Adele.

        - fixed issues preventing us from compiling with newer versions of gcc 4.0

        * kjs/ustring.cpp:
        (KJS::operator==): Remove redundant and illegal KJS:: prefix on this function's definition.
        (KJS::operator<): Ditto.
        (KJS::compare): Ditto.

darin's avatar
darin committed
969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053
2005-05-09  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - turn on conservative GC unconditionally and start on SPI changes to
          eliminate the now-unneeded smart pointers since we don't ref count any more

        * kjs/value.h: Removed macros to turn conservative GC on and off.
        Removed ref and deref functions.
        (KJS::ValueImp::ValueImp): Removed non-conservative-GC code path.
        (KJS::ValueImp::isUndefined): Added. New SPI to make it easier to deal with ValueImp directly.
        (KJS::ValueImp::isNull): Ditto.
        (KJS::ValueImp::isBoolean): Ditto.
        (KJS::ValueImp::isNumber): Ditto.
        (KJS::ValueImp::isString): Ditto.
        (KJS::ValueImp::isObject): Ditto.
        (KJS::Value::Value): Removed non-conservative-GC code path and made constructor no
        longer explicit so we can quietly create Value wrappers from ValueImp *; inexpensive with
        conservative GC and eases the transition.
        (KJS::Value::operator ValueImp *): Added. Quietly creates ValueImp * from Value.
        (KJS::ValueImp::marked): Removed non-conservative-GC code path.

        * kjs/value.cpp:
        (KJS::ValueImp::mark): Removed non-conservative-GC code path.
        (KJS::ValueImp::isUndefinedOrNull): Added. New SPI to make it easier to deal with ValueImp directly.
        (KJS::ValueImp::isBoolean): Ditto.
        (KJS::ValueImp::isNumber): Ditto.
        (KJS::ValueImp::isString): Ditto.
        (KJS::ValueImp::asString): Ditto.
        (KJS::ValueImp::isObject): Ditto.
        (KJS::undefined): Ditto.
        (KJS::null): Ditto.
        (KJS::boolean): Ditto.
        (KJS::string): Ditto.
        (KJS::zero): Ditto.
        (KJS::one): Ditto.
        (KJS::two): Ditto.
        (KJS::number): Ditto.

        * kjs/object.h: Made constructor no longer explicit so we can quietly create Object
        wrappers from ObjectImp *; inexpensive with conservative GC and eases the transition.
        (KJS::Object::operator ObjectImp *): Added. Quietly creates ObjectImp * from Object.
        (KJS::ValueImp::isObject): Added. Implementation of new object-related ValueImp function.
        (KJS::ValueImp::asObject): Ditto.

        * kjs/object.cpp:
        (KJS::ObjectImp::setInternalValue): Remove non-conservative-GC code path.
        (KJS::ObjectImp::putDirect): Ditto.
        (KJS::error): Added. Function in the new SPI style to create an error object.

        * kjs/internal.h: Added the new number-constructing functions as friends of NumberImp.
        There may be a more elegant way to do this later; what's important now is the new SPI.

        * kjs/collector.h:  Remove non-conservative-GC code path and also take out some
        unneeded APPLE_CHANGES.

        * bindings/runtime_root.cpp:
        (KJS::Bindings::addNativeReference): Remove non-conservative-GC code path.
        (KJS::Bindings::removeNativeReference): Ditto.
        (RootObject::removeAllNativeReferences): Ditto.
        * bindings/runtime_root.h:
        (KJS::Bindings::RootObject::~RootObject): Ditto.
        (KJS::Bindings::RootObject::setRootObjectImp): Ditto.
        * kjs/collector.cpp:
        (KJS::Collector::allocate): Ditto.
        (KJS::Collector::collect): Ditto.
        (KJS::Collector::numGCNotAllowedObjects): Ditto.
        (KJS::Collector::numReferencedObjects): Ditto.
        (KJS::Collector::rootObjectClasses): Ditto.
        * kjs/internal.cpp:
        (NumberImp::create): Ditto.
        (InterpreterImp::globalInit): Ditto.
        (InterpreterImp::globalClear): Ditto.
        * kjs/list.cpp:
        (KJS::List::markProtectedLists): Ditto.
        (KJS::List::clear): Ditto.
        (KJS::List::append): Ditto.
        * kjs/list.h:
        (KJS::List::List): Ditto.
        (KJS::List::deref): Ditto.
        (KJS::List::operator=): Ditto.
        * kjs/protect.h:
        (KJS::gcProtect): Ditto.
        (KJS::gcUnprotect): Ditto.

1054 1055 1056 1057 1058 1059 1060 1061 1062
2005-05-09  Chris Blumenberg  <cblu@apple.com>

	Workaround gcc 3.3 internal compiler errors.

        Reviewed by darin.

        * bindings/objc/WebScriptObject.mm:
        (-[WebScriptObject stringRepresentation]): call [NSString stringWithCString:encoding] rather than using @""

darin's avatar
darin committed
1063 1064 1065 1066 1067
2005-05-09  Darin Adler  <darin@apple.com>

        * Makefile.am: Don't set up PBXIntermediatesDirectory explicitly;
        Not needed to make builds work, spews undesirable error messages too.

darin's avatar
darin committed
1068 1069 1070 1071 1072 1073 1074 1075
2005-05-06  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - make building multiple trees with make work better

        * Makefile.am: Set up Xcode build directory before invoking xcodebuild.

mjs's avatar
mjs committed
1076 1077 1078 1079 1080 1081 1082 1083 1084 1085
2005-05-04  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.

	<rdar://problem/4086570> Crash in JavaScriptCore with RSS Visualizer
	
        * kjs/internal.cpp:
        (InterpreterImp::mark): mark staticNaN, it is usually protected by the Number
	prototype but there is a small window where it can get collected.

darin's avatar
darin committed
1086 1087 1088 1089 1090 1091 1092 1093 1094
2005-05-04  Darin Adler  <darin@apple.com>

        Reviewed by Dave Hyatt.

        - another gcc-4.0-related fix

        * bindings/runtime_root.h: Take off extra namespace prefixes that apparently cause problems
        compiling with gcc 4.0, although I have not observed the problems.

darin's avatar
darin committed
1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109
2005-05-04  Darin Adler  <darin@apple.com>

        Reviewed by Dave Hyatt.

        - fixed build rules to match other projects

        * JavaScriptCore.pbproj/project.pbxproj: Set deployment target to 10.3 in the build styles.
        When built without a build style (by Apple B&I) we want to get the target from the
        environment. But when built with a build style (by Safari engineers and others), we want
        to use 10.3.

        * Makefile.am: Took out extra parameters that make command-line building different from
        Xcode building. Now that this is fixed, you should not get a full rebuild if you switch
        from command line to Xcode or back.

1110 1111 1112 1113 1114 1115 1116
2005-05-04  Maciej Stachowiak  <mjs@apple.com>

        - revert presumably accidental change to mozilla JS test expected results, this
	was making the tests fail.

        * tests/mozilla/expected.html:

1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127
2005-05-03  Richard Williamson   <rjw@apple.com>

	Fixed <rdar://problem/4102644> Crash in LiveConnect below KJS::Bindings::JavaInstance::stringValue() const

	Correctly handle accessing nil objects from a Java object array.

        Reviewed by John.

        * bindings/jni/jni_runtime.cpp:
        (JavaArray::valueAt):

darin's avatar
darin committed
1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156
2005-05-01  Darin Adler  <darin@apple.com>

        - move to Xcode native targets and stop checking in generated files

        * JavaScriptCore.pbproj/project.pbxproj: Updated to use native targets and generate all the generated
        files, so we don't have to check them in any more.
        * Info.plist: Added. Native targets use a separate file for this.

        * Makefile.am: Removed pcre and kjs SUBDIRS. Also removed code that deleted the embedded copy of this
        framework, since we haven't been embedding it for some time.

        * kjs/grammar_wrapper.cpp: Added. Shell used to compile grammar.cpp since we can't add a generated file
        easily to the list of files to be compiled.

        * kjs/.cvsignore: Removed.
        * kjs/Makefile.am: Removed.
        * kjs/array_object.lut.h: Removed.
        * kjs/date_object.lut.h: Removed.
        * kjs/grammar.cpp: Removed.
        * kjs/grammar.cpp.h: Removed.
        * kjs/grammar.h: Removed.
        * kjs/lexer.lut.h: Removed.
        * kjs/math_object.lut.h: Removed.
        * kjs/number_object.lut.h: Removed.
        * kjs/string_object.lut.h: Removed.
        * pcre/.cvsignore: Removed.
        * pcre/Makefile.am: Removed.
        * pcre/chartables.c: Removed.

darin's avatar
darin committed
1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185
2005-04-28  Darin Adler  <darin@apple.com>

        Reviewed by Dave Harrison.

        - fixed problems preventing us from compiling with gcc 4.0

        * JavaScriptCore.pbproj/project.pbxproj: Removed -Wmissing-prototypes from
        WARNING_CPLUSPLUSFLAGS since it's now a C-only warning.

        * bindings/jni/jni_jsobject.cpp:
        (JSObject::getSlot): Changed some %d to %ld where the parameters where long ints.
        (JSObject::setSlot): Ditto.
        * bindings/jni/jni_utility.cpp:
        (KJS::Bindings::getJavaVM): Ditto.
        (KJS::Bindings::getJNIEnv): Ditto.
        * bindings/objc/objc_utility.mm: Fixed include of <JavascriptCore/internal.h> that needed the
        letter "S" capitalized.
        * kjs/bool_object.cpp: (BooleanProtoFuncImp::call): Rearranged how this function returns to
        avoid incorrect gcc 4.0 warning.
        * kjs/collector.cpp: (KJS::Collector::markStackObjectsConservatively): Changed code to check
        the alignment of the passed-in pointers to only require pointer-level alignment, not 8-byte alignment.
        Prevents a crash on garbage collect when compiled with gcc 4.0.
        * kjs/nodes.cpp:
        (WhileNode::execute): Added a redundant return after an infinite loop to work around incorrect gcc 4.0 warning.
        (ForNode::execute): Ditto.
        (SwitchNode::execute):Rearranged how this function returns to avoid incorrect gcc 4.0 warning.
        (LabelNode::execute): Ditto.
        * kjs/string_object.cpp: (replace): Ditto.

rjw's avatar
rjw committed
1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216
2005-04-26  Richard Williamson   <rjw@apple.com>

	Fixed <rdar://problem/4098713> Scripting API is incompatible with Mozilla
	
	We were incompatible with Mozilla's implementation of the scripting APIs in
	two ways:

	Their NPN_SetException has the following signature:

            void NPN_SetException(NPObject *npobj, const NPUTF8 *message);

	ours has:

            void NPN_SetException (NPObject * npobj, const NPString *message);

	Also, they expect the string returned from NPN_UTF8FromIdentifier() to be freed by caller.
	We do not.

	I changed both behaviors to match Mozilla.

        Reviewed by Chris.

        * bindings/NP_jsobject.cpp:
        (_NPN_SetException):
        * bindings/npruntime.cpp:
        (_NPN_UTF8FromIdentifier):
        (_NPN_IntFromIdentifier):
        (_NPN_SetExceptionWithUTF8):
        * bindings/npruntime.h:
        * bindings/npruntime_impl.h:

mjs's avatar
mjs committed
1217 1218 1219 1220 1221 1222 1223 1224 1225
2005-04-26  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Chris.

	<rdar://problem/4092136> reproducible crash in KJS::kjs_fast_realloc loading maps.google.com
        
	* kjs/string_object.cpp:
        (StringObjectFuncImp::call): Allocate adopted ustring buffer properly.

darin's avatar
darin committed
1226 1227 1228 1229 1230 1231
2005-04-22  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        * kjs/ustring.cpp: (KJS::UString::UTF8String): Fix off-by-one error in surrogate pair logic.

darin's avatar
darin committed
1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242
2005-04-22  Darin Adler  <darin@apple.com>

        Reviewed by John.

        - fixed <rdar://problem/4090046> JavaScript throw statement causes parse error when no semicolon is present

        * kjs/grammar.y: Added an additional rule for throw like the ones we have for all the other semicolon rules.
        Not sure why we missed this one earlier.

        * kjs/grammar.cpp: Regenerated.

vicki's avatar
vicki committed
1243 1244
=== JavaScriptCore-412.1 ===

darin's avatar
darin committed
1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383
2005-04-20  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - speedups, total 12% on JavaScript iBench

        I ran the benchmark under Shark and followed its advice a lot, mainly.

        * kjs/collector.cpp:
        (KJS::Collector::allocate): Take out special case for 0; costing speed but unexercised.
        Use numLiveObjectsAtLastCollect instead of numAllocationsSinceLastCollect so we don't
        have to bump it each time we call allocate. Put numLiveObjects into a local variable to
        cut down on global variable accesses. Make "next" cell pointer be a byte offset rather
        than a pointer so we don't need a special case for NULL. Allow freeList to point to some
        bogus item when the entire block is full rather than going out of our way to make it
        point to NULL.
        (KJS::Collector::markProtectedObjects): Get table size and pointer into locals outside
        the loop to avoid re-loading them over and over again.
        (KJS::Collector::collect): Put numLiveObjects into a local variable to cut down on global
        variable accesses. Make "next" cell pointer be a byte offset as above. Put numLiveObjects
        into a local variable to cut down on global variable accesses. Set numLiveObjectsAtLastCollect
        rather than numAllocationsSinceLastCollect.
        (KJS::Collector::numReferencedObjects): Get table size and pointer into locals outside
        the loop to avoid re-loading them over and over again.
        (KJS::Collector::rootObjectClasses): Ditto.

        * kjs/internal.h: Make Value be a friend of NumberImp so it can construct number objects
        directly, avoiding the conversion from Number to Value.

        * kjs/internal.cpp: (StringImp::toObject): Don't use Object::dynamicCast, because we know
        the thing is an object and we don't want to do all the extra work; just cast directly.

        * kjs/list.cpp: (KJS::List::List): Construct valueRefCount in a way that avoids the need for
        a branch -- in the hot case this just meant avoiding checking a variable we just set to false.

        * kjs/lookup.cpp: (keysMatch): Marked this inline.

        * kjs/nodes.cpp: Disabled KJS_BREAKPOINT, to avoid calling hitStatement all the time.
        (BooleanNode::evaluate): Make a Value directly, rather than making a Boolean which is converted
        into a Value.
        (NumberNode::evaluate): Ditto.
        (StringNode::evaluate): Ditto.
        (ArrayNode::evaluate): Ditto.
        (FunctionCallNode::evaluate): Use new inline baseIfMutable to avoid unnecessary getBase function.
        Also just use a pointer for func, rather than an Object.
        (PostfixNode::evaluate): Change code so that it doesn't make an excess Number, and so that it
        passes a "known to be integer" boolean in, often avoiding a conversion from floating point to
        integer and back.
        (DeleteNode::evaluate): Make a Value directly.
        (TypeOfNode::evaluate): Use new inline baseIfMutable and make Value directly.
        (PrefixNode::evaluate): Change code so that it doesn't make an excess Number, and so that it
        passes a "known to be integer" boolean in, often avoiding a conversion from floating point to
        integer and back.
        (UnaryPlusNode::evaluate): Make a Value directly.
        (NegateNode::evaluate): Change code so that it doesn't make an excess Number, and so that it
        passes a "known to be integer" boolean in, often avoiding a conversion from floating point to
        integer and back.
        (BitwiseNotNode::evaluate): Make a Value directly.
        (LogicalNotNode::evaluate): Ditto.
        (ShiftNode::evaluate): Don't convert to a double before making a Value.
        (RelationalNode::evaluate): Make a Value directly.
        (EqualNode::evaluate): Ditto.
        (BitOperNode::evaluate): Ditto.
        (AssignNode::evaluate): Make a Value directly. Change code so that it passes a "known to be integer"
        boolean in, often avoiding a conversion from floating point to integer and back.
        (VarDeclNode::evaluate): Make a Value directly.
        (ForNode::execute): Remove unused local variable.

        * kjs/operations.h:
        (KJS::isNaN): Inlined.
        (KJS::isInf): Ditto.
        (KJS::isPosInf): Ditto.
        (KJS::isNegInf): Ditto.

        * kjs/operations.cpp: Change isNaN, isInf, isPosInf, and isNegInf to be inlines.
        (KJS::equal): Rewrite to avoid creating values and recursing back into the function.
        (KJS::relation): Rearranged code so that we don't need explicit isNaN checks.
        (KJS::add): Changed code to make Value directly, and so that it passes a "known to be integer"
        boolean in, often avoiding a conversion from floating point to integer and back.
        (KJS::mult): Ditto.

        * kjs/property_map.cpp:
        (KJS::PropertyMap::~PropertyMap): Get size and entries pointer outside loop to avoid
        re-getting them inside the loop.
        (KJS::PropertyMap::clear): Ditto. Clear value pointer in addition to key, so we can just
        look at the value pointer in the mark function.
        (KJS::PropertyMap::get): Get sizeMask and entries pointer outside loop to avoid
        re-getting them inside the loop.
        (KJS::PropertyMap::put): Ditto.
        (KJS::PropertyMap::insert): Ditto.
        (KJS::PropertyMap::remove): Ditto.
        (KJS::PropertyMap::mark): Get size and entries pointer outside loop to avoid
        re-getting them inside the loop. Don't bother checking key for 0, since we already have
        to check value for 0. (Also had to change clear() to set value to 0.)
        (KJS::PropertyMap::addEnumerablesToReferenceList): Get size and entries pointer outside
        loop to avoid re-getting them inside the loop.
        (KJS::PropertyMap::addSparseArrayPropertiesToReferenceList): Ditto.
        (KJS::PropertyMap::save): Ditto.

        - other changes

        * kjs/protected_values.h: Remove unneeded class name qualifiers.

        * kjs/reference.h:
        (KJS::Reference::baseIfMutable): New inline function: replaces isMutable().
        (KJS::Reference::Reference): Inlined.
        * kjs/reference.cpp:
        (KJS::Reference::getValue): Rewrite to not use getBase.
        (KJS::Reference::putValue): Ditto.
        (KJS::Reference::deleteValue): Dittol

        * kjs/simple_number.h:
        (KJS::SimpleNumber::integerFits): Added. For use when the parameter is known to be integral.

        * kjs/string_object.cpp: (StringProtoFuncImp::call): Create the number without first converting
        to double in various cases that involve integers.

        * kjs/ustring.h:
        (KJS::UString::attach): Inlined.
        (KJS::UString::release): Inlined.
        * kjs/ustring.cpp:
        (KJS::UString::find): Get first character outside the loop instead of re-fetching it each time.

        * kjs/value.cpp:
        (Value::Value): Added overloads for all the various specific types of values, so you don't have
        to convert from, say, Number to Value, just to create one.
        (Number::Number): Added an overload that takes a boolean to indicate the number is already
        known to be an integer.

        * kjs/value.h: Added more Value constructors, added a version of toNumber that returns
        a boolean to indicate if the number is known to be an integer (because it was a "simple number").
        (KJS::ValueImp::marked): Inlined.
        (KJS::ValueImp::dispatchType): Inlined.
        (KJS::ValueImp::dispatchToPrimitive): Inlined.
        (KJS::ValueImp::dispatchToBoolean): Inlined.
        (KJS::ValueImp::dispatchToNumber): Inlined.
        (KJS::ValueImp::dispatchToString): Inlined.
        (KJS::ValueImp::dispatchToUInt32): Inlined.

1384 1385 1386 1387 1388 1389
2005-04-14  Maciej Stachowiak  <mjs@apple.com>

        - make fast_malloc.h a private header, not project

        * JavaScriptCore.pbproj/project.pbxproj:

mjs's avatar
mjs committed
1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426
2005-04-12  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Richard.

	<rdar://problem/4089734> JavaScript iBench can be sped up ~10% with custom allocator

	- use custom single-threaded malloc for all non-GC JavaScriptCore
	allocations, for a 9.1% speedup on JavaScript iBench
	
        * JavaScriptCore.pbproj/project.pbxproj:
        * kjs/collector.cpp:
        (KJS::Collector::allocate): Use dlmalloc to allocate the collector blocks.
        (KJS::Collector::collect): And dlfree to free it.
        * kjs/fast_malloc.cpp: Added, just the standard dlmalloc here.
        * kjs/fast_malloc.h: Added. Declarations for the functions. Also added a handy
	macro to give a class custom operator new/delete
        * kjs/identifier.cpp:
        (KJS::Identifier::add): Use dlmalloc/dlfree.
        * kjs/nodes.h: make nodes KJS_FAST_ALLOCATED.
        * kjs/property_map.cpp:
        (KJS::PropertyMap::~PropertyMap): Use dlmalloc/dlfree.
        (KJS::PropertyMap::rehash): ditto
        * kjs/scope_chain.h:
        * kjs/ustring.cpp:
        (KJS::UString::Rep::createCopying): New named constructor that copies a passed-in
	buffer, to hide allocation details from webcore.
        (KJS::UString::UString): use createCopying when appropriate.
        (KJS::UString::Rep::destroy): Use dlmalloc/dlfree.
        (KJS::UString::expandedSize): likewise
        (KJS::UString::expandCapacity): likewise
        (KJS::UString::expandPreCapacity): likewise
        (KJS::UString::spliceSubstringsWithSeparators): likewise
        (KJS::UString::append): likewise
        (KJS::UString::operator=): likewise
        (KJS::UString::detach): likewise
        * kjs/ustring.h: make UString and UString::Rep KJS_FAST_ALLOCATED.

mjs's avatar
mjs committed
1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454
2005-04-11  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by John.

	<rdar://problem/4086819> Avoid using protect count hash table so much for 5.6% JS iBench speedup

	- Avoid using protected values hash for the two most common cases
	- Bump up ListImp high water mark, new testing shows 508 ListImps are
	created during JS iBench.

	Net result is a 5.6% speedup on JavaScript iBench
	
        * kjs/collector.cpp:
        (KJS::Collector::collect): mark protected lists as appropriate.
        * kjs/context.h:
        * kjs/list.cpp:
        (KJS::ListImp::markValues): Moved implementation from List::markValues
        (KJS::List::markProtectedLists): Implemented - scan pool and overflow
	list.
        (KJS::allocateListImp): link lists outside the pool into a separate
	doubly linked list to be able to mark protected lists
        (KJS::deallocateListImp): do the corresponding delinking
        (KJS::List::derefValues): do nothing in conservative GC mode
        (KJS::List::refValues): do nothing in conservative GC mode
        (KJS::List::markValues): call ListImp version
        (KJS::List::append):
        * kjs/list.h:

vicki's avatar
vicki committed
1455 1456
=== Safari-412 ===

vicki's avatar
vicki committed
1457 1458
=== Safari-411 ===

vicki's avatar
vicki committed
1459 1460
=== Safari-410 ===

vicki's avatar
vicki committed
1461 1462
=== Safari-409 ===

vicki's avatar
vicki committed
1463 1464
=== Safari-408 ===

vicki's avatar
vicki committed
1465 1466
=== Safari-407 ===

1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478
2005-03-16  Jens Alfke  <jens@apple.com>

        Reviewed by Kevin.

	Fix for <rdar://problem/4025212> "REGRESSION (163-164): search not performed correctly; united.com"
	JavaScript unescape("") was returning a messed-up String object that appeared identical to an empty string, but would in some cases act as 'null' when passed to native functions, in this case the Option() constructor.
	In the implementation of unescape, the UString holding the result was not initialized to "", so it started out as a null string. If nothing was appended to it, it remained null, resulting in a JavaScript String object with some bad behaviors (namely, converting it to a DOMStringImpl results in a NULL pointer.)
	Darin says this regression occurred when we replaced our own implementation of unescape() with code from KJS.

        * kjs/function.cpp:
        (KJS::GlobalFuncImp::call):

1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490
2005-03-15  Richard Williamson   <rjw@apple.com>

	Fixed <rdar://problem/4053276> WebScripting protocol in WebKit cannot convert Boolean in Javascript to BOOL in Objective-C

	Added JavaScript boolean to type that can be converted to
	ObjC scalar parameters.

        Reviewed by Ken Kocienda.

        * bindings/objc/objc_utility.mm:
        (KJS::Bindings::convertValueToObjcValue):

vicki's avatar
vicki committed
1491 1492
=== Safari-406 ===

1493 1494
=== Safari-405 ===

vicki's avatar
vicki committed
1495 1496
=== Safari-403 ===

vicki's avatar
vicki committed
1497 1498
=== Safari-402 ===

vicki's avatar
vicki committed
1499 1500
=== Safari-401 ===

vicki's avatar
vicki committed
1501 1502
=== Safari-400 ===

vicki's avatar
vicki committed
1503 1504
=== Safari-188 ===

1505 1506 1507 1508
2005-02-21  Darin Adler  <darin@apple.com>

        * kjs/date_object.cpp: (timetUsingCF): Fixed indenting.

1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519
2005-02-17  Richard Williamson   <rjw@apple.com>

	Fixed <rdar://problem/4003251> Safari crashed at www.icelandair.com in LiveConnect code converting a Java object to a string

	Added nil check.

        Reviewed by John Sullivan.

        * bindings/jni/jni_runtime.cpp:
        (JavaField::valueFromInstance):

vicki's avatar
vicki committed
1520 1521
=== Safari-187 ===

rjw's avatar
rjw committed
1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557
2005-02-11  Richard Williamson   <rjw@apple.com>

	Fixed <rdar://problem/3985118> DOM objects not being marshaled on JS->native calls

	Re-factored how 'native' wrappers for JS objects are created.  The interpreter now
	creates these wrappers.  The WebCore subclass of the interpreter now overrides
	createLanguageInstanceForValue() and creates a DOM ObjC wrapper for DOM objects.

        Reviewed by Ken.

        * bindings/c/c_utility.cpp:
        (convertValueToNPVariant):
        * bindings/jni/jni_instance.cpp:
        (JavaInstance::invokeMethod):
        * bindings/jni/jni_objc.mm:
        (KJS::Bindings::dispatchJNICall):
        * bindings/jni/jni_runtime.cpp:
        (JavaField::valueFromInstance):
        (JavaArray::valueAt):
        * bindings/objc/WebScriptObject.mm:
        (-[WebScriptObject _setExecutionContext:KJS::Bindings::]):
        (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
        * bindings/objc/WebScriptObjectPrivate.h:
        * bindings/objc/objc_utility.h:
        * bindings/objc/objc_utility.mm:
        (KJS::Bindings::convertObjcValueToValue):
        (KJS::Bindings::createObjcInstanceForValue):
        * bindings/runtime.cpp:
        (Instance::createBindingForLanguageInstance):
        (Instance::createRuntimeObject):
        (Instance::createLanguageInstanceForValue):
        * bindings/runtime.h:
        * kjs/interpreter.cpp:
        (Interpreter::createLanguageInstanceForValue):
        * kjs/interpreter.h:

vicki's avatar
vicki committed
1558 1559
=== Safari-186 ===

1560 1561 1562 1563 1564 1565 1566 1567
2005-02-10  Darin Adler  <darin@apple.com>

        "Reviewed" by Richard (he told me the file was obsolete).

        - got rid of an obsolete file

        * bindings/npsap.h: Removed.

1568 1569
=== Safari-185 ===

1570 1571
=== Safari-183 ===

1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584
2005-02-03  Richard Williamson   <rjw@apple.com>

	Fixed <rdar://problem/3972905> CrashTracer: ...36 crashes at com.apple.WebCore: khtml::CSSStyleSelector::applyDeclarations + 120

	Revert to old (and correct) behavior of returning runtime object
	when passed as a parameter, rather than it's corresponding DOM
	object.

        Reviewed by Chris.

        * bindings/objc/WebScriptObject.mm:
        (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):

vicki's avatar
vicki committed
1585 1586
=== Safari-182 ===

1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605
2005-01-28  Richard Williamson   <rjw@apple.com>

	Fixed <rdar://problem/3980389> JavaScript bindings access incorrect runtime object

	Only use special 'back door' property to get the runtime object if thisObj isn't
	already a runtime object.

	<gratuitous> Cleaned up a couple of strcmp on ClassInfo name.  Used == on
	ClassInfo pointer instead.

        Reviewed by Chris.

        * bindings/c/c_utility.cpp:
        (convertValueToNPVariant):
        * bindings/objc/WebScriptObject.mm:
        (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
        * bindings/runtime_method.cpp:
        (RuntimeMethodImp::call):

vicki's avatar
vicki committed
1606 1607
=== Safari-181 ===

rjw's avatar
rjw committed
1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634
2005-01-26  Richard Williamson   <rjw@apple.com>

	Fixed <rdar://problem/3972522> (179-180) 40% slowdown on iBench JavaScript test

	I added a member variable to ObjectImp.  This changed it's size and consequently
	hampered the optimizations built into the garbage collector.  Objects no longer
	fit within the allocators cell size, and thus allocation fell back to a slower
	allocator.

	As a result of this fix I also dramatically cleaned up how runtime objects are
	accessed.  The path mostly *removes* code.
	
        Reviewed by Chris.

        * bindings/runtime_method.cpp:
        (RuntimeMethodImp::call):
        * bindings/runtime_object.cpp:
        (RuntimeObjectImp::get):
        (RuntimeObjectImp::put):
        (RuntimeObjectImp::canPut):
        (RuntimeObjectImp::hasProperty):
        (RuntimeObjectImp::defaultValue):
        * bindings/runtime_object.h:
        * kjs/object.cpp:
        (KJS::ObjectImp::ObjectImp):
        * kjs/object.h:

1635 1636 1637 1638 1639 1640 1641 1642 1643
2005-01-20  Darin Adler  <darin@apple.com>

        Reviewed by me, changes by Han Ming Ong.

        - <rdar://problem/3964302> SWB: A few files need to be updated to be compilable under GCC 4.0

        * bindings/objc/WebScriptObjectPrivate.h: Make members public.
        * kjs/lookup.h: Change "value.h" to "object.h" because we need KJS::Object to compile a template.

1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663
2005-01-20  Richard Williamson   <rjw@apple.com>

	Fixed <rdar://problem/3964634> undefined property value from binding seems to evaluate to true in an if statement

	The comprehensive fix for this problem requires new API, as described in 3965326.  However,
	given that we can't add new API at this point, the 'ObjcFallbackObjectImp' will behave
	like and Undefined object if  invokeUndefinedMethodFromWebScript:withArguments: isn't
	implemented on the bound object.

        Reviewed by Chris.

        * bindings/objc/objc_runtime.h:
        * bindings/objc/objc_runtime.mm:
        (ObjcFallbackObjectImp::type):
        (ObjcFallbackObjectImp::implementsCall):
        (ObjcFallbackObjectImp::toBoolean):
        * bindings/testbindings.mm:
        (+[MyFirstInterface isSelectorExcludedFromWebScript:]):
        (+[MyFirstInterface isKeyExcludedFromWebScript:]):

vicki's avatar
vicki committed
1664 1665
=== Safari-180 ===

1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689
2005-01-19  Richard Williamson   <rjw@apple.com>

	Fixed <rdar://problem/3853676> Browser Crash when accessing CCWeb Progress Page - KJS::Bindings::convertValueToJValue

	Fixed the following problems with LiveConnect that are demonstrated by the application
	described in 3853676.

	1.  If a nil object is passed in an array from Java to JavaScript we will crash.
	2.  We sometimes will incorrectly attempt to access a generic JavaScript as a Java runtime object wrapper.
	3.  We will sometimes fail to find the correct static method ID.

        Reviewed by Maciej.

        * bindings/jni/jni_jsobject.cpp:
        (JSObject::convertJObjectToValue):
        (JSObject::listFromJArray):
        * bindings/jni/jni_runtime.cpp:
        (JavaField::valueFromInstance):
        (JavaField::setValueToInstance):
        * bindings/jni/jni_utility.cpp:
        (KJS::Bindings::getMethodID):
        (KJS::Bindings::convertValueToJValue):
        * bindings/runtime_array.h:

rjw's avatar
rjw committed
1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724
2005-01-18  Richard Williamson   <rjw@apple.com>

	Fixed several issues all arising from analysis of plugin detection code at ifilm.com:

	Fixed <rdar://problem/3958592> can't script plug-ins if plug-in is invoked with <object> element instead of <embed>
	Fixed <rdar://problem/3958597> <object> elements with IDs do not show up as named properties of the document
	Fixed <rdar://problem/3960973> DOM objects for plugin elements are not accessible
	Fixed <rdar://problem/3958601> need an additional class ID in WebCore for the Real plug-in

	We now support accessing scriptable plugin objects that are specified with <applet>, <embed>, or <object>
	tags.  Also, if any of these elements are named they can be accessed from the document or window objects.
	Finally, DOM methods are properties will be forwarded appropriately for the plugin's root scriptable object.

        Reviewed by Chris.

        * bindings/objc/objc_instance.h:
        * bindings/objc/objc_instance.mm:
        (ObjcInstance::supportsSetValueOfUndefinedField):
        * bindings/runtime.h:
        (KJS::Bindings::Instance::supportsSetValueOfUndefinedField):
        * bindings/runtime_object.cpp:
        (RuntimeObjectImp::RuntimeObjectImp):
        (RuntimeObjectImp::get):
        (RuntimeObjectImp::put):
        (RuntimeObjectImp::canPut):
        (RuntimeObjectImp::hasProperty):
        (RuntimeObjectImp::defaultValue):
        * bindings/runtime_object.h:
        (KJS::RuntimeObjectImp::fallbackObject):
        * kjs/object.cpp:
        (KJS::ObjectImp::ObjectImp):
        * kjs/object.h:
        (KJS::ObjectImp::forwardingScriptMessage):
        (KJS::ObjectImp::setForwardingScriptMessage):

1725 1726 1727 1728 1729 1730 1731 1732 1733
2005-01-18  Richard Williamson   <rjw@apple.com>

	Back out a change that was incorrectly committed yesterday.

        Reviewed by Chris.

        * bindings/objc/objc_utility.mm:
        (KJS::Bindings::convertValueToObjcValue):

rjw's avatar
rjw committed
1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801
2005-01-17  Richard Williamson   <rjw@apple.com>

	Fixed <rdar://problem/3753030> Need to ensure same origin for plugin binding invocations (origin security rules)

	Keep track of originating execution context and target execution
	context for native JS object wrappers, and perform appropriate
	security checks.

        Reviewed by David Harrison.

        * bindings/NP_jsobject.cpp:
        (_isSafeScript):
        (_NPN_CreateScriptObject):
        (_NPN_Invoke):
        (_NPN_Evaluate):
        (_NPN_GetProperty):
        (_NPN_SetProperty):
        (_NPN_RemoveProperty):
        (_NPN_HasProperty):
        (_NPN_HasMethod):
        (_NPN_SetException):
        * bindings/NP_jsobject.h:
        * bindings/c/c_instance.cpp:
        (CInstance::CInstance):
        (CInstance::stringValue):
        * bindings/c/c_instance.h:
        * bindings/c/c_utility.cpp:
        (convertValueToNPVariant):
        * bindings/jni/jni_instance.cpp:
        (JavaInstance::JavaInstance):
        (JavaInstance::valueOf):
        * bindings/jni/jni_instance.h:
        * bindings/objc/WebScriptObject.mm:
        (-[WebScriptObject _initializeWithObjectImp:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
        (-[WebScriptObject _initWithObjectImp:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
        (-[WebScriptObject KJS::Bindings::]):
        (-[WebScriptObject _setOriginExecutionContext:KJS::Bindings::]):
        (-[WebScriptObject _isSafeScript]):
        (-[WebScriptObject callWebScriptMethod:withArguments:]):
        (-[WebScriptObject evaluateWebScript:]):
        (-[WebScriptObject setValue:forKey:]):
        (-[WebScriptObject valueForKey:]):
        (-[WebScriptObject removeWebScriptKey:]):
        (-[WebScriptObject stringRepresentation]):
        (-[WebScriptObject webScriptValueAtIndex:]):
        (-[WebScriptObject setWebScriptValueAtIndex:value:]):
        (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
        * bindings/objc/WebScriptObjectPrivate.h:
        * bindings/objc/objc_instance.h:
        * bindings/objc/objc_runtime.mm:
        (convertValueToObjcObject):
        * bindings/objc/objc_utility.mm:
        (KJS::Bindings::convertValueToObjcValue):
        * bindings/runtime.cpp:
        (Instance::Instance):
        (Instance::operator=):
        * bindings/runtime.h:
        (KJS::Bindings::Instance::Instance):
        (KJS::Bindings::Instance::setExecutionContext):
        (KJS::Bindings::Instance::executionContext):
        * bindings/runtime_root.cpp:
        (RootObject::setInterpreter):
        * bindings/runtime_root.h:
        * kjs/interpreter.h:
        (KJS::Interpreter::isGlobalObject):
        (KJS::Interpreter::interpreterForGlobalObject):
        (KJS::Interpreter::isSafeScript):

vicki's avatar
vicki committed
1802 1803
=== Safari-179 ===

vicki's avatar
vicki committed
1804 1805 1806 1807 1808 1809 1810 1811
2005-01-13  Vicki Murley <vicki@apple.com>

        Reviewed by Adele.

	- fix <rdar://problem/3946836> Safari about box lists 2004 instead of 2005
 
        * JavaScriptCore.pbproj/project.pbxproj: bump "2004" to "2005"

1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822
2005-01-12  Richard Williamson   <rjw@apple.com>

	Avoid additional work on dealloc by adding early out to
	removeNativeReference().  (This will save time on dealloc
	for all ObjC DOM objects.)

        Reviewed by Darin.

        * bindings/runtime_root.cpp:
        (KJS::Bindings::removeNativeReference):

1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834
2005-01-12  Richard Williamson   <rjw@apple.com>

	Fixed <rdar://problem/3923356> REGRESSION: Java/JavaScript security checks working incorrectly

	We were always returning the first "root" object for all runtime
	objects.  Changed 0 in loop to i, the index.

        Reviewed by David Harrison.

        * bindings/runtime_root.cpp:
        (KJS::Bindings::rootForImp):

1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854
2005-01-11  Richard Williamson   <rjw@apple.com>

	Fixed <rdar://problem/3887930> Must use new Java plug-in API to get/set fields so exception handling works (fixes many LiveConnect crashes)

	Use the new dispatching API to invoke JNI, rather than calling JNI
	directly.

        Reviewed by David Harrison.

        * bindings/jni/jni_instance.cpp:
        (JavaInstance::invokeMethod):
        * bindings/jni/jni_runtime.cpp:
        (JavaField::dispatchValueFromInstance):
        (JavaField::valueFromInstance):
        (JavaField::dispatchSetValueToInstance):
        (JavaField::setValueToInstance):
        * bindings/jni/jni_runtime.h:
        * bindings/jni/jni_utility.cpp:
        (KJS::Bindings::convertValueToJValue):

vicki's avatar
vicki committed
1855 1856
=== Safari-178 ===

adele's avatar
adele committed
1857 1858
=== Safari-177 ===

vicki's avatar
vicki committed
1859 1860
=== Safari-176 ===

mjs's avatar
mjs committed
1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872
2004-12-17  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Kevin.

	<rdar://problem/3926869> Opening caches window after running PLT causes crash
	
        * kjs/protected_values.cpp:
        (KJS::ProtectedValues::getProtectCount): Don't include simple numbers in
	the protected value table.
        (KJS::ProtectedValues::increaseProtectCount): Ditto.
        (KJS::ProtectedValues::decreaseProtectCount): Ditto.

darin's avatar
darin committed
1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883
2004-12-16  Darin Adler  <darin@apple.com>

        Reviewed by Maciej.

        - fixed <rdar://problem/3920764> Unimplemented String methods toLocaleLowerCase and toLocaleUpperCase

        * kjs/string_object.h: Added toLocaleLowerCase and toLocaleUpperCase.
        * kjs/string_object.cpp: (StringProtoFuncImp::call): Made locale versions be synonmyms for the
        non-locale-specific versions.
        * kjs/string_object.lut.h: Regenerated.

rjw's avatar
WebKit:  
rjw committed
1884 1885 1886 1887 1888 1889 1890 1891 1892
2004-12-14  Richard Williamson   <rjw@apple.com>

	Pass URL of plugin view when call into JNI.

        Reviewed by Chris.

        * bindings/jni/jni_objc.mm:
        (KJS::Bindings::dispatchJNICall):

1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912
2004-12-13  Richard Williamson   <rjw@apple.com>

	Fixed <rdar://problem/3827799> repro. crash with IBM Rational ClearCase Web under Safari (Java/LiveConnect-related)

	Add support for calling static Java methods from JavaScript.

        Reviewed by Maciej.

        * bindings/jni/jni_instance.cpp:
        (JavaInstance::invokeMethod):
        * bindings/jni/jni_runtime.cpp:
        (JavaMethod::JavaMethod):
        * bindings/jni/jni_runtime.h:
        (KJS::Bindings::JavaMethod::isStatic):
        * bindings/jni/jni_utility.cpp:
        (callJNIStaticMethod):
        (KJS::Bindings::callJNIBooleanMethod):
        (KJS::Bindings::callJNIStaticBooleanMethod):
        * bindings/jni/jni_utility.h:

rjw's avatar
WebKit:  
rjw committed
1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925
2004-12-13  Richard Williamson   <rjw@apple.com>

	Fixed <rdar://problem/3887767> LiveConnect doesn't propagate Java exceptions back to JavaScript (prevents security suite from running)

        Reviewed by John.

        * bindings/jni/jni_instance.cpp:
        (JavaInstance::invokeMethod):
        * bindings/jni/jni_objc.mm:
        (KJS::Bindings::dispatchJNICall):
        * bindings/jni/jni_runtime.h:
        * bindings/jni/jni_utility.h:

1926 1927
=== Safari-175 ===

mjs's avatar
mjs committed
1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949
2004-12-07  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Darin.

	<rdar://problem/3908017> REGRESSION (172-173): assertion in ObjectImp::construct trying to create JS error (24hourfitness.com)

	The fix was to implement copy constructor and assignment operator,
	the ones that worked on the base class did not replace the
	defaults apparently!
	
        * kjs/protect.h:
        (KJS::ProtectedValue::ProtectedValue):
        (KJS::ProtectedValue::operator=):
        (KJS::ProtectedObject::ProtectedObject):
        (KJS::ProtectedObject::operator=):
        
	Also fixed a bug in the GC test mode that compares the results of
	the old collector and the new collector.

	* kjs/value.cpp:
        (ValueImp::mark):

vicki's avatar
vicki committed
1950 1951
=== Safari-173 ===

1952 1953 1954 1955 1956 1957 1958 1959 1960
2004-11-23  Richard Williamson   <rjw@apple.com>

	Fixed <rdar://problem/3890385> field and method cache incorrectly capped (c bindings)

        Reviewed by Ken.

        * bindings/c/c_class.cpp:
        (CClass::_commonInit):

mjs's avatar
mjs committed
1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979
2004-11-21  Maciej Stachowiak  <mjs@apple.com>

        Reviewed by Ken.

	<rdar://problem/3889696> Enable conservative garbage collection for JavaScript
        
	* kjs/collector.cpp:
        (KJS::Collector::Thread::Thread):
        (KJS::destroyRegisteredThread):
        (KJS::initializeRegisteredThreadKey):
        (KJS::Collector::registerThread):
        (KJS::Collector::markStackObjectsConservatively):
        (KJS::Collector::markCurrentThreadConservatively):
        (KJS::Collector::markOtherThreadConservatively):
        * kjs/collector.h:
        * kjs/internal.cpp:
        (lockInterpreter):
        * kjs/value.h:

vicki's avatar
vicki committed
1980 1981
=== Safari-172 ===

1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994
2004-11-15  Richard Williamson   <rjw@apple.com>

        Fixed <rdar://problem/3880561> Default string value of ObjC object in JS should be [obj description].

        Reviewed by Hyatt.

        * bindings/objc/objc_instance.mm:
        (ObjcInstance::stringValue):
        * bindings/objc/objc_utility.h:
        * bindings/objc/objc_utility.mm:
        (KJS::Bindings::convertNSStringToString):
        (KJS::Bindings::convertObjcValueToValue):

vicki's avatar
vicki committed
1995 1996
=== Safari-171 ===

1997 1998 1999 2000 2001 2002 2003 2004 2005