@@ -3,6 +3,7 @@ use crate::descriptor::{Descriptor, VectorKind};
3
3
use crate :: { Bindgen , EncodeInto , OutputMode } ;
4
4
use failure:: { bail, Error , ResultExt } ;
5
5
use std:: collections:: { HashMap , HashSet } ;
6
+ use std:: env;
6
7
use walrus:: { MemoryId , Module } ;
7
8
use wasm_bindgen_wasm_interpreter:: Interpreter ;
8
9
@@ -2797,11 +2798,14 @@ impl<'a, 'b> SubContext<'a, 'b> {
2797
2798
// module syntax in the snippet to a CommonJS module, which is in theory
2798
2799
// not that hard but is a chunk of work to do.
2799
2800
if is_local_snippet && self . cx . config . mode . nodejs ( ) {
2800
- bail ! (
2801
- "local JS snippets are not supported with `--nodejs`; \
2802
- see rustwasm/rfcs#6 for more details, but this restriction \
2803
- will be lifted in the future"
2804
- ) ;
2801
+ // have a small unergonomic escape hatch for our webidl-tests tests
2802
+ if env:: var ( "WBINDGEN_I_PROMISE_JS_SYNTAX_WORKS_IN_NODE" ) . is_err ( ) {
2803
+ bail ! (
2804
+ "local JS snippets are not supported with `--nodejs`; \
2805
+ see rustwasm/rfcs#6 for more details, but this restriction \
2806
+ will be lifted in the future"
2807
+ ) ;
2808
+ }
2805
2809
}
2806
2810
2807
2811
// Similar to `--no-modules`, only allow vendor prefixes basically for web
0 commit comments