summaryrefslogtreecommitdiff
path: root/js/src/builtin/TestingFunctions.cpp
diff options
context:
space:
mode:
authorBrian Smith <brian@dbsoft.org>2023-09-27 16:00:10 -0500
committerBrian Smith <brian@dbsoft.org>2023-09-27 16:00:10 -0500
commit8ce17f02ee4d9b40a576911c4bb82fa4802fb167 (patch)
treefa990df784d806638e9ac030b491c9af942c4b5c /js/src/builtin/TestingFunctions.cpp
parent582fd0dd81af880f7f71dfb1fc9e7f8df448a56e (diff)
downloaduxp-8ce17f02ee4d9b40a576911c4bb82fa4802fb167.tar.gz
Issue #1442 - Part 3: Implement ReadableStream and associated classes in the JS engine.
https://bugzilla.mozilla.org/show_bug.cgi?id=1272697
Diffstat (limited to 'js/src/builtin/TestingFunctions.cpp')
-rw-r--r--js/src/builtin/TestingFunctions.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/js/src/builtin/TestingFunctions.cpp b/js/src/builtin/TestingFunctions.cpp
index 2608733853..f7af8b6fe9 100644
--- a/js/src/builtin/TestingFunctions.cpp
+++ b/js/src/builtin/TestingFunctions.cpp
@@ -1441,6 +1441,14 @@ RejectPromise(JSContext* cx, unsigned argc, Value* vp)
return result;
}
+static bool
+StreamsAreEnabled(JSContext* cx, unsigned argc, Value* vp)
+{
+ CallArgs args = CallArgsFromVp(argc, vp);
+ args.rval().setBoolean(cx->options().streams());
+ return true;
+}
+
static unsigned finalizeCount = 0;
static void
@@ -4144,6 +4152,10 @@ JS_FN_HELP("rejectPromise", RejectPromise, 2, 0,
"rejectPromise(promise, reason)",
" Reject a Promise by calling the JSAPI function JS::RejectPromise."),
+JS_FN_HELP("streamsAreEnabled", StreamsAreEnabled, 0, 0,
+"streamsAreEnabled()",
+" Returns a boolean indicating whether WHATWG Streams are enabled for the current compartment."),
+
JS_FN_HELP("makeFinalizeObserver", MakeFinalizeObserver, 0, 0,
"makeFinalizeObserver()",
" Get a special object whose finalization increases the counter returned\n"