• string.split();

    From MCMLXXIX@VERT/MDJ to Digital Man on Mon Sep 27 08:21:00 2010
    I've been working on something that splits a string at certain match points, and noticed that it crashes JSEXEC in windows, but not in linux...

    try this:

    "this is a test".split(/(is|a|test)/ig);


    ---
    þ Synchronet þ The BRoKEN BuBBLE (MDJ.ATH.CX)
  • From Digital Man@VERT to MCMLXXIX on Tue Sep 28 11:16:00 2010
    Re: string.split();
    By: MCMLXXIX to Digital Man on Mon Sep 27 2010 12:21 pm

    I've been working on something that splits a string at certain match
    points, and noticed that it crashes JSEXEC in windows, but not in linux...

    try this:

    "this is a test".split(/(is|a|test)/ig);

    It is interesting that it's crashing. Did you confirm that you're testing with the same version of SpiderMonkey (jslib) on Windows and Linux? When I get a chance, I'll see if I can pass on a trace to the SpiderMonkey guys. They may have already fixed this one.

    Anyway, String.split() doesn't take a regexp as an argument, so what you're trying to do won't work anyway. See https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String for details.

    digital man

    Snapple "Real Fact" #184:
    The most used letters in the English language are E, T, A, O, I and N.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From MCMLXXIX@VERT/MDJ to Digital Man on Thu Sep 30 07:42:00 2010
    Re: string.split();
    By: Digital Man to MCMLXXIX on Tue Sep 28 2010 15:16:24

    Re: string.split();
    By: MCMLXXIX to Digital Man on Mon Sep 27 2010 12:21 pm

    I've been working on something that splits a string at certain match points, and noticed that it crashes JSEXEC in windows, but not in linux..

    try this:

    "this is a test".split(/(is|a|test)/ig);

    It is interesting that it's crashing. Did you confirm that you're testing wi the same version of SpiderMonkey (jslib) on Windows and Linux? When I get a chance, I'll see if I can pass on a trace to the SpiderMonkey guys. They may have already fixed this one.

    Anyway, String.split() doesn't take a regexp as an argument, so what you're trying to do won't work anyway. See https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String details.


    it does take a regexp as an argument, and the above statement works fine in linux, I can only assume it is the same version of spidermonkey, as they are both running the same dev build of synchronet. same everything.

    the "g" wasnt necessary in that above example, I realize, but it does actually work... result: th,is, ,is, ,a, ,test,

    ---
    þ Synchronet þ The BRoKEN BuBBLE (MDJ.ATH.CX)
  • From MCMLXXIX@VERT/MDJ to Digital Man on Thu Sep 30 07:53:00 2010
    Re: string.split();
    By: Digital Man to MCMLXXIX on Tue Sep 28 2010 15:16:24

    I've been working on something that splits a string at certain match points, and noticed that it crashes JSEXEC in windows, but not in linux..

    try this:

    "this is a test".split(/(is|a|test)/ig);

    It is interesting that it's crashing. Did you confirm that you're testing wi the same version of SpiderMonkey (jslib) on Windows and Linux? When I get a chance, I'll see if I can pass on a trace to the SpiderMonkey guys. They may have already fixed this one.

    Anyway, String.split() doesn't take a regexp as an argument, so what you're trying to do won't work anyway. See https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String details.


    interestingly enough, using a regexp gives you a slightly different result: "0123456789".split("2"); // 01,3456789
    "0123456789".split(/2/); // 01,2,3456789



    ---
    þ Synchronet þ The BRoKEN BuBBLE (MDJ.ATH.CX)
  • From MCMLXXIX@VERT/MDJ to Digital Man on Thu Sep 30 07:57:00 2010
    Re: string.split();
    By: MCMLXXIX to Digital Man on Thu Sep 30 2010 11:53:48

    Re: string.split();
    By: Digital Man to MCMLXXIX on Tue Sep 28 2010 15:16:24

    I've been working on something that splits a string at certain match points, and noticed that it crashes JSEXEC in windows, but not in linu

    try this:

    "this is a test".split(/(is|a|test)/ig);

    It is interesting that it's crashing. Did you confirm that you're testing the same version of SpiderMonkey (jslib) on Windows and Linux? When I get chance, I'll see if I can pass on a trace to the SpiderMonkey guys. They have already fixed this one.

    Anyway, String.split() doesn't take a regexp as an argument, so what you' trying to do won't work anyway. See https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Stri details.


    interestingly enough, using a regexp gives you a slightly different result: "0123456789".split("2"); // 01,3456789
    "0123456789".split(/2/); // 01,2,3456789


    actually, I have to amend that last example...
    "0123456789".split(/2/); // 01,3456789
    "0123456789".split(/(2)/); //01,2,3456789

    ---
    þ Synchronet þ The BRoKEN BuBBLE (MDJ.ATH.CX)
  • From Digital Man@VERT to MCMLXXIX on Thu Sep 30 12:46:00 2010
    Re: string.split();
    By: MCMLXXIX to Digital Man on Thu Sep 30 2010 11:42 am

    Re: string.split();
    By: Digital Man to MCMLXXIX on Tue Sep 28 2010 15:16:24

    Re: string.split();
    By: MCMLXXIX to Digital Man on Mon Sep 27 2010 12:21 pm

    I've been working on something that splits a string at certain match points, and noticed that it crashes JSEXEC in windows, but not in linux..

    try this:

    "this is a test".split(/(is|a|test)/ig);

    It is interesting that it's crashing. Did you confirm that you're
    testing wi the same version of SpiderMonkey (jslib) on Windows and
    Linux? When I get a chance, I'll see if I can pass on a trace to the SpiderMonkey guys. They may have already fixed this one.

    Anyway, String.split() doesn't take a regexp as an argument, so what you're trying to do won't work anyway. See



    https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Stri details.


    it does take a regexp as an argument, and the above statement works fine in linux, I can only assume it is the same version of spidermonkey, as they
    are both running the same dev build of synchronet. same everything.

    I see that now. Weird.

    digital man

    Snapple "Real Fact" #122:
    A duck can’t walk without bobbing it’s head.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net