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

Side by Side Diff: src/debug-debugger.js

Issue 1126213002: Wrap runtime.js in a function. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix Created 5 years, 7 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 unified diff | Download patch
« no previous file with comments | « src/date.js ('k') | src/harmony-array.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 "use strict"; 4 "use strict";
5 5
6 // Default number of frames to include in the response to backtrace request. 6 // Default number of frames to include in the response to backtrace request.
7 var kDefaultBacktraceLength = 10; 7 var kDefaultBacktraceLength = 10;
8 8
9 var Debug = {}; 9 var Debug = {};
10 10
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 BreakPoint.prototype.isTriggered = function(exec_state) { 195 BreakPoint.prototype.isTriggered = function(exec_state) {
196 // Break point not active - not triggered. 196 // Break point not active - not triggered.
197 if (!this.active()) return false; 197 if (!this.active()) return false;
198 198
199 // Check for conditional break point. 199 // Check for conditional break point.
200 if (this.condition()) { 200 if (this.condition()) {
201 // If break point has condition try to evaluate it in the top frame. 201 // If break point has condition try to evaluate it in the top frame.
202 try { 202 try {
203 var mirror = exec_state.frame(0).evaluate(this.condition()); 203 var mirror = exec_state.frame(0).evaluate(this.condition());
204 // If no sensible mirror or non true value break point not triggered. 204 // If no sensible mirror or non true value break point not triggered.
205 if (!(mirror instanceof ValueMirror) || !%ToBoolean(mirror.value_)) { 205 if (!(mirror instanceof ValueMirror) ||
206 !builtins.$toBoolean(mirror.value_)) {
206 return false; 207 return false;
207 } 208 }
208 } catch (e) { 209 } catch (e) {
209 // Exception evaluating condition counts as not triggered. 210 // Exception evaluating condition counts as not triggered.
210 return false; 211 return false;
211 } 212 }
212 } 213 }
213 214
214 // Update the hit count. 215 // Update the hit count.
215 this.hit_count_++; 216 this.hit_count_++;
(...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after
917 } 918 }
918 919
919 function ExecutionState(break_id) { 920 function ExecutionState(break_id) {
920 this.break_id = break_id; 921 this.break_id = break_id;
921 this.selected_frame = 0; 922 this.selected_frame = 0;
922 } 923 }
923 924
924 ExecutionState.prototype.prepareStep = function(opt_action, opt_count, 925 ExecutionState.prototype.prepareStep = function(opt_action, opt_count,
925 opt_callframe) { 926 opt_callframe) {
926 var action = Debug.StepAction.StepIn; 927 var action = Debug.StepAction.StepIn;
927 if (!IS_UNDEFINED(opt_action)) action = %ToNumber(opt_action); 928 if (!IS_UNDEFINED(opt_action)) action = builtins.$toNumber(opt_action);
928 var count = opt_count ? %ToNumber(opt_count) : 1; 929 var count = opt_count ? builtins.$toNumber(opt_count) : 1;
929 var callFrameId = 0; 930 var callFrameId = 0;
930 if (!IS_UNDEFINED(opt_callframe)) { 931 if (!IS_UNDEFINED(opt_callframe)) {
931 callFrameId = opt_callframe.details_.frameId(); 932 callFrameId = opt_callframe.details_.frameId();
932 } 933 }
933 934
934 return %PrepareStep(this.break_id, action, count, callFrameId); 935 return %PrepareStep(this.break_id, action, count, callFrameId);
935 }; 936 };
936 937
937 ExecutionState.prototype.evaluateGlobal = function(source, disable_break, 938 ExecutionState.prototype.evaluateGlobal = function(source, disable_break,
938 opt_additional_context) { 939 opt_additional_context) {
(...skipping 13 matching lines...) Expand all
952 ExecutionState.prototype.frame = function(opt_index) { 953 ExecutionState.prototype.frame = function(opt_index) {
953 // If no index supplied return the selected frame. 954 // If no index supplied return the selected frame.
954 if (opt_index == null) opt_index = this.selected_frame; 955 if (opt_index == null) opt_index = this.selected_frame;
955 if (opt_index < 0 || opt_index >= this.frameCount()) { 956 if (opt_index < 0 || opt_index >= this.frameCount()) {
956 throw new Error('Illegal frame index.'); 957 throw new Error('Illegal frame index.');
957 } 958 }
958 return new FrameMirror(this.break_id, opt_index); 959 return new FrameMirror(this.break_id, opt_index);
959 }; 960 };
960 961
961 ExecutionState.prototype.setSelectedFrame = function(index) { 962 ExecutionState.prototype.setSelectedFrame = function(index) {
962 var i = %ToNumber(index); 963 var i = builtins.$toNumber(index);
963 if (i < 0 || i >= this.frameCount()) throw new Error('Illegal frame index.'); 964 if (i < 0 || i >= this.frameCount()) throw new Error('Illegal frame index.');
964 this.selected_frame = i; 965 this.selected_frame = i;
965 }; 966 };
966 967
967 ExecutionState.prototype.selectedFrame = function() { 968 ExecutionState.prototype.selectedFrame = function() {
968 return this.selected_frame; 969 return this.selected_frame;
969 }; 970 };
970 971
971 ExecutionState.prototype.debugCommandProcessor = function(opt_is_running) { 972 ExecutionState.prototype.debugCommandProcessor = function(opt_is_running) {
972 return new DebugCommandProcessor(this, opt_is_running); 973 return new DebugCommandProcessor(this, opt_is_running);
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after
1395 %_CallFunction(this, request, response, handler); 1396 %_CallFunction(this, request, response, handler);
1396 } else { 1397 } else {
1397 throw new Error('Unknown command "' + request.command + '" in request'); 1398 throw new Error('Unknown command "' + request.command + '" in request');
1398 } 1399 }
1399 } catch (e) { 1400 } catch (e) {
1400 // If there is no response object created one (without command). 1401 // If there is no response object created one (without command).
1401 if (!response) { 1402 if (!response) {
1402 response = this.createResponse(); 1403 response = this.createResponse();
1403 } 1404 }
1404 response.success = false; 1405 response.success = false;
1405 response.message = %ToString(e); 1406 response.message = builtins.$toString(e);
1406 } 1407 }
1407 1408
1408 // Return the response as a JSON encoded string. 1409 // Return the response as a JSON encoded string.
1409 try { 1410 try {
1410 if (!IS_UNDEFINED(response.running)) { 1411 if (!IS_UNDEFINED(response.running)) {
1411 // Response controls running state. 1412 // Response controls running state.
1412 this.running_ = response.running; 1413 this.running_ = response.running;
1413 } 1414 }
1414 response.running = this.running_; 1415 response.running = this.running_;
1415 return response.toJSONProtocol(); 1416 return response.toJSONProtocol();
1416 } catch (e) { 1417 } catch (e) {
1417 // Failed to generate response - return generic error. 1418 // Failed to generate response - return generic error.
1418 return '{"seq":' + response.seq + ',' + 1419 return '{"seq":' + response.seq + ',' +
1419 '"request_seq":' + request.seq + ',' + 1420 '"request_seq":' + request.seq + ',' +
1420 '"type":"response",' + 1421 '"type":"response",' +
1421 '"success":false,' + 1422 '"success":false,' +
1422 '"message":"Internal error: ' + %ToString(e) + '"}'; 1423 '"message":"Internal error: ' + builtins.$toString(e) + '"}';
1423 } 1424 }
1424 } catch (e) { 1425 } catch (e) {
1425 // Failed in one of the catch blocks above - most generic error. 1426 // Failed in one of the catch blocks above - most generic error.
1426 return '{"seq":0,"type":"response","success":false,"message":"Internal error "}'; 1427 return '{"seq":0,"type":"response","success":false,"message":"Internal error "}';
1427 } 1428 }
1428 }; 1429 };
1429 1430
1430 1431
1431 DebugCommandProcessor.prototype.continueRequest_ = function(request, response) { 1432 DebugCommandProcessor.prototype.continueRequest_ = function(request, response) {
1432 // Check for arguments for continue. 1433 // Check for arguments for continue.
1433 if (request.arguments) { 1434 if (request.arguments) {
1434 var count = 1; 1435 var count = 1;
1435 var action = Debug.StepAction.StepIn; 1436 var action = Debug.StepAction.StepIn;
1436 1437
1437 // Pull out arguments. 1438 // Pull out arguments.
1438 var stepaction = request.arguments.stepaction; 1439 var stepaction = request.arguments.stepaction;
1439 var stepcount = request.arguments.stepcount; 1440 var stepcount = request.arguments.stepcount;
1440 1441
1441 // Get the stepcount argument if any. 1442 // Get the stepcount argument if any.
1442 if (stepcount) { 1443 if (stepcount) {
1443 count = %ToNumber(stepcount); 1444 count = builtins.$toNumber(stepcount);
1444 if (count < 0) { 1445 if (count < 0) {
1445 throw new Error('Invalid stepcount argument "' + stepcount + '".'); 1446 throw new Error('Invalid stepcount argument "' + stepcount + '".');
1446 } 1447 }
1447 } 1448 }
1448 1449
1449 // Get the stepaction argument. 1450 // Get the stepaction argument.
1450 if (stepaction) { 1451 if (stepaction) {
1451 if (stepaction == 'in') { 1452 if (stepaction == 'in') {
1452 action = Debug.StepAction.StepIn; 1453 action = Debug.StepAction.StepIn;
1453 } else if (stepaction == 'min') { 1454 } else if (stepaction == 'min') {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
1506 // Handle function break point. 1507 // Handle function break point.
1507 if (!IS_STRING(target)) { 1508 if (!IS_STRING(target)) {
1508 response.failed('Argument "target" is not a string value'); 1509 response.failed('Argument "target" is not a string value');
1509 return; 1510 return;
1510 } 1511 }
1511 var f; 1512 var f;
1512 try { 1513 try {
1513 // Find the function through a global evaluate. 1514 // Find the function through a global evaluate.
1514 f = this.exec_state_.evaluateGlobal(target).value(); 1515 f = this.exec_state_.evaluateGlobal(target).value();
1515 } catch (e) { 1516 } catch (e) {
1516 response.failed('Error: "' + %ToString(e) + 1517 response.failed('Error: "' + builtins.$toString(e) +
1517 '" evaluating "' + target + '"'); 1518 '" evaluating "' + target + '"');
1518 return; 1519 return;
1519 } 1520 }
1520 if (!IS_FUNCTION(f)) { 1521 if (!IS_FUNCTION(f)) {
1521 response.failed('"' + target + '" does not evaluate to a function'); 1522 response.failed('"' + target + '" does not evaluate to a function');
1522 return; 1523 return;
1523 } 1524 }
1524 1525
1525 // Set function break point. 1526 // Set function break point.
1526 break_point_number = Debug.setBreakPoint(f, line, column, condition); 1527 break_point_number = Debug.setBreakPoint(f, line, column, condition);
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
1595 1596
1596 DebugCommandProcessor.prototype.changeBreakPointRequest_ = function( 1597 DebugCommandProcessor.prototype.changeBreakPointRequest_ = function(
1597 request, response) { 1598 request, response) {
1598 // Check for legal request. 1599 // Check for legal request.
1599 if (!request.arguments) { 1600 if (!request.arguments) {
1600 response.failed('Missing arguments'); 1601 response.failed('Missing arguments');
1601 return; 1602 return;
1602 } 1603 }
1603 1604
1604 // Pull out arguments. 1605 // Pull out arguments.
1605 var break_point = %ToNumber(request.arguments.breakpoint); 1606 var break_point = builtins.$toNumber(request.arguments.breakpoint);
1606 var enabled = request.arguments.enabled; 1607 var enabled = request.arguments.enabled;
1607 var condition = request.arguments.condition; 1608 var condition = request.arguments.condition;
1608 var ignoreCount = request.arguments.ignoreCount; 1609 var ignoreCount = request.arguments.ignoreCount;
1609 1610
1610 // Check for legal arguments. 1611 // Check for legal arguments.
1611 if (!break_point) { 1612 if (!break_point) {
1612 response.failed('Missing argument "breakpoint"'); 1613 response.failed('Missing argument "breakpoint"');
1613 return; 1614 return;
1614 } 1615 }
1615 1616
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
1671 1672
1672 DebugCommandProcessor.prototype.clearBreakPointRequest_ = function( 1673 DebugCommandProcessor.prototype.clearBreakPointRequest_ = function(
1673 request, response) { 1674 request, response) {
1674 // Check for legal request. 1675 // Check for legal request.
1675 if (!request.arguments) { 1676 if (!request.arguments) {
1676 response.failed('Missing arguments'); 1677 response.failed('Missing arguments');
1677 return; 1678 return;
1678 } 1679 }
1679 1680
1680 // Pull out arguments. 1681 // Pull out arguments.
1681 var break_point = %ToNumber(request.arguments.breakpoint); 1682 var break_point = builtins.$toNumber(request.arguments.breakpoint);
1682 1683
1683 // Check for legal arguments. 1684 // Check for legal arguments.
1684 if (!break_point) { 1685 if (!break_point) {
1685 response.failed('Missing argument "breakpoint"'); 1686 response.failed('Missing argument "breakpoint"');
1686 return; 1687 return;
1687 } 1688 }
1688 1689
1689 // Clear break point. 1690 // Clear break point.
1690 Debug.clearBreakPoint(break_point); 1691 Debug.clearBreakPoint(break_point);
1691 1692
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
1928 }; 1929 };
1929 1930
1930 1931
1931 DebugCommandProcessor.prototype.scopeRequest_ = function(request, response) { 1932 DebugCommandProcessor.prototype.scopeRequest_ = function(request, response) {
1932 // Get the frame or function for which the scope is requested. 1933 // Get the frame or function for which the scope is requested.
1933 var scope_holder = this.resolveScopeHolder_(request.arguments); 1934 var scope_holder = this.resolveScopeHolder_(request.arguments);
1934 1935
1935 // With no scope argument just return top scope. 1936 // With no scope argument just return top scope.
1936 var scope_index = 0; 1937 var scope_index = 0;
1937 if (request.arguments && !IS_UNDEFINED(request.arguments.number)) { 1938 if (request.arguments && !IS_UNDEFINED(request.arguments.number)) {
1938 scope_index = %ToNumber(request.arguments.number); 1939 scope_index = builtins.$toNumber(request.arguments.number);
1939 if (scope_index < 0 || scope_holder.scopeCount() <= scope_index) { 1940 if (scope_index < 0 || scope_holder.scopeCount() <= scope_index) {
1940 return response.failed('Invalid scope number'); 1941 return response.failed('Invalid scope number');
1941 } 1942 }
1942 } 1943 }
1943 1944
1944 response.body = scope_holder.scope(scope_index); 1945 response.body = scope_holder.scope(scope_index);
1945 }; 1946 };
1946 1947
1947 1948
1948 // Reads value from protocol description. Description may be in form of type 1949 // Reads value from protocol description. Description may be in form of type
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
1992 var variable_name = request.arguments.name; 1993 var variable_name = request.arguments.name;
1993 1994
1994 var scope_description = request.arguments.scope; 1995 var scope_description = request.arguments.scope;
1995 1996
1996 // Get the frame or function for which the scope is requested. 1997 // Get the frame or function for which the scope is requested.
1997 var scope_holder = this.resolveScopeHolder_(scope_description); 1998 var scope_holder = this.resolveScopeHolder_(scope_description);
1998 1999
1999 if (IS_UNDEFINED(scope_description.number)) { 2000 if (IS_UNDEFINED(scope_description.number)) {
2000 response.failed('Missing scope number'); 2001 response.failed('Missing scope number');
2001 } 2002 }
2002 var scope_index = %ToNumber(scope_description.number); 2003 var scope_index = builtins.$toNumber(scope_description.number);
2003 2004
2004 var scope = scope_holder.scope(scope_index); 2005 var scope = scope_holder.scope(scope_index);
2005 2006
2006 var new_value = 2007 var new_value =
2007 DebugCommandProcessor.resolveValue_(request.arguments.newValue); 2008 DebugCommandProcessor.resolveValue_(request.arguments.newValue);
2008 2009
2009 scope.setVariableValue(variable_name, new_value); 2010 scope.setVariableValue(variable_name, new_value);
2010 2011
2011 var new_value_mirror = MakeMirror(new_value); 2012 var new_value_mirror = MakeMirror(new_value);
2012 2013
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
2070 disable_break = true; 2071 disable_break = true;
2071 } 2072 }
2072 2073
2073 // No frames no evaluate in frame. 2074 // No frames no evaluate in frame.
2074 if (this.exec_state_.frameCount() == 0) { 2075 if (this.exec_state_.frameCount() == 0) {
2075 return response.failed('No frames'); 2076 return response.failed('No frames');
2076 } 2077 }
2077 2078
2078 // Check whether a frame was specified. 2079 // Check whether a frame was specified.
2079 if (!IS_UNDEFINED(frame)) { 2080 if (!IS_UNDEFINED(frame)) {
2080 var frame_number = %ToNumber(frame); 2081 var frame_number = builtins.$toNumber(frame);
2081 if (frame_number < 0 || frame_number >= this.exec_state_.frameCount()) { 2082 if (frame_number < 0 || frame_number >= this.exec_state_.frameCount()) {
2082 return response.failed('Invalid frame "' + frame + '"'); 2083 return response.failed('Invalid frame "' + frame + '"');
2083 } 2084 }
2084 // Evaluate in the specified frame. 2085 // Evaluate in the specified frame.
2085 response.body = this.exec_state_.frame(frame_number).evaluate( 2086 response.body = this.exec_state_.frame(frame_number).evaluate(
2086 expression, Boolean(disable_break), additional_context_object); 2087 expression, Boolean(disable_break), additional_context_object);
2087 return; 2088 return;
2088 } else { 2089 } else {
2089 // Evaluate in the selected frame. 2090 // Evaluate in the selected frame.
2090 response.body = this.exec_state_.frame().evaluate( 2091 response.body = this.exec_state_.frame().evaluate(
(...skipping 11 matching lines...) Expand all
2102 // Pull out arguments. 2103 // Pull out arguments.
2103 var handles = request.arguments.handles; 2104 var handles = request.arguments.handles;
2104 2105
2105 // Check for legal arguments. 2106 // Check for legal arguments.
2106 if (IS_UNDEFINED(handles)) { 2107 if (IS_UNDEFINED(handles)) {
2107 return response.failed('Argument "handles" missing'); 2108 return response.failed('Argument "handles" missing');
2108 } 2109 }
2109 2110
2110 // Set 'includeSource' option for script lookup. 2111 // Set 'includeSource' option for script lookup.
2111 if (!IS_UNDEFINED(request.arguments.includeSource)) { 2112 if (!IS_UNDEFINED(request.arguments.includeSource)) {
2112 var includeSource = %ToBoolean(request.arguments.includeSource); 2113 var includeSource = builtins.$toBoolean(request.arguments.includeSource);
2113 response.setOption('includeSource', includeSource); 2114 response.setOption('includeSource', includeSource);
2114 } 2115 }
2115 2116
2116 // Lookup handles. 2117 // Lookup handles.
2117 var mirrors = {}; 2118 var mirrors = {};
2118 for (var i = 0; i < handles.length; i++) { 2119 for (var i = 0; i < handles.length; i++) {
2119 var handle = handles[i]; 2120 var handle = handles[i];
2120 var mirror = LookupMirror(handle); 2121 var mirror = LookupMirror(handle);
2121 if (!mirror) { 2122 if (!mirror) {
2122 return response.failed('Object #' + handle + '# not found'); 2123 return response.failed('Object #' + handle + '# not found');
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
2170 2171
2171 var from_line; 2172 var from_line;
2172 var to_line; 2173 var to_line;
2173 var frame = this.exec_state_.frame(); 2174 var frame = this.exec_state_.frame();
2174 if (request.arguments) { 2175 if (request.arguments) {
2175 // Pull out arguments. 2176 // Pull out arguments.
2176 from_line = request.arguments.fromLine; 2177 from_line = request.arguments.fromLine;
2177 to_line = request.arguments.toLine; 2178 to_line = request.arguments.toLine;
2178 2179
2179 if (!IS_UNDEFINED(request.arguments.frame)) { 2180 if (!IS_UNDEFINED(request.arguments.frame)) {
2180 var frame_number = %ToNumber(request.arguments.frame); 2181 var frame_number = builtins.$toNumber(request.arguments.frame);
2181 if (frame_number < 0 || frame_number >= this.exec_state_.frameCount()) { 2182 if (frame_number < 0 || frame_number >= this.exec_state_.frameCount()) {
2182 return response.failed('Invalid frame "' + frame + '"'); 2183 return response.failed('Invalid frame "' + frame + '"');
2183 } 2184 }
2184 frame = this.exec_state_.frame(frame_number); 2185 frame = this.exec_state_.frame(frame_number);
2185 } 2186 }
2186 } 2187 }
2187 2188
2188 // Get the script selected. 2189 // Get the script selected.
2189 var script = frame.func().script(); 2190 var script = frame.func().script();
2190 if (!script) { 2191 if (!script) {
(...skipping 15 matching lines...) Expand all
2206 }; 2207 };
2207 2208
2208 2209
2209 DebugCommandProcessor.prototype.scriptsRequest_ = function(request, response) { 2210 DebugCommandProcessor.prototype.scriptsRequest_ = function(request, response) {
2210 var types = ScriptTypeFlag(Debug.ScriptType.Normal); 2211 var types = ScriptTypeFlag(Debug.ScriptType.Normal);
2211 var includeSource = false; 2212 var includeSource = false;
2212 var idsToInclude = null; 2213 var idsToInclude = null;
2213 if (request.arguments) { 2214 if (request.arguments) {
2214 // Pull out arguments. 2215 // Pull out arguments.
2215 if (!IS_UNDEFINED(request.arguments.types)) { 2216 if (!IS_UNDEFINED(request.arguments.types)) {
2216 types = %ToNumber(request.arguments.types); 2217 types = builtins.$toNumber(request.arguments.types);
2217 if (isNaN(types) || types < 0) { 2218 if (isNaN(types) || types < 0) {
2218 return response.failed('Invalid types "' + 2219 return response.failed('Invalid types "' +
2219 request.arguments.types + '"'); 2220 request.arguments.types + '"');
2220 } 2221 }
2221 } 2222 }
2222 2223
2223 if (!IS_UNDEFINED(request.arguments.includeSource)) { 2224 if (!IS_UNDEFINED(request.arguments.includeSource)) {
2224 includeSource = %ToBoolean(request.arguments.includeSource); 2225 includeSource = builtins.$toBoolean(request.arguments.includeSource);
2225 response.setOption('includeSource', includeSource); 2226 response.setOption('includeSource', includeSource);
2226 } 2227 }
2227 2228
2228 if (IS_ARRAY(request.arguments.ids)) { 2229 if (IS_ARRAY(request.arguments.ids)) {
2229 idsToInclude = {}; 2230 idsToInclude = {};
2230 var ids = request.arguments.ids; 2231 var ids = request.arguments.ids;
2231 for (var i = 0; i < ids.length; i++) { 2232 for (var i = 0; i < ids.length; i++) {
2232 idsToInclude[ids[i]] = true; 2233 idsToInclude[ids[i]] = true;
2233 } 2234 }
2234 } 2235 }
2235 2236
2236 var filterStr = null; 2237 var filterStr = null;
2237 var filterNum = null; 2238 var filterNum = null;
2238 if (!IS_UNDEFINED(request.arguments.filter)) { 2239 if (!IS_UNDEFINED(request.arguments.filter)) {
2239 var num = %ToNumber(request.arguments.filter); 2240 var num = builtins.$toNumber(request.arguments.filter);
2240 if (!isNaN(num)) { 2241 if (!isNaN(num)) {
2241 filterNum = num; 2242 filterNum = num;
2242 } 2243 }
2243 filterStr = request.arguments.filter; 2244 filterStr = request.arguments.filter;
2244 } 2245 }
2245 } 2246 }
2246 2247
2247 // Collect all scripts in the heap. 2248 // Collect all scripts in the heap.
2248 var scripts = %DebugGetLoadedScripts(); 2249 var scripts = %DebugGetLoadedScripts();
2249 2250
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
2365 var frame = request.arguments.frame; 2366 var frame = request.arguments.frame;
2366 2367
2367 // No frames to evaluate in frame. 2368 // No frames to evaluate in frame.
2368 if (this.exec_state_.frameCount() == 0) { 2369 if (this.exec_state_.frameCount() == 0) {
2369 return response.failed('No frames'); 2370 return response.failed('No frames');
2370 } 2371 }
2371 2372
2372 var frame_mirror; 2373 var frame_mirror;
2373 // Check whether a frame was specified. 2374 // Check whether a frame was specified.
2374 if (!IS_UNDEFINED(frame)) { 2375 if (!IS_UNDEFINED(frame)) {
2375 var frame_number = %ToNumber(frame); 2376 var frame_number = builtins.$toNumber(frame);
2376 if (frame_number < 0 || frame_number >= this.exec_state_.frameCount()) { 2377 if (frame_number < 0 || frame_number >= this.exec_state_.frameCount()) {
2377 return response.failed('Invalid frame "' + frame + '"'); 2378 return response.failed('Invalid frame "' + frame + '"');
2378 } 2379 }
2379 // Restart specified frame. 2380 // Restart specified frame.
2380 frame_mirror = this.exec_state_.frame(frame_number); 2381 frame_mirror = this.exec_state_.frame(frame_number);
2381 } else { 2382 } else {
2382 // Restart selected frame. 2383 // Restart selected frame.
2383 frame_mirror = this.exec_state_.frame(); 2384 frame_mirror = this.exec_state_.frame();
2384 } 2385 }
2385 2386
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
2559 case 'string': 2560 case 'string':
2560 case 'number': 2561 case 'number':
2561 json = value; 2562 json = value;
2562 break; 2563 break;
2563 2564
2564 default: 2565 default:
2565 json = null; 2566 json = null;
2566 } 2567 }
2567 return json; 2568 return json;
2568 } 2569 }
OLDNEW
« no previous file with comments | « src/date.js ('k') | src/harmony-array.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698