Remove ES_NEXT macro (#4915)
- remove all '#JERRY_ESNEXT' macro - remove 5.1 build profile, update test runner accordingly (Note: all builtins are turn on by default) - move tests from tests/jerry/esnext into tests/jerry, concatenate files with same names - add skiplist to some snapshot tests that were supported only in 5.1 - fix doxygen issues that were hidden before (bc. of es.next macro) Co-authored-by: Martin Negyokru negyokru@inf.u-szeged.hu JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
This commit is contained in:
@@ -219,3 +219,54 @@ assert (JSON.stringify ({"key1": false, "key2": 12}, ["key1"], "abc") === '{\nab
|
||||
assert (JSON.stringify ({"key1": false, "key2": 12}, ["key2"], "abc") === '{\nabc"key2": 12\n}');
|
||||
assert (JSON.stringify ({"key1": false, "key2": 12}, ["key1", "key2"], "abc") === '{\nabc"key1": false,\nabc"key2": 12\n}');
|
||||
assert (JSON.stringify ({"key1": false, "key2": 12}, ["key", "key3"], "abc") === '{}');
|
||||
|
||||
// Test with proxy
|
||||
assert(JSON.stringify(new Proxy(['foo'], {})) === '["foo"]');
|
||||
assert(JSON.stringify(new Proxy({0:"foo"}, {})) === '{"0":"foo"}');
|
||||
|
||||
var target = [1,2,3];
|
||||
var handler = {
|
||||
get(target, prop) {
|
||||
if (prop == "length")
|
||||
{
|
||||
throw 42;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
JSON.stringify(new Proxy(target,handler));
|
||||
assert(false);
|
||||
} catch (e) {
|
||||
assert(e === 42);
|
||||
}
|
||||
|
||||
var revocable = Proxy.revocable (target, { get (t, p , r) {
|
||||
if (p == "toJSON") {
|
||||
revocable.revoke();
|
||||
}
|
||||
}});
|
||||
var proxy = revocable.proxy;
|
||||
|
||||
try {
|
||||
JSON.stringify(proxy);
|
||||
assert(false);
|
||||
} catch (e) {
|
||||
assert(e instanceof TypeError);
|
||||
}
|
||||
|
||||
// Checking quoting strings
|
||||
assert(JSON.stringify("ab𬄕c") === '"ab𬄕\\u001fc"');
|
||||
assert(JSON.stringify("ab\uDC01cd") === '"ab\\udc01c\\u001fd"');
|
||||
assert(JSON.stringify("ab\uDC01cd\uD8331e") === '"ab\\udc01c\\u001fd\\ud8331e"');
|
||||
|
||||
// Test case where the proxy is already revoked
|
||||
var handle = Proxy.revocable([], {});
|
||||
handle.revoke();
|
||||
|
||||
try {
|
||||
JSON.stringify(handle.proxy);
|
||||
assert(false);
|
||||
} catch (ex) {
|
||||
assert(ex instanceof TypeError);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user