File tree Expand file tree Collapse file tree
Polyfills/TextDecoder/Source Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -35,8 +35,7 @@ namespace
3535 auto encoding = info[0 ].As <Napi::String>().Utf8Value ();
3636 if (encoding != " utf-8" && encoding != " UTF-8" )
3737 {
38- Napi::Error::New (info.Env (), " TextDecoder: unsupported encoding '" + encoding + " ', only 'utf-8' is supported" )
39- .ThrowAsJavaScriptException ();
38+ throw Napi::Error::New (Env (), " TextDecoder: unsupported encoding '" + encoding + " ', only 'utf-8' is supported" );
4039 }
4140 }
4241 }
@@ -75,9 +74,7 @@ namespace
7574 }
7675 else
7776 {
78- Napi::TypeError::New (info.Env (), " TextDecoder.decode: input must be a BufferSource (ArrayBuffer or TypedArray)" )
79- .ThrowAsJavaScriptException ();
80- return info.Env ().Undefined ();
77+ throw Napi::TypeError::New (Env (), " TextDecoder.decode: input must be a BufferSource (ArrayBuffer or TypedArray)" );
8178 }
8279
8380 return Napi::String::New (info.Env (), data);
You can’t perform that action at this time.
0 commit comments