pre code platform Compatible #75

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants

Toona0 commented Feb 20, 2013

Low-end engine browers Array.prototype.splice requires 2nd argument to specify the
number of elements to be removed.

jsonml.splice(i, 1);

you can't remove the '1'.

  •  code.push.apply( code, jsonml.splice( i ) );
    
  •  code.push.apply( code, jsonml.splice( i , 1 ) );
    
Collaborator

ashb commented Feb 20, 2013

Hmmm, for completeness that 1 should be jsonml.length-i:

a = [1,2,3,4,5];
a.splice(2)
/*
3,4,5
*/

a = [1,2,3,4,5];
a.splice(2,1);
/*
3
*/

a = [1,2,3,4,5];
a.splice(2,a.length-2);

/*
3,4,5
*/

Although right now a code_block tree node will only have 1 element after the attributes it's probably best to not rely on that.

There are other instance of Array#splice only passing one argument in this codebase. Please fix them up too.

Owner

evilstreak commented Apr 21, 2013

This issue is resolved by 98d99c8.

evilstreak closed this Apr 21, 2013

Toona0 commented May 25, 2013

Thanks .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment