From 94e96bb8cb68455e4739ce34ee619598bc561668 Mon Sep 17 00:00:00 2001 From: Chris Peterson Date: Sun, 24 Nov 2013 21:56:20 -0800 Subject: [PATCH] Bug 784295 - Part 1: Compile self-hosted JS in strict mode (in DEBUG builds). r=till --- js/src/builtin/TypedObject.js | 2 +- js/src/vm/SelfHosting.cpp | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/js/src/builtin/TypedObject.js b/js/src/builtin/TypedObject.js index 99162d28e6e..921f4aeacc1 100644 --- a/js/src/builtin/TypedObject.js +++ b/js/src/builtin/TypedObject.js @@ -664,7 +664,7 @@ function X4ProtoString(type) { assert(false, "Unhandled type constant"); } -X4LaneStrings = ["x", "y", "z", "w"]; +var X4LaneStrings = ["x", "y", "z", "w"]; // Generalized handler for the various properties for accessing a // single lane of an X4 vector value. Note that this is the slow path; diff --git a/js/src/vm/SelfHosting.cpp b/js/src/vm/SelfHosting.cpp index 7a4f77a1ae9..11fe7672de0 100644 --- a/js/src/vm/SelfHosting.cpp +++ b/js/src/vm/SelfHosting.cpp @@ -779,6 +779,11 @@ JSRuntime::initSelfHosting(JSContext *cx) options.setCanLazilyParse(false); options.setSourcePolicy(CompileOptions::NO_SOURCE); options.setVersion(JSVERSION_LATEST); + options.werrorOption = true; + +#ifdef DEBUG + options.strictOption = true; +#endif /* * Set a temporary error reporter printing to stderr because it is too