The following functions are no longer restricted to 16-bit integer values:
String.fromCharCode()
String.prototype.charCodeAt()
repr() will not escape SMP characters, as doing so would require conversion to
surrogate pairs, but will encode these characters as UTF-8. Unicode characters
in the BMP will still be escaped with \uXXXX as before.
JSON.stringify() only escapes control characters, so will represent all non-ASCII
characters as UTF-8.
We do no automatic conversions to/from surrogate pairs. Code that worked with
surrogate pairs should not be affected by these changes.
Don't distinguish lax mode code by pushing the global object.
Always push undefined and let the calling code promote an undefined
this to the global object instead.
We can't print function pointer addresses at all, since converting
a function pointer to a void* is forbidden with ANSI C, so we only
print the function name.
The 'length' field of a function is used to fill in missing arguments
with undefined; this does not mesh well with functions that query for
missing arguments using js_gettop. Set their lengths to 0 instead.
Revert 'add context and flag argument to js_newstate' commit.
The context argument just adds clutter. The flag which was intended
for JS_DEBUG and/or JS_STRICT shouldn't be necessary.
js_newcfunction and js_newcconstructor need an extra argument, the
name of the function to use in stack traces.
Separate literal/interned and garbage collected string types in js_Value.
js_pushintern/js_tointern are convenience functions to push/pop strings and
automatically intern them (so that the string pointers are guaranteed to be
stable).
js_pushliteral should push stable strings (either interned or actual literals).
js_pushstring will copy the string into garbage collected memory.
The pointer returned by js_tostring is guaranteed to be stable only for as long as
the stack slot it came from remains untouched.
Some uses will always cause a string to be interned:
* Using it as a property name.
* Wrapping it in a new String() object.
* Strings returned by toString().
ToPrimitive must not clobber the stack, so the result has to be unrooted.
* Numbers converted to strings (by js_tostring)
Likewise, we have nowhere to store the temporary string here.
Passing in a scratch buffer to js_tostring could help this problem.
Mostly an issue with array accesses (OP_GETPROP, etc) so an auxiliary
function and we don't have to clutter the API needlessly.
A temporary measure, since POSIX regexes (a) don't have the same
syntax as javascript's regexes, and (b) don't work on UTF-8 (unless
the setlocale crap is configured correctly, and the implementation
supports it), and (c) doesn't work on windows.