Reviewers: Yang,
Description:
Enable "strict mode"; for debugger scripts
BUG=v8:3708
Please review this at https://codereview.chromium.org/736583007/
Base URL: https://chromium.googlesource.com/v8/v8.git@master
Affected files (+8, -6 lines):
M src/debug-debugger.js
M src/mirror-debugger.js
Index: src/debug-debugger.js
diff --git a/src/debug-debugger.js b/src/debug-debugger.js
index
9be2b044d31647b30f04c164d7f83c487e9a3145..09f479e1e8b6814aca5927c1f14ca353f20edf62
100644
--- a/src/debug-debugger.js
+++ b/src/debug-debugger.js
@@ -1,6 +1,7 @@
// Copyright 2012 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+"use strict";
// Default number of frames to include in the response to backtrace
request.
var kDefaultBacktraceLength = 10;
@@ -672,7 +673,7 @@ Debug.setBreakPointByScriptIdAndPosition =
function(script_id, position,
condition, enabled,
opt_position_alignment)
{
- break_point = MakeBreakPoint(position);
+ var break_point = MakeBreakPoint(position);
break_point.setCondition(condition);
if (!enabled) {
break_point.disable();
@@ -739,7 +740,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 = [];
Index: src/mirror-debugger.js
diff --git a/src/mirror-debugger.js b/src/mirror-debugger.js
index
7306c1bb5d1fdc3bc1195d5e9ffcc157198d9a1e..bbd43da8789c0dd125eb3685a0534c22b3f19570
100644
--- a/src/mirror-debugger.js
+++ b/src/mirror-debugger.js
@@ -1,6 +1,7 @@
// Copyright 2006-2012 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+"use strict";
// Handle id counters.
var next_handle_ = 0;
@@ -44,7 +45,7 @@ function MakeMirror(value, opt_transient) {
// Look for non transient mirrors in the mirror cache.
if (!opt_transient && mirror_cache_enabled_) {
- for (id in mirror_cache_) {
+ for (var id in mirror_cache_) {
mirror = mirror_cache_[id];
if (mirror.value() === value) {
return mirror;
@@ -1288,11 +1289,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 = '#<Error>';
+ text = '#<Error>';
}
- return str;
+ return text;
};
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.