diff --git a/js/src/js.msg b/js/src/js.msg index f02bd06ab8e..028555c226b 100644 --- a/js/src/js.msg +++ b/js/src/js.msg @@ -371,3 +371,4 @@ MSG_DEF(JSMSG_DEBUG_NOT_DEBUGGING, 284, 0, JSEXN_ERR, "can't set breakpoint: MSG_DEF(JSMSG_DEBUG_COMPARTMENT_MISMATCH, 285, 2, JSEXN_TYPEERR, "{0}: descriptor .{1} property is an object in a different compartment than the target object") MSG_DEF(JSMSG_DEBUG_NOT_SCRIPT_FRAME, 286, 0, JSEXN_ERR, "stack frame is not running JavaScript code") MSG_DEF(JSMSG_CANT_WATCH_PROP, 287, 0, JSEXN_TYPEERR, "properties whose names are objects can't be watched") +MSG_DEF(JSMSG_CSP_BLOCKED_EVAL, 288, 0, JSEXN_ERR, "call to eval() blocked by CSP") diff --git a/js/src/jsobj.cpp b/js/src/jsobj.cpp index 9137a2c1109..c55dde5b12c 100644 --- a/js/src/jsobj.cpp +++ b/js/src/jsobj.cpp @@ -1154,7 +1154,7 @@ EvalKernel(JSContext *cx, const CallArgs &args, EvalType evalType, StackFrame *c AssertInnerizedScopeChain(cx, scopeobj); if (!scopeobj.getGlobal()->isRuntimeCodeGenEnabled(cx)) { - JS_ReportError(cx, "call to eval() blocked by CSP"); + JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, JSMSG_CSP_BLOCKED_EVAL); return false; }