Mozilla

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • JS_ValueToNumber: NaN == success?

    1 answers - 490 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    The documentation for JS_ValueToNumber states, "If the JS value is a
    JSVAL_STRING that contains numeric values and signs only, conversion
    also succeeds." It stands to reason then, if the JS value is a
    JSVAL_STRING that contains something other than that, the conversion
    should fail. However, this doesn't seem to be the case; rather, the
    jsdouble out-parameter is set to NaN and the function returns JS_TRUE.
    Is this a bug in the documentation or in SpiderMonkey?
  • No.1 | | 460 bytes | |

    The documentation, as usual. The API is around ten years old and we
    couldn't change it if we wanted to. But it in fact implements the
    conversion specified by ECMA-262 Edition 3 (ToNumber Applied to the
    String Type, 9.3.1). So we shouldn't want to change it.

    Someone please edit the MDC version of the API docs. Thanks,

    /be

    dev-tech-js-engine mailing list
    dev-tech-js-engine (AT) lists (DOT) mozilla.org

Re: JS_ValueToNumber: NaN == success?


max 4000 letters.
Your nickname that display:
In order to stop the spam: 2 + 1 =
QUESTION ON "Mozilla"

EMSDN.COM