"".split(undefined,{valueOf:function(){throw 2}}) does not throw exception

XMLWordPrintable

    • Type: Sub-task
    • Resolution: Fixed
    • Priority: P4
    • 8
    • Affects Version/s: None
    • Component/s: core-libs
    • None
    • b86
    • generic
    • generic
    • Verified

      This script does not throw exception:

      "".split(undefined,{valueOf:function(){throw 2}})

      ECMA 15.5.4.14 String.prototype.split (separator, limit)

      String.prototype.split steps are as follows:

      1. Call CheckObjectCoercible passing the this value as its argument.

      2. Let S be the result of calling ToString, giving it the this value as its argument.

      3. Let A be a new array created as if by the expression new Array()where Array is the standard built-in constructor with that name.

      4. Let lengthA be 0.

      5. If limit is undefined, let lim = 232–1; else let lim = ToUint32(limit).

      [.....]

            Assignee:
            Sundararajan Athijegannathan
            Reporter:
            Sundararajan Athijegannathan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: