Skip to content

Commit

Permalink
feat(api): implemented UnderlyingSource
Browse files Browse the repository at this point in the history
  • Loading branch information
xavierm02 committed Dec 6, 2023
1 parent 55640b7 commit b12ebc5
Show file tree
Hide file tree
Showing 4 changed files with 424 additions and 1 deletion.
1 change: 1 addition & 0 deletions crates/jstz_api/src/stream/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use boa_engine::Context;
use self::readable::ReadableStreamApi;

pub mod readable;
mod tmp;

pub struct StreamApi;

Expand Down
10 changes: 9 additions & 1 deletion crates/jstz_api/src/stream/readable/mod.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
use boa_engine::{Context, JsResult};
use boa_engine::{value::TryFromJs, Context, JsArgs, JsResult};
use boa_gc::{custom_trace, Finalize, Trace};
use jstz_core::native::{
register_global_class, ClassBuilder, JsNativeObject, NativeClass,
};

use crate::stream::readable::underlying_source::{
UnderlyingSource, UnderlyingSourceTrait,
};

pub mod underlying_source;

pub struct ReadableStream {
// TODO
}
Expand All @@ -30,6 +36,8 @@ impl NativeClass for ReadableStreamClass {
args: &[boa_engine::JsValue],
context: &mut Context<'_>,
) -> JsResult<Self::Instance> {
let underlying_source =
Option::<UnderlyingSource>::try_from_js(args.get_or_undefined(0), context)?;
todo!()
}

Expand Down
Loading

0 comments on commit b12ebc5

Please sign in to comment.