From 1fa5a6ab37499fdc4e6eff825ff2b36f263ad994 Mon Sep 17 00:00:00 2001 From: mccabe Date: Wed, 29 Apr 1998 23:52:40 +0000 Subject: [PATCH] Fixed error message associated with trying to use a keyword as an identifier; it was only printing the first character of the identifier, because it expected 8-bit chars, and was being called with a 16-bit representation of the offending keyword. --- js/ref/jsparse.c | 7 ++++--- js/src/jsparse.c | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/js/ref/jsparse.c b/js/ref/jsparse.c index aaa12ddee64a..4d4c31ea9489 100644 --- a/js/ref/jsparse.c +++ b/js/ref/jsparse.c @@ -2333,9 +2333,10 @@ PrimaryExpr(JSContext *cx, JSTokenStream *ts, JSTreeContext *tc) case TOK_IMPORT: #endif case TOK_RESERVED: - js_ReportCompileError(cx, ts, "%.*s is a reserved identifier", - ts->token.pos.end.index - ts->token.pos.begin.index, - ts->token.ptr); + js_ReportCompileError(cx, ts, "%s is a reserved identifier", + js_DeflateString(cx, ts->token.ptr, + ts->token.pos.end.index - + ts->token.pos.begin.index)); return NULL; case TOK_ERROR: diff --git a/js/src/jsparse.c b/js/src/jsparse.c index 64dbd4ff6773..f97d132a3148 100644 --- a/js/src/jsparse.c +++ b/js/src/jsparse.c @@ -2337,9 +2337,10 @@ PrimaryExpr(JSContext *cx, JSTokenStream *ts, JSTreeContext *tc) case TOK_IMPORT: #endif case TOK_RESERVED: - js_ReportCompileError(cx, ts, "%.*s is a reserved identifier", - ts->token.pos.end.index - ts->token.pos.begin.index, - ts->token.ptr); + js_ReportCompileError(cx, ts, "%s is a reserved identifier", + js_DeflateString(cx, ts->token.ptr, + ts->token.pos.end.index - + ts->token.pos.begin.index)); return NULL; case TOK_ERROR: