console = JS_GetOpaque(this_val, NGX_QJS_CLASS_ID_CONSOLE);
if (console == NULL) {
- return JS_ThrowInternalError(cx, "this is not a console object");
+ return JS_ThrowTypeError(cx, "this is not a console object");
}
if (console == (void *) 1) {
console = JS_GetOpaque(this_val, NGX_QJS_CLASS_ID_CONSOLE);
if (console == NULL) {
- return JS_ThrowInternalError(cx, "this is not a console object");
+ return JS_ThrowTypeError(cx, "this is not a console object");
}
if (!JS_IsUndefined(argv[0])) {
td = JS_GetOpaque(this_val, QJS_CORE_CLASS_ID_TEXT_DECODER);
if (td == NULL) {
- return JS_ThrowInternalError(cx, "'this' is not a TextDecoder");
+ return JS_ThrowTypeError(cx, "'this' is not a TextDecoder");
}
ret = qjs_typed_array_data(cx, argv[0], &data);
td = JS_GetOpaque(this_val, QJS_CORE_CLASS_ID_TEXT_DECODER);
if (td == NULL) {
- return JS_ThrowInternalError(ctx, "'this' is not a TextDecoder");
+ return JS_ThrowTypeError(ctx, "'this' is not a TextDecoder");
}
switch (td->encoding) {
td = JS_GetOpaque(this_val, QJS_CORE_CLASS_ID_TEXT_DECODER);
if (td == NULL) {
- return JS_ThrowInternalError(ctx, "'this' is not a TextDecoder");
+ return JS_ThrowTypeError(ctx, "'this' is not a TextDecoder");
}
return JS_NewBool(ctx, td->fatal);
td = JS_GetOpaque(this_val, QJS_CORE_CLASS_ID_TEXT_DECODER);
if (td == NULL) {
- return JS_ThrowInternalError(ctx, "'this' is not a TextDecoder");
+ return JS_ThrowTypeError(ctx, "'this' is not a TextDecoder");
}
return JS_NewBool(ctx, td->ignore_bom);
te = JS_GetOpaque(this_val, QJS_CORE_CLASS_ID_TEXT_ENCODER);
if (te == NULL) {
- return JS_ThrowInternalError(cx, "'this' is not a TextEncoder");
+ return JS_ThrowTypeError(cx, "'this' is not a TextEncoder");
}
if (!JS_IsString(argv[0])) {
te = JS_GetOpaque(this_val, QJS_CORE_CLASS_ID_TEXT_ENCODER);
if (te == NULL) {
- return JS_ThrowInternalError(cx, "'this' is not a TextEncoder");
+ return JS_ThrowTypeError(cx, "'this' is not a TextEncoder");
}
if (!JS_IsString(argv[0])) {