runtime/globals/streams/
mod.rs

1/*
2 * This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
5 */
6
7use ion::{ClassDefinition as _, Context, Object};
8
9use crate::globals::streams::readable::{
10	ByobReader, ByobRequest, ByteStreamController, CommonController, CommonReader, DefaultController, DefaultReader,
11	ReadableStream,
12};
13use crate::globals::streams::strategy::{ByteLengthQueuingStrategy, CountQueuingStrategy};
14
15pub mod readable;
16mod strategy;
17
18pub fn define<'cx>(cx: &'cx Context, global: &'cx Object) -> bool {
19	let dummy = Object::new(cx);
20	ReadableStream::init_class(cx, global).0
21		&& CommonController::init_class(cx, &dummy).0
22		&& ByteStreamController::init_class(cx, global).0
23		&& DefaultController::init_class(cx, global).0
24		&& ByobRequest::init_class(cx, global).0
25		&& CommonReader::init_class(cx, &dummy).0
26		&& DefaultReader::init_class(cx, global).0
27		&& ByobReader::init_class(cx, global).0
28		&& ByteLengthQueuingStrategy::init_class(cx, global).0
29		&& CountQueuingStrategy::init_class(cx, global).0
30}