ccxvii / mujs

An embeddable Javascript interpreter in C.
http://mujs.com/
ISC License
812 stars 98 forks source link

fix split doesn't convert context to string if no argument is passed #132

Closed isRyven closed 3 years ago

isRyven commented 4 years ago

As a result can't pass a simple test like this:

var str = new String("abc");
var splits = str.split();
if (splits[0] !== "abc") {
    throw new Error('splits[0] !== "abc"');
}

Because resulted array contains reference to a context object as first argument.