![]() > array, similar to the substring method. > splice called with only a single argument removes until the end of the > arguments." - therefore, a.splice(2) leads to unspecified behavior. > The spec states: "When the splice method is called with two or more > by spec though I thought the `deleteCount` should be `0` and > Firefox, Safari, Rhino, RingoJS, you name it > a.splice(2) // -> in latest Chrome, Opera, IE8 is justĭefying a de-facto standard, news at 11 :-P. Perhaps it is something which should be added to the spec.Ĭausality was the other way, of course: I implemented splice inĪnd indeed it handles omitted OFFSET and LENGTH the same. Spidermonkey extension, but technically because it is unspecified,īrowsers can do what they want and still be considered compliant. Is a SpiderMonkey extension), all elements after index are removed." "If no howMany parameter is specified (second syntax above, which (/deleteCount/),0),/len/ –/ actualStart/)."Īrguments." - therefore, a.splice(2) leads to unspecified behavior.ĭ/en/JavaScript/Reference/Global_Objects/Array/splice,Īrray, similar to the substring method. "Let /actualDeleteCount/ be min(max(ToInteger > wrote: Just checked and IE8 returns `` correctly weeee!Ī.splice(2) // -> in latest Chrome, Opera,įirefox, Safari, Rhino, RingoJS, you name itīy spec though I thought the `deleteCount` should be `0` and Something which should be *added* to the spec. "If no howMany parameter is specified (second syntax above, which is a > "Let *actualDeleteCount* be min(max(ToInteger > by spec though I thought the `deleteCount` should be `0` and so return > a.splice(2) // -> in latest Chrome, Opera, Firefox, Safari, > On Tue, at 8:49 AM, John-David Dalton at > wrote: Something which should be added to the spec. Spidermonkey extension, but technically because it is unspecified, browsersĬan do what they want and still be considered compliant. SpiderMonkey extension), all elements after index are removed."īasically, what is happening here is that everyone else accepted the Splice called with only a single argument removes until the end of theĪrray, similar to the substring method. Ifĭocs /en/JavaScript/Reference/Global_Objects/Array/splice, The spec states: "When the splice method is called with two or moreĪrguments." - therefore, a.splice(2) leads to unspecified behavior. ( deleteCount),0), len –* actualStart*)."Īm I reading it wrong or is this a bug in most engines? ![]() "Let actualDeleteCount be min(max(ToInteger /#x9.4 On Tue, at 8:49 AM, John-David Dalton wrote:Ī.splice(2) // -> in latest Chrome, Opera, Firefox, Safari,īy spec though I thought the deleteCount should be 0 and so return ![]() Just checked and IE8 returns correctly weeee! On Tue, at 9:09 AM, John-David Dalton wrote: What about we say it's a spec bug and say IE8- is wrong while the rest > Am I reading it wrong or is this a bug in most engines? > "Let /actualDeleteCount/ be min(max(ToInteger > by spec though I thought the `deleteCount` should be `0` and so > a.splice(2) // -> in latest Chrome, Opera, Firefox, ![]() Just checked and IE8 returns `` correctly weeee! ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |