⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 182863 in webkit


Ignore:
Timestamp:
Apr 15, 2015, 2:49:25 PM (11 years ago)
Author:
commit-queue@webkit.org
Message:

Number.parseInt in nightly r182673 has wrong length
https://bugs.webkit.org/show_bug.cgi?id=143657

Patch by Jordan Harband <ljharb@gmail.com> on 2015-04-15
Reviewed by Benjamin Poulain.

Source/JavaScriptCore:

Correcting funciton length from 1, to 2, to match spec
https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.parseint

  • runtime/NumberConstructor.cpp:

(JSC::NumberConstructor::finishCreation):

LayoutTests:

  • js/number-constructor-expected.txt:
  • js/script-tests/number-constructor.js:
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r182850 r182863  
     12015-04-15  Jordan Harband  <ljharb@gmail.com>
     2
     3        Number.parseInt in nightly r182673 has wrong length
     4        https://bugs.webkit.org/show_bug.cgi?id=143657
     5
     6        Reviewed by Benjamin Poulain.
     7
     8        * js/number-constructor-expected.txt:
     9        * js/script-tests/number-constructor.js:
     10
    1112015-04-15  Chris Dumez  <cdumez@apple.com>
    212
  • trunk/LayoutTests/js/number-constructor-expected.txt

    r174066 r182863  
    123123PASS Number.parseFloat("200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000") is Infinity
    124124PASS Number.parseFloat(foo) threw exception ReferenceError: Can't find variable: foo.
     125PASS Number.parseInt.length is 2
    125126PASS Number.parseInt("0") is 0
    126127PASS Number.parseInt("-0") is -0
  • trunk/LayoutTests/js/script-tests/number-constructor.js

    r174066 r182863  
    131131
    132132// parseInt
     133shouldBe('Number.parseInt.length', '2');
    133134shouldBe('Number.parseInt("0")', '0');
    134135shouldBe('Number.parseInt("-0")', '-0');
  • trunk/Source/JavaScriptCore/ChangeLog

    r182857 r182863  
     12015-04-15  Jordan Harband  <ljharb@gmail.com>
     2
     3        Number.parseInt in nightly r182673 has wrong length
     4        https://bugs.webkit.org/show_bug.cgi?id=143657
     5
     6        Reviewed by Benjamin Poulain.
     7
     8        Correcting funciton length from 1, to 2, to match spec
     9        https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.parseint
     10
     11        * runtime/NumberConstructor.cpp:
     12        (JSC::NumberConstructor::finishCreation):
     13
    1142015-04-15  Filip Pizlo  <fpizlo@apple.com>
    215
  • trunk/Source/JavaScriptCore/runtime/NumberConstructor.cpp

    r182205 r182863  
    7474    putDirectNativeFunctionWithoutTransition(vm, numberPrototype->globalObject(), Identifier::fromString(&vm, "isSafeInteger"), 1, numberConstructorFuncIsSafeInteger, NoIntrinsic, DontEnum | Function);
    7575    putDirectNativeFunctionWithoutTransition(vm, numberPrototype->globalObject(), Identifier::fromString(&vm, "parseFloat"), 1, globalFuncParseFloat, NoIntrinsic, DontEnum | Function);
    76     putDirectNativeFunctionWithoutTransition(vm, numberPrototype->globalObject(), Identifier::fromString(&vm, "parseInt"), 1, globalFuncParseInt, NoIntrinsic, DontEnum | Function);
     76    putDirectNativeFunctionWithoutTransition(vm, numberPrototype->globalObject(), Identifier::fromString(&vm, "parseInt"), 2, globalFuncParseInt, NoIntrinsic, DontEnum | Function);
    7777}
    7878
Note: See TracChangeset for help on using the changeset viewer.