From 6eb5e00e06594fb8110104160279838a65249e53 Mon Sep 17 00:00:00 2001 From: Weixie Cui Date: Fri, 27 Mar 2026 14:30:08 +0800 Subject: [PATCH] Fix Date.prototype.toLocaleString() TypeError message for non-Date this datePrototypeToLocaleStringHelper reported toString() in the error string; align it with the actual method name. --- lib/VM/JSLib/Date.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/VM/JSLib/Date.cpp b/lib/VM/JSLib/Date.cpp index b5011da8e69..c90e81b77ff 100644 --- a/lib/VM/JSLib/Date.cpp +++ b/lib/VM/JSLib/Date.cpp @@ -619,7 +619,7 @@ CallResult datePrototypeToLocaleStringHelper( auto *date = dyn_vmcast(args.getThisArg()); if (!date) { return runtime.raiseTypeError( - "Date.prototype.toString() called on non-Date object"); + "Date.prototype.toLocaleString() called on non-Date object"); } double t = date->getPrimitiveValue(); if (!std::isfinite(t)) {