diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:43:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:43:14 +0000 |
commit | 8dd16259287f58f9273002717ec4d27e97127719 (patch) | |
tree | 3863e62a53829a84037444beab3abd4ed9dfc7d0 /js/src/jsapi-tests/testFrontendJSON.cpp | |
parent | Releasing progress-linux version 126.0.1-1~progress7.99u1. (diff) | |
download | firefox-8dd16259287f58f9273002717ec4d27e97127719.tar.xz firefox-8dd16259287f58f9273002717ec4d27e97127719.zip |
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'js/src/jsapi-tests/testFrontendJSON.cpp')
-rw-r--r-- | js/src/jsapi-tests/testFrontendJSON.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/js/src/jsapi-tests/testFrontendJSON.cpp b/js/src/jsapi-tests/testFrontendJSON.cpp index b5315e6084..0960a8025a 100644 --- a/js/src/jsapi-tests/testFrontendJSON.cpp +++ b/js/src/jsapi-tests/testFrontendJSON.cpp @@ -472,6 +472,29 @@ BEGIN_FRONTEND_TEST(testParseJSONWithHandler) { checkedLast = true; } + { + const size_t failAt = 1; + MyHandler handler; + const char16_t* source; + +#define IMMEDIATE_FAIL(json) \ + handler.failAt.emplace(failAt); \ + source = json; \ + CHECK(!JS::ParseJSONWithHandler( \ + source, std::char_traits<char16_t>::length(source), &handler)); \ + CHECK(handler.events.length() == failAt); \ + handler.events.clear(); + + IMMEDIATE_FAIL(u"{"); + IMMEDIATE_FAIL(u"["); + IMMEDIATE_FAIL(u"\"string\""); + IMMEDIATE_FAIL(u"1"); + IMMEDIATE_FAIL(u"true"); + IMMEDIATE_FAIL(u"null"); + +#undef IMMEDIATE_FAIL + } + return true; } |