Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(166)

Unified Diff: src/debug/debug.js

Issue 1384443002: [es6] Fix missing bits for full @@toPrimitive support. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Remove useless cctest. Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/debug/debug.js
diff --git a/src/debug/debug.js b/src/debug/debug.js
index 2e51d4308894a052235ca01ff7f96ec0fe69fbe9..65fda72d3974c13cb47da2366dcbde92278ee477 100644
--- a/src/debug/debug.js
+++ b/src/debug/debug.js
@@ -22,15 +22,11 @@ var Mirror = global.Mirror;
var MirrorType;
var ParseInt = global.parseInt;
var ToBoolean;
-var ToNumber;
-var ToString;
var ValueMirror = global.ValueMirror;
utils.Import(function(from) {
MirrorType = from.MirrorType;
ToBoolean = from.ToBoolean;
- ToNumber = from.ToNumber;
- ToString = from.ToString;
});
//----------------------------------------------------------------------------
@@ -950,8 +946,8 @@ function ExecutionState(break_id) {
ExecutionState.prototype.prepareStep = function(opt_action, opt_count,
opt_callframe) {
var action = Debug.StepAction.StepIn;
- if (!IS_UNDEFINED(opt_action)) action = ToNumber(opt_action);
- var count = opt_count ? ToNumber(opt_count) : 1;
+ if (!IS_UNDEFINED(opt_action)) action = TO_NUMBER(opt_action);
+ var count = opt_count ? TO_NUMBER(opt_count) : 1;
var callFrameId = 0;
if (!IS_UNDEFINED(opt_callframe)) {
callFrameId = opt_callframe.details_.frameId();
@@ -985,7 +981,7 @@ ExecutionState.prototype.frame = function(opt_index) {
};
ExecutionState.prototype.setSelectedFrame = function(index) {
- var i = ToNumber(index);
+ var i = TO_NUMBER(index);
if (i < 0 || i >= this.frameCount()) {
throw MakeTypeError(kDebuggerFrame);
}
@@ -1432,7 +1428,7 @@ DebugCommandProcessor.prototype.processDebugJSONRequest = function(
response = this.createResponse();
}
response.success = false;
- response.message = ToString(e);
+ response.message = TO_STRING(e);
}
// Return the response as a JSON encoded string.
@@ -1449,7 +1445,7 @@ DebugCommandProcessor.prototype.processDebugJSONRequest = function(
'"request_seq":' + request.seq + ',' +
'"type":"response",' +
'"success":false,' +
- '"message":"Internal error: ' + ToString(e) + '"}';
+ '"message":"Internal error: ' + TO_STRING(e) + '"}';
}
} catch (e) {
// Failed in one of the catch blocks above - most generic error.
@@ -1470,7 +1466,7 @@ DebugCommandProcessor.prototype.continueRequest_ = function(request, response) {
// Get the stepcount argument if any.
if (stepcount) {
- count = ToNumber(stepcount);
+ count = TO_NUMBER(stepcount);
if (count < 0) {
throw MakeError(kDebugger,
'Invalid stepcount argument "' + stepcount + '".');
@@ -1545,7 +1541,7 @@ DebugCommandProcessor.prototype.setBreakPointRequest_ =
// Find the function through a global evaluate.
f = this.exec_state_.evaluateGlobal(target).value();
} catch (e) {
- response.failed('Error: "' + ToString(e) +
+ response.failed('Error: "' + TO_STRING(e) +
'" evaluating "' + target + '"');
return;
}
@@ -1634,7 +1630,7 @@ DebugCommandProcessor.prototype.changeBreakPointRequest_ = function(
}
// Pull out arguments.
- var break_point = ToNumber(request.arguments.breakpoint);
+ var break_point = TO_NUMBER(request.arguments.breakpoint);
var enabled = request.arguments.enabled;
var condition = request.arguments.condition;
var ignoreCount = request.arguments.ignoreCount;
@@ -1710,7 +1706,7 @@ DebugCommandProcessor.prototype.clearBreakPointRequest_ = function(
}
// Pull out arguments.
- var break_point = ToNumber(request.arguments.breakpoint);
+ var break_point = TO_NUMBER(request.arguments.breakpoint);
// Check for legal arguments.
if (!break_point) {
@@ -1968,7 +1964,7 @@ DebugCommandProcessor.prototype.scopeRequest_ = function(request, response) {
// With no scope argument just return top scope.
var scope_index = 0;
if (request.arguments && !IS_UNDEFINED(request.arguments.number)) {
- scope_index = ToNumber(request.arguments.number);
+ scope_index = TO_NUMBER(request.arguments.number);
if (scope_index < 0 || scope_holder.scopeCount() <= scope_index) {
return response.failed('Invalid scope number');
}
@@ -1994,9 +1990,9 @@ DebugCommandProcessor.resolveValue_ = function(value_description) {
if (value_description.type == MirrorType.BOOLEAN_TYPE) {
return ToBoolean(value_description.stringDescription);
} else if (value_description.type == MirrorType.NUMBER_TYPE) {
- return ToNumber(value_description.stringDescription);
+ return TO_NUMBER(value_description.stringDescription);
} if (value_description.type == MirrorType.STRING_TYPE) {
- return ToString(value_description.stringDescription);
+ return TO_STRING(value_description.stringDescription);
} else {
throw MakeError(kDebugger, "Unknown type");
}
@@ -2032,7 +2028,7 @@ DebugCommandProcessor.prototype.setVariableValueRequest_ =
if (IS_UNDEFINED(scope_description.number)) {
response.failed('Missing scope number');
}
- var scope_index = ToNumber(scope_description.number);
+ var scope_index = TO_NUMBER(scope_description.number);
var scope = scope_holder.scope(scope_index);
@@ -2064,7 +2060,7 @@ DebugCommandProcessor.prototype.evaluateRequest_ = function(request, response) {
// The expression argument could be an integer so we convert it to a
// string.
try {
- expression = ToString(expression);
+ expression = TO_STRING(expression);
} catch(e) {
return response.failed('Failed to convert expression argument to string');
}
@@ -2110,7 +2106,7 @@ DebugCommandProcessor.prototype.evaluateRequest_ = function(request, response) {
// Check whether a frame was specified.
if (!IS_UNDEFINED(frame)) {
- var frame_number = ToNumber(frame);
+ var frame_number = TO_NUMBER(frame);
if (frame_number < 0 || frame_number >= this.exec_state_.frameCount()) {
return response.failed('Invalid frame "' + frame + '"');
}
@@ -2210,7 +2206,7 @@ DebugCommandProcessor.prototype.sourceRequest_ = function(request, response) {
to_line = request.arguments.toLine;
if (!IS_UNDEFINED(request.arguments.frame)) {
- var frame_number = ToNumber(request.arguments.frame);
+ var frame_number = TO_NUMBER(request.arguments.frame);
if (frame_number < 0 || frame_number >= this.exec_state_.frameCount()) {
return response.failed('Invalid frame "' + frame + '"');
}
@@ -2246,7 +2242,7 @@ DebugCommandProcessor.prototype.scriptsRequest_ = function(request, response) {
if (request.arguments) {
// Pull out arguments.
if (!IS_UNDEFINED(request.arguments.types)) {
- types = ToNumber(request.arguments.types);
+ types = TO_NUMBER(request.arguments.types);
if (IsNaN(types) || types < 0) {
return response.failed('Invalid types "' +
request.arguments.types + '"');
@@ -2269,7 +2265,7 @@ DebugCommandProcessor.prototype.scriptsRequest_ = function(request, response) {
var filterStr = null;
var filterNum = null;
if (!IS_UNDEFINED(request.arguments.filter)) {
- var num = ToNumber(request.arguments.filter);
+ var num = TO_NUMBER(request.arguments.filter);
if (!IsNaN(num)) {
filterNum = num;
}
@@ -2405,7 +2401,7 @@ DebugCommandProcessor.prototype.restartFrameRequest_ = function(
var frame_mirror;
// Check whether a frame was specified.
if (!IS_UNDEFINED(frame)) {
- var frame_number = ToNumber(frame);
+ var frame_number = TO_NUMBER(frame);
if (frame_number < 0 || frame_number >= this.exec_state_.frameCount()) {
return response.failed('Invalid frame "' + frame + '"');
}
« no previous file with comments | « src/date.js ('k') | src/debug/mirrors.js » ('j') | test/cctest/compiler/test-run-jscalls.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698