From 45f1330425b671905a02fe30ee7a1dd9544c2709 Mon Sep 17 00:00:00 2001 From: Julien Gilli Date: Fri, 28 Nov 2014 15:33:45 -0800 Subject: [PATCH] deps: backport b593aa8 from v8 upstream Original commit message: Enable "strict mode"; for debugger scripts BUG=v8:3708 Review URL: https://codereview.chromium.org/736583007 Cr-Commit-Position: refs/heads/master@{#25420} --- deps/v8/src/debug-debugger.js | 5 +++-- deps/v8/src/mirror-debugger.js | 9 +++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/deps/v8/src/debug-debugger.js b/deps/v8/src/debug-debugger.js index a27961fa4606b6..be39c491b6d27a 100644 --- a/deps/v8/src/debug-debugger.js +++ b/deps/v8/src/debug-debugger.js @@ -24,6 +24,7 @@ // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +"use strict"; // Default number of frames to include in the response to backtrace request. var kDefaultBacktraceLength = 10; @@ -677,7 +678,7 @@ Debug.setBreakPoint = function(func, opt_line, opt_column, opt_condition) { Debug.setBreakPointByScriptIdAndPosition = function(script_id, position, condition, enabled) { - break_point = MakeBreakPoint(position); + var break_point = MakeBreakPoint(position); break_point.setCondition(condition); if (!enabled) { break_point.disable(); @@ -742,7 +743,7 @@ Debug.clearBreakPoint = function(break_point_number) { Debug.clearAllBreakPoints = function() { for (var i = 0; i < break_points.length; i++) { - break_point = break_points[i]; + var break_point = break_points[i]; %ClearBreakPoint(break_point); } break_points = []; diff --git a/deps/v8/src/mirror-debugger.js b/deps/v8/src/mirror-debugger.js index 7f1a05aed9479e..6bec59bcb3e437 100644 --- a/deps/v8/src/mirror-debugger.js +++ b/deps/v8/src/mirror-debugger.js @@ -24,6 +24,7 @@ // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +"use strict"; // Handle id counters. var next_handle_ = 0; @@ -55,7 +56,7 @@ function MakeMirror(value, opt_transient) { // Look for non transient mirrors in the mirror cache. if (!opt_transient) { - for (id in mirror_cache_) { + for (var id in mirror_cache_) { mirror = mirror_cache_[id]; if (mirror.value() === value) { return mirror; @@ -1154,11 +1155,11 @@ ErrorMirror.prototype.toText = function() { // Use the same text representation as in messages.js. var text; try { - str = %_CallFunction(this.value_, builtins.ErrorToString); + text = %_CallFunction(this.value_, builtins.ErrorToString); } catch (e) { - str = '#'; + text = '#'; } - return str; + return text; };