File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Open diff view settings
Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Open diff view settings
Original file line number Diff line number Diff line change @@ -903,7 +903,8 @@ bool ContextifyScript::EvalMachine(Environment* env,
903903 if (!env->can_call_into_js ())
904904 return false ;
905905 if (!ContextifyScript::InstanceOf (env, args.Holder ())) {
906- env->ThrowTypeError (
906+ THROW_ERR_INVALID_THIS (
907+ env,
907908 " Script methods can only be called on script instances." );
908909 return false ;
909910 }
Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ void OnFatalError(const char* location, const char* message);
4040 V (ERR_INVALID_ARG_VALUE, TypeError) \
4141 V (ERR_OSSL_EVP_INVALID_DIGEST, Error) \
4242 V (ERR_INVALID_ARG_TYPE, TypeError) \
43+ V (ERR_INVALID_THIS, TypeError) \
4344 V (ERR_INVALID_TRANSFER_OBJECT, TypeError) \
4445 V (ERR_MEMORY_ALLOCATION_FAILED, Error) \
4546 V (ERR_MESSAGE_TARGET_CONTEXT_UNAVAILABLE, Error) \
@@ -94,6 +95,7 @@ void OnFatalError(const char* location, const char* message);
9495 V (ERR_CRYPTO_UNKNOWN_DH_GROUP, " Unknown DH group" ) \
9596 V (ERR_EXECUTION_ENVIRONMENT_NOT_AVAILABLE, \
9697 " Context not associated with Node.js environment" ) \
98+ V (ERR_INVALID_THIS, " Value of \" this\" is the wrong type" ) \
9799 V (ERR_INVALID_TRANSFER_OBJECT, " Found invalid object in transferList" ) \
98100 V (ERR_MEMORY_ALLOCATION_FAILED, " Failed to allocate memory" ) \
99101 V (ERR_OSSL_EVP_INVALID_DIGEST, " Invalid digest used" ) \
You can’t perform that action at this time.
0 commit comments