Remove trailing regexp from .js files.

Removed trailing whitespace using regexp replace.  No other changes.

Review URL: http://codereview.chromium.org/1559006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4314 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 69bb1100
...@@ -1150,7 +1150,7 @@ function SetupArray() { ...@@ -1150,7 +1150,7 @@ function SetupArray() {
"reduce", getFunction("reduce", ArrayReduce, 1), "reduce", getFunction("reduce", ArrayReduce, 1),
"reduceRight", getFunction("reduceRight", ArrayReduceRight, 1) "reduceRight", getFunction("reduceRight", ArrayReduceRight, 1)
)); ));
%FinishArrayPrototypeSetup($Array.prototype); %FinishArrayPrototypeSetup($Array.prototype);
} }
......
...@@ -164,7 +164,7 @@ function DebugEventDetails(response) { ...@@ -164,7 +164,7 @@ function DebugEventDetails(response) {
Debug.State.currentFrame = 0; Debug.State.currentFrame = 0;
details.text = result; details.text = result;
break; break;
case 'exception': case 'exception':
if (body.uncaught) { if (body.uncaught) {
result += 'Uncaught: '; result += 'Uncaught: ';
...@@ -212,7 +212,7 @@ function DebugEventDetails(response) { ...@@ -212,7 +212,7 @@ function DebugEventDetails(response) {
function SourceInfo(body) { function SourceInfo(body) {
var result = ''; var result = '';
if (body.script) { if (body.script) {
if (body.script.name) { if (body.script.name) {
result += body.script.name; result += body.script.name;
...@@ -224,7 +224,7 @@ function SourceInfo(body) { ...@@ -224,7 +224,7 @@ function SourceInfo(body) {
result += body.sourceLine + 1; result += body.sourceLine + 1;
result += ' column '; result += ' column ';
result += body.sourceColumn + 1; result += body.sourceColumn + 1;
return result; return result;
} }
...@@ -297,20 +297,20 @@ function DebugRequest(cmd_line) { ...@@ -297,20 +297,20 @@ function DebugRequest(cmd_line) {
case 'bt': case 'bt':
this.request_ = this.backtraceCommandToJSONRequest_(args); this.request_ = this.backtraceCommandToJSONRequest_(args);
break; break;
case 'frame': case 'frame':
case 'f': case 'f':
this.request_ = this.frameCommandToJSONRequest_(args); this.request_ = this.frameCommandToJSONRequest_(args);
break; break;
case 'scopes': case 'scopes':
this.request_ = this.scopesCommandToJSONRequest_(args); this.request_ = this.scopesCommandToJSONRequest_(args);
break; break;
case 'scope': case 'scope':
this.request_ = this.scopeCommandToJSONRequest_(args); this.request_ = this.scopeCommandToJSONRequest_(args);
break; break;
case 'print': case 'print':
case 'p': case 'p':
this.request_ = this.printCommandToJSONRequest_(args); this.request_ = this.printCommandToJSONRequest_(args);
...@@ -331,16 +331,16 @@ function DebugRequest(cmd_line) { ...@@ -331,16 +331,16 @@ function DebugRequest(cmd_line) {
case 'source': case 'source':
this.request_ = this.sourceCommandToJSONRequest_(args); this.request_ = this.sourceCommandToJSONRequest_(args);
break; break;
case 'scripts': case 'scripts':
this.request_ = this.scriptsCommandToJSONRequest_(args); this.request_ = this.scriptsCommandToJSONRequest_(args);
break; break;
case 'break': case 'break':
case 'b': case 'b':
this.request_ = this.breakCommandToJSONRequest_(args); this.request_ = this.breakCommandToJSONRequest_(args);
break; break;
case 'clear': case 'clear':
this.request_ = this.clearCommandToJSONRequest_(args); this.request_ = this.clearCommandToJSONRequest_(args);
break; break;
...@@ -365,7 +365,7 @@ function DebugRequest(cmd_line) { ...@@ -365,7 +365,7 @@ function DebugRequest(cmd_line) {
default: default:
throw new Error('Unknown command "' + cmd + '"'); throw new Error('Unknown command "' + cmd + '"');
} }
last_cmd = cmd; last_cmd = cmd;
} }
...@@ -490,22 +490,22 @@ DebugRequest.prototype.stepCommandToJSONRequest_ = function(args) { ...@@ -490,22 +490,22 @@ DebugRequest.prototype.stepCommandToJSONRequest_ = function(args) {
case 'i': case 'i':
request.arguments.stepaction = 'in'; request.arguments.stepaction = 'in';
break; break;
case 'min': case 'min':
case 'm': case 'm':
request.arguments.stepaction = 'min'; request.arguments.stepaction = 'min';
break; break;
case 'next': case 'next':
case 'n': case 'n':
request.arguments.stepaction = 'next'; request.arguments.stepaction = 'next';
break; break;
case 'out': case 'out':
case 'o': case 'o':
request.arguments.stepaction = 'out'; request.arguments.stepaction = 'out';
break; break;
default: default:
throw new Error('Invalid step argument "' + args[0] + '".'); throw new Error('Invalid step argument "' + args[0] + '".');
} }
...@@ -523,7 +523,7 @@ DebugRequest.prototype.stepCommandToJSONRequest_ = function(args) { ...@@ -523,7 +523,7 @@ DebugRequest.prototype.stepCommandToJSONRequest_ = function(args) {
DebugRequest.prototype.backtraceCommandToJSONRequest_ = function(args) { DebugRequest.prototype.backtraceCommandToJSONRequest_ = function(args) {
// Build a backtrace request from the text command. // Build a backtrace request from the text command.
var request = this.createRequest('backtrace'); var request = this.createRequest('backtrace');
// Default is to show top 10 frames. // Default is to show top 10 frames.
request.arguments = {}; request.arguments = {};
request.arguments.fromFrame = 0; request.arguments.fromFrame = 0;
...@@ -626,7 +626,7 @@ DebugRequest.prototype.referencesCommandToJSONRequest_ = function(args) { ...@@ -626,7 +626,7 @@ DebugRequest.prototype.referencesCommandToJSONRequest_ = function(args) {
if (args.length == 0) { if (args.length == 0) {
throw new Error('Missing object id.'); throw new Error('Missing object id.');
} }
return this.makeReferencesJSONRequest_(args, 'referencedBy'); return this.makeReferencesJSONRequest_(args, 'referencedBy');
}; };
...@@ -637,7 +637,7 @@ DebugRequest.prototype.instancesCommandToJSONRequest_ = function(args) { ...@@ -637,7 +637,7 @@ DebugRequest.prototype.instancesCommandToJSONRequest_ = function(args) {
if (args.length == 0) { if (args.length == 0) {
throw new Error('Missing object id.'); throw new Error('Missing object id.');
} }
// Build a references request. // Build a references request.
return this.makeReferencesJSONRequest_(args, 'constructedBy'); return this.makeReferencesJSONRequest_(args, 'constructedBy');
}; };
...@@ -691,18 +691,18 @@ DebugRequest.prototype.scriptsCommandToJSONRequest_ = function(args) { ...@@ -691,18 +691,18 @@ DebugRequest.prototype.scriptsCommandToJSONRequest_ = function(args) {
case 'natives': case 'natives':
request.arguments.types = ScriptTypeFlag(Debug.ScriptType.Native); request.arguments.types = ScriptTypeFlag(Debug.ScriptType.Native);
break; break;
case 'extensions': case 'extensions':
request.arguments.types = ScriptTypeFlag(Debug.ScriptType.Extension); request.arguments.types = ScriptTypeFlag(Debug.ScriptType.Extension);
break; break;
case 'all': case 'all':
request.arguments.types = request.arguments.types =
ScriptTypeFlag(Debug.ScriptType.Normal) | ScriptTypeFlag(Debug.ScriptType.Normal) |
ScriptTypeFlag(Debug.ScriptType.Native) | ScriptTypeFlag(Debug.ScriptType.Native) |
ScriptTypeFlag(Debug.ScriptType.Extension); ScriptTypeFlag(Debug.ScriptType.Extension);
break; break;
default: default:
throw new Error('Invalid argument "' + args[0] + '".'); throw new Error('Invalid argument "' + args[0] + '".');
} }
...@@ -740,7 +740,7 @@ DebugRequest.prototype.breakCommandToJSONRequest_ = function(args) { ...@@ -740,7 +740,7 @@ DebugRequest.prototype.breakCommandToJSONRequest_ = function(args) {
type = 'script'; type = 'script';
var tmp = target.substring(pos + 1, target.length); var tmp = target.substring(pos + 1, target.length);
target = target.substring(0, pos); target = target.substring(0, pos);
// Check for both line and column. // Check for both line and column.
pos = tmp.indexOf(':'); pos = tmp.indexOf(':');
if (pos > 0) { if (pos > 0) {
...@@ -755,7 +755,7 @@ DebugRequest.prototype.breakCommandToJSONRequest_ = function(args) { ...@@ -755,7 +755,7 @@ DebugRequest.prototype.breakCommandToJSONRequest_ = function(args) {
} else { } else {
type = 'function'; type = 'function';
} }
request.arguments = {}; request.arguments = {};
request.arguments.type = type; request.arguments.type = type;
request.arguments.target = target; request.arguments.target = target;
...@@ -936,13 +936,13 @@ function DebugResponseDetails(response) { ...@@ -936,13 +936,13 @@ function DebugResponseDetails(response) {
result += body.breakpoint; result += body.breakpoint;
details.text = result; details.text = result;
break; break;
case 'clearbreakpoint': case 'clearbreakpoint':
result = 'cleared breakpoint #'; result = 'cleared breakpoint #';
result += body.breakpoint; result += body.breakpoint;
details.text = result; details.text = result;
break; break;
case 'backtrace': case 'backtrace':
if (body.totalFrames == 0) { if (body.totalFrames == 0) {
result = '(empty stack)'; result = '(empty stack)';
...@@ -956,14 +956,14 @@ function DebugResponseDetails(response) { ...@@ -956,14 +956,14 @@ function DebugResponseDetails(response) {
} }
details.text = result; details.text = result;
break; break;
case 'frame': case 'frame':
details.text = SourceUnderline(body.sourceLineText, details.text = SourceUnderline(body.sourceLineText,
body.column); body.column);
Debug.State.currentSourceLine = body.line; Debug.State.currentSourceLine = body.line;
Debug.State.currentFrame = body.index; Debug.State.currentFrame = body.index;
break; break;
case 'scopes': case 'scopes':
if (body.totalScopes == 0) { if (body.totalScopes == 0) {
result = '(no scopes)'; result = '(no scopes)';
...@@ -987,7 +987,7 @@ function DebugResponseDetails(response) { ...@@ -987,7 +987,7 @@ function DebugResponseDetails(response) {
result += formatObject_(scope_object_value, true); result += formatObject_(scope_object_value, true);
details.text = result; details.text = result;
break; break;
case 'evaluate': case 'evaluate':
case 'lookup': case 'lookup':
if (last_cmd == 'p' || last_cmd == 'print') { if (last_cmd == 'p' || last_cmd == 'print') {
...@@ -1031,7 +1031,7 @@ function DebugResponseDetails(response) { ...@@ -1031,7 +1031,7 @@ function DebugResponseDetails(response) {
} }
details.text = result; details.text = result;
break; break;
case 'source': case 'source':
// Get the source from the response. // Get the source from the response.
var source = body.source; var source = body.source;
...@@ -1066,7 +1066,7 @@ function DebugResponseDetails(response) { ...@@ -1066,7 +1066,7 @@ function DebugResponseDetails(response) {
} }
details.text = result; details.text = result;
break; break;
case 'scripts': case 'scripts':
var result = ''; var result = '';
for (i = 0; i < body.length; i++) { for (i = 0; i < body.length; i++) {
...@@ -1128,7 +1128,7 @@ function DebugResponseDetails(response) { ...@@ -1128,7 +1128,7 @@ function DebugResponseDetails(response) {
case 'continue': case 'continue':
details.text = "(running)"; details.text = "(running)";
break; break;
default: default:
details.text = details.text =
'Response for unknown command \'' + response.command + '\'' + 'Response for unknown command \'' + response.command + '\'' +
...@@ -1137,7 +1137,7 @@ function DebugResponseDetails(response) { ...@@ -1137,7 +1137,7 @@ function DebugResponseDetails(response) {
} catch (e) { } catch (e) {
details.text = 'Error: "' + e + '" formatting response'; details.text = 'Error: "' + e + '" formatting response';
} }
return details; return details;
}; };
...@@ -1254,7 +1254,7 @@ ProtocolValue.prototype.type = function() { ...@@ -1254,7 +1254,7 @@ ProtocolValue.prototype.type = function() {
/** /**
* Get a metadata field from a protocol value. * Get a metadata field from a protocol value.
* @return {Object} the metadata field value * @return {Object} the metadata field value
*/ */
ProtocolValue.prototype.field = function(name) { ProtocolValue.prototype.field = function(name) {
...@@ -1435,12 +1435,12 @@ function ArrayToJSONArray_(content) { ...@@ -1435,12 +1435,12 @@ function ArrayToJSONArray_(content) {
function BooleanToJSON_(value) { function BooleanToJSON_(value) {
return String(value); return String(value);
} }
function NumberToJSON_(value) { function NumberToJSON_(value) {
return String(value); return String(value);
} }
......
...@@ -1274,7 +1274,7 @@ DebugCommandProcessor.prototype.processDebugJSONRequest = function(json_request) ...@@ -1274,7 +1274,7 @@ DebugCommandProcessor.prototype.processDebugJSONRequest = function(json_request)
// Response controls running state. // Response controls running state.
this.running_ = response.running; this.running_ = response.running;
} }
response.running = this.running_; response.running = this.running_;
return response.toJSONProtocol(); return response.toJSONProtocol();
} catch (e) { } catch (e) {
// Failed to generate response - return generic error. // Failed to generate response - return generic error.
...@@ -1870,12 +1870,12 @@ DebugCommandProcessor.prototype.scriptsRequest_ = function(request, response) { ...@@ -1870,12 +1870,12 @@ DebugCommandProcessor.prototype.scriptsRequest_ = function(request, response) {
return response.failed('Invalid types "' + request.arguments.types + '"'); return response.failed('Invalid types "' + request.arguments.types + '"');
} }
} }
if (!IS_UNDEFINED(request.arguments.includeSource)) { if (!IS_UNDEFINED(request.arguments.includeSource)) {
includeSource = %ToBoolean(request.arguments.includeSource); includeSource = %ToBoolean(request.arguments.includeSource);
response.setOption('includeSource', includeSource); response.setOption('includeSource', includeSource);
} }
if (IS_ARRAY(request.arguments.ids)) { if (IS_ARRAY(request.arguments.ids)) {
idsToInclude = {}; idsToInclude = {};
var ids = request.arguments.ids; var ids = request.arguments.ids;
...@@ -1973,7 +1973,7 @@ DebugCommandProcessor.prototype.changeLiveRequest_ = function(request, response) ...@@ -1973,7 +1973,7 @@ DebugCommandProcessor.prototype.changeLiveRequest_ = function(request, response)
response.failed('Argument "new_string" is not a string value'); response.failed('Argument "new_string" is not a string value');
return; return;
} }
var scripts = %DebugGetLoadedScripts(); var scripts = %DebugGetLoadedScripts();
var the_script = null; var the_script = null;
...@@ -1986,7 +1986,7 @@ DebugCommandProcessor.prototype.changeLiveRequest_ = function(request, response) ...@@ -1986,7 +1986,7 @@ DebugCommandProcessor.prototype.changeLiveRequest_ = function(request, response)
response.failed('Script not found'); response.failed('Script not found');
return; return;
} }
var change_log = new Array(); var change_log = new Array();
try { try {
Debug.LiveEditChangeScript(the_script, change_pos, change_len, new_string, Debug.LiveEditChangeScript(the_script, change_pos, change_len, new_string,
...@@ -1995,7 +1995,7 @@ DebugCommandProcessor.prototype.changeLiveRequest_ = function(request, response) ...@@ -1995,7 +1995,7 @@ DebugCommandProcessor.prototype.changeLiveRequest_ = function(request, response)
if (e instanceof Debug.LiveEditChangeScript.Failure) { if (e instanceof Debug.LiveEditChangeScript.Failure) {
// Let's treat it as a "success" so that body with change_log will be // Let's treat it as a "success" so that body with change_log will be
// sent back. "change_log" will have "failure" field set. // sent back. "change_log" will have "failure" field set.
change_log.push( { failure: true } ); change_log.push( { failure: true } );
} else { } else {
throw e; throw e;
} }
...@@ -2076,7 +2076,7 @@ function ObjectToProtocolObject_(object, mirror_serializer) { ...@@ -2076,7 +2076,7 @@ function ObjectToProtocolObject_(object, mirror_serializer) {
} }
} }
} }
return content; return content;
} }
...@@ -2099,7 +2099,7 @@ function ArrayToProtocolArray_(array, mirror_serializer) { ...@@ -2099,7 +2099,7 @@ function ArrayToProtocolArray_(array, mirror_serializer) {
/** /**
* Convert a value to its debugger protocol representation. * Convert a value to its debugger protocol representation.
* @param {*} value The value to format as protocol value. * @param {*} value The value to format as protocol value.
* @param {MirrorSerializer} mirror_serializer The serializer to use if any * @param {MirrorSerializer} mirror_serializer The serializer to use if any
* mirror objects are encountered. * mirror objects are encountered.
......
...@@ -32,14 +32,14 @@ ...@@ -32,14 +32,14 @@
// Changes script text and recompiles all relevant functions if possible. // Changes script text and recompiles all relevant functions if possible.
// The change is always a substring (change_pos, change_pos + change_len) // The change is always a substring (change_pos, change_pos + change_len)
// being replaced with a completely different string new_str. // being replaced with a completely different string new_str.
// //
// Only one function will have its Code changed in result of this function. // Only one function will have its Code changed in result of this function.
// All nested functions (should they have any instances at the moment) are left // All nested functions (should they have any instances at the moment) are left
// unchanged and re-linked to a newly created script instance representing old // unchanged and re-linked to a newly created script instance representing old
// version of the source. (Generally speaking, // version of the source. (Generally speaking,
// during the change all nested functions are erased and completely different // during the change all nested functions are erased and completely different
// set of nested functions are introduced.) All other functions just have // set of nested functions are introduced.) All other functions just have
// their positions updated. // their positions updated.
// //
// @param {Script} script that is being changed // @param {Script} script that is being changed
// @param {Array} change_log a list that collects engineer-readable description // @param {Array} change_log a list that collects engineer-readable description
...@@ -56,9 +56,9 @@ Debug.LiveEditChangeScript = function(script, change_pos, change_len, new_str, ...@@ -56,9 +56,9 @@ Debug.LiveEditChangeScript = function(script, change_pos, change_len, new_str,
// Elements of array are ordered by start positions of functions (from top // Elements of array are ordered by start positions of functions (from top
// to bottom) in the source. Fields outer_index and next_sibling_index help // to bottom) in the source. Fields outer_index and next_sibling_index help
// to navigate the nesting structure of functions. // to navigate the nesting structure of functions.
// //
// The script is used for compilation, because it produces code that // The script is used for compilation, because it produces code that
// needs to be linked with some particular script (for nested functions). // needs to be linked with some particular script (for nested functions).
function DebugGatherCompileInfo(source) { function DebugGatherCompileInfo(source) {
// Get function info, elements are partially sorted (it is a tree // Get function info, elements are partially sorted (it is a tree
// of nested functions serialized as parent followed by serialized children. // of nested functions serialized as parent followed by serialized children.
...@@ -71,7 +71,7 @@ Debug.LiveEditChangeScript = function(script, change_pos, change_len, new_str, ...@@ -71,7 +71,7 @@ Debug.LiveEditChangeScript = function(script, change_pos, change_len, new_str,
compile_info.push(new liveedit.FunctionCompileInfo(raw_compile_info[i])); compile_info.push(new liveedit.FunctionCompileInfo(raw_compile_info[i]));
old_index_map.push(i); old_index_map.push(i);
} }
for (var i = 0; i < compile_info.length; i++) { for (var i = 0; i < compile_info.length; i++) {
var k = i; var k = i;
for (var j = i + 1; j < compile_info.length; j++) { for (var j = i + 1; j < compile_info.length; j++) {
...@@ -112,12 +112,12 @@ Debug.LiveEditChangeScript = function(script, change_pos, change_len, new_str, ...@@ -112,12 +112,12 @@ Debug.LiveEditChangeScript = function(script, change_pos, change_len, new_str,
compile_info[previous_sibling].next_sibling_index = -1; compile_info[previous_sibling].next_sibling_index = -1;
} }
} }
ResetIndexes(-1, -1); ResetIndexes(-1, -1);
Assert(current_index == compile_info.length); Assert(current_index == compile_info.length);
return compile_info; return compile_info;
} }
// Given a positions, finds a function that fully includes the entire change. // Given a positions, finds a function that fully includes the entire change.
function FindChangedFunction(compile_info, offset, len) { function FindChangedFunction(compile_info, offset, len) {
...@@ -148,7 +148,7 @@ Debug.LiveEditChangeScript = function(script, change_pos, change_len, new_str, ...@@ -148,7 +148,7 @@ Debug.LiveEditChangeScript = function(script, change_pos, change_len, new_str,
var old_info = old_compile_info[index]; var old_info = old_compile_info[index];
for (var i = 0; i < shared_infos.length; i++) { for (var i = 0; i < shared_infos.length; i++) {
var info = shared_infos[i]; var info = shared_infos[i];
if (info.start_position == old_info.start_position && if (info.start_position == old_info.start_position &&
info.end_position == old_info.end_position) { info.end_position == old_info.end_position) {
return info; return info;
} }
...@@ -161,7 +161,7 @@ Debug.LiveEditChangeScript = function(script, change_pos, change_len, new_str, ...@@ -161,7 +161,7 @@ Debug.LiveEditChangeScript = function(script, change_pos, change_len, new_str,
change_log.push( {function_patched: new_info.function_name} ); change_log.push( {function_patched: new_info.function_name} );
} }
var change_len_old; var change_len_old;
var change_len_new; var change_len_new;
// Translate position in old version of script into position in new // Translate position in old version of script into position in new
...@@ -175,7 +175,7 @@ Debug.LiveEditChangeScript = function(script, change_pos, change_len, new_str, ...@@ -175,7 +175,7 @@ Debug.LiveEditChangeScript = function(script, change_pos, change_len, new_str,
} }
return -1; return -1;
} }
var position_change_array; var position_change_array;
var position_patch_report; var position_patch_report;
function PatchPositions(new_info, shared_info) { function PatchPositions(new_info, shared_info) {
...@@ -187,7 +187,7 @@ Debug.LiveEditChangeScript = function(script, change_pos, change_len, new_str, ...@@ -187,7 +187,7 @@ Debug.LiveEditChangeScript = function(script, change_pos, change_len, new_str,
position_change_array); position_change_array);
position_patch_report.push( { name: new_info.function_name } ); position_patch_report.push( { name: new_info.function_name } );
} }
var link_to_old_script_report; var link_to_old_script_report;
var old_script; var old_script;
// Makes a function associated with another instance of a script (the // Makes a function associated with another instance of a script (the
...@@ -195,16 +195,16 @@ Debug.LiveEditChangeScript = function(script, change_pos, change_len, new_str, ...@@ -195,16 +195,16 @@ Debug.LiveEditChangeScript = function(script, change_pos, change_len, new_str,
// may access its own text. // may access its own text.
function LinkToOldScript(shared_info) { function LinkToOldScript(shared_info) {
%LiveEditRelinkFunctionToScript(shared_info.raw_array, old_script); %LiveEditRelinkFunctionToScript(shared_info.raw_array, old_script);
link_to_old_script_report.push( { name: shared_info.function_name } ); link_to_old_script_report.push( { name: shared_info.function_name } );
} }
var old_source = script.source; var old_source = script.source;
var change_len_old = change_len; var change_len_old = change_len;
var change_len_new = new_str.length; var change_len_new = new_str.length;
// Prepare new source string. // Prepare new source string.
var new_source = old_source.substring(0, change_pos) + var new_source = old_source.substring(0, change_pos) +
new_str + old_source.substring(change_pos + change_len); new_str + old_source.substring(change_pos + change_len);
...@@ -217,10 +217,10 @@ Debug.LiveEditChangeScript = function(script, change_pos, change_len, new_str, ...@@ -217,10 +217,10 @@ Debug.LiveEditChangeScript = function(script, change_pos, change_len, new_str,
for (var i = 0; i < shared_raw_list.length; i++) { for (var i = 0; i < shared_raw_list.length; i++) {
shared_infos.push(new liveedit.SharedInfoWrapper(shared_raw_list[i])); shared_infos.push(new liveedit.SharedInfoWrapper(shared_raw_list[i]));
} }
// Gather compile information about old version of script. // Gather compile information about old version of script.
var old_compile_info = DebugGatherCompileInfo(old_source); var old_compile_info = DebugGatherCompileInfo(old_source);
// Gather compile information about new version of script. // Gather compile information about new version of script.
var new_compile_info; var new_compile_info;
try { try {
...@@ -247,20 +247,20 @@ Debug.LiveEditChangeScript = function(script, change_pos, change_len, new_str, ...@@ -247,20 +247,20 @@ Debug.LiveEditChangeScript = function(script, change_pos, change_len, new_str,
old_compile_info[function_being_patched], old_compile_info[function_being_patched],
new_compile_info[function_being_patched])) { new_compile_info[function_being_patched])) {
Assert(old_compile_info[function_being_patched].outer_index == Assert(old_compile_info[function_being_patched].outer_index ==
new_compile_info[function_being_patched].outer_index); new_compile_info[function_being_patched].outer_index);
function_being_patched = function_being_patched =
old_compile_info[function_being_patched].outer_index; old_compile_info[function_being_patched].outer_index;
Assert(function_being_patched != -1); Assert(function_being_patched != -1);
} }
// Check that function being patched is not currently on stack. // Check that function being patched is not currently on stack.
liveedit.CheckStackActivations( liveedit.CheckStackActivations(
[ FindFunctionInfo(function_being_patched) ], change_log ); [ FindFunctionInfo(function_being_patched) ], change_log );
// Committing all changes. // Committing all changes.
var old_script_name = liveedit.CreateNameForOldScript(script); var old_script_name = liveedit.CreateNameForOldScript(script);
// Update the script text and create a new script representing an old // Update the script text and create a new script representing an old
// version of the script. // version of the script.
...@@ -271,11 +271,11 @@ Debug.LiveEditChangeScript = function(script, change_pos, change_len, new_str, ...@@ -271,11 +271,11 @@ Debug.LiveEditChangeScript = function(script, change_pos, change_len, new_str,
var position_patch_report = new Array(); var position_patch_report = new Array();
change_log.push( {position_patched: position_patch_report} ); change_log.push( {position_patched: position_patch_report} );
var position_change_array = [ change_pos, var position_change_array = [ change_pos,
change_pos + change_len_old, change_pos + change_len_old,
change_pos + change_len_new ]; change_pos + change_len_new ];
// Update positions of all outer functions (i.e. all functions, that // Update positions of all outer functions (i.e. all functions, that
// are partially below the function being patched). // are partially below the function being patched).
for (var i = new_compile_info[function_being_patched].outer_index; for (var i = new_compile_info[function_being_patched].outer_index;
...@@ -308,7 +308,7 @@ Debug.LiveEditChangeScript = function(script, change_pos, change_len, new_str, ...@@ -308,7 +308,7 @@ Debug.LiveEditChangeScript = function(script, change_pos, change_len, new_str,
var link_to_old_script_report = new Array(); var link_to_old_script_report = new Array();
change_log.push( { linked_to_old_script: link_to_old_script_report } ); change_log.push( { linked_to_old_script: link_to_old_script_report } );
// We need to link to old script all former nested functions. // We need to link to old script all former nested functions.
for (var i = function_being_patched + 1; i < old_next_sibling; i++) { for (var i = function_being_patched + 1; i < old_next_sibling; i++) {
LinkToOldScript(FindFunctionInfo(i), old_script); LinkToOldScript(FindFunctionInfo(i), old_script);
} }
...@@ -323,7 +323,7 @@ Debug.LiveEditChangeScript.Assert = function(condition, message) { ...@@ -323,7 +323,7 @@ Debug.LiveEditChangeScript.Assert = function(condition, message) {
} }
} }
} }
// An object describing function compilation details. Its index fields // An object describing function compilation details. Its index fields
// apply to indexes inside array that stores these objects. // apply to indexes inside array that stores these objects.
Debug.LiveEditChangeScript.FunctionCompileInfo = function(raw_array) { Debug.LiveEditChangeScript.FunctionCompileInfo = function(raw_array) {
...@@ -337,7 +337,7 @@ Debug.LiveEditChangeScript.FunctionCompileInfo = function(raw_array) { ...@@ -337,7 +337,7 @@ Debug.LiveEditChangeScript.FunctionCompileInfo = function(raw_array) {
this.next_sibling_index = null; this.next_sibling_index = null;
this.raw_array = raw_array; this.raw_array = raw_array;
} }
// A structure describing SharedFunctionInfo. // A structure describing SharedFunctionInfo.
Debug.LiveEditChangeScript.SharedInfoWrapper = function(raw_array) { Debug.LiveEditChangeScript.SharedInfoWrapper = function(raw_array) {
this.function_name = raw_array[0]; this.function_name = raw_array[0];
...@@ -364,18 +364,18 @@ Debug.LiveEditChangeScript.CompareFunctionExpectations = ...@@ -364,18 +364,18 @@ Debug.LiveEditChangeScript.CompareFunctionExpectations =
} }
var scope_info1 = function_info1.scope_info; var scope_info1 = function_info1.scope_info;
var scope_info2 = function_info2.scope_info; var scope_info2 = function_info2.scope_info;
if (!scope_info1) { if (!scope_info1) {
return !scope_info2; return !scope_info2;
} }
if (scope_info1.length != scope_info2.length) { if (scope_info1.length != scope_info2.length) {
return false; return false;
} }
// Check that outer scope structure is not changed. Otherwise the function // Check that outer scope structure is not changed. Otherwise the function
// will not properly work with existing scopes. // will not properly work with existing scopes.
return scope_info1.toString() == scope_info2.toString(); return scope_info1.toString() == scope_info2.toString();
} }
// For array of wrapped shared function infos checks that none of them // For array of wrapped shared function infos checks that none of them
...@@ -384,7 +384,7 @@ Debug.LiveEditChangeScript.CompareFunctionExpectations = ...@@ -384,7 +384,7 @@ Debug.LiveEditChangeScript.CompareFunctionExpectations =
Debug.LiveEditChangeScript.CheckStackActivations = function(shared_wrapper_list, Debug.LiveEditChangeScript.CheckStackActivations = function(shared_wrapper_list,
change_log) { change_log) {
var liveedit = Debug.LiveEditChangeScript; var liveedit = Debug.LiveEditChangeScript;
var shared_list = new Array(); var shared_list = new Array();
for (var i = 0; i < shared_wrapper_list.length; i++) { for (var i = 0; i < shared_wrapper_list.length; i++) {
shared_list[i] = shared_wrapper_list[i].info; shared_list[i] = shared_wrapper_list[i].info;
...@@ -396,7 +396,7 @@ Debug.LiveEditChangeScript.CheckStackActivations = function(shared_wrapper_list, ...@@ -396,7 +396,7 @@ Debug.LiveEditChangeScript.CheckStackActivations = function(shared_wrapper_list,
var shared = shared_list[i]; var shared = shared_list[i];
var description = { var description = {
name: shared.function_name, name: shared.function_name,
start_pos: shared.start_position, start_pos: shared.start_position,
end_pos: shared.end_position end_pos: shared.end_position
}; };
problems.push(description); problems.push(description);
...@@ -422,7 +422,7 @@ Debug.LiveEditChangeScript.Failure = function(message) { ...@@ -422,7 +422,7 @@ Debug.LiveEditChangeScript.Failure = function(message) {
} }
Debug.LiveEditChangeScript.Failure.prototype.toString = function() { Debug.LiveEditChangeScript.Failure.prototype.toString = function() {
return "LiveEdit Failure: " + this.message; return "LiveEdit Failure: " + this.message;
} }
// A testing entry. // A testing entry.
......
...@@ -743,7 +743,7 @@ function FormatEvalOrigin(script) { ...@@ -743,7 +743,7 @@ function FormatEvalOrigin(script) {
} else { } else {
eval_origin += "<anonymous>"; eval_origin += "<anonymous>";
} }
var eval_from_script = script.eval_from_script; var eval_from_script = script.eval_from_script;
if (eval_from_script) { if (eval_from_script) {
if (eval_from_script.compilation_type == COMPILATION_TYPE_EVAL) { if (eval_from_script.compilation_type == COMPILATION_TYPE_EVAL) {
...@@ -764,7 +764,7 @@ function FormatEvalOrigin(script) { ...@@ -764,7 +764,7 @@ function FormatEvalOrigin(script) {
} }
} }
} }
return eval_origin; return eval_origin;
}; };
......
...@@ -67,7 +67,7 @@ function MakeMirror(value, opt_transient) { ...@@ -67,7 +67,7 @@ function MakeMirror(value, opt_transient) {
} }
} }
} }
if (IS_UNDEFINED(value)) { if (IS_UNDEFINED(value)) {
mirror = new UndefinedMirror(); mirror = new UndefinedMirror();
} else if (IS_NULL(value)) { } else if (IS_NULL(value)) {
...@@ -110,7 +110,7 @@ function LookupMirror(handle) { ...@@ -110,7 +110,7 @@ function LookupMirror(handle) {
return mirror_cache_[handle]; return mirror_cache_[handle];
} }
/** /**
* Returns the mirror for the undefined value. * Returns the mirror for the undefined value.
* *
...@@ -622,7 +622,7 @@ ObjectMirror.prototype.propertyNames = function(kind, limit) { ...@@ -622,7 +622,7 @@ ObjectMirror.prototype.propertyNames = function(kind, limit) {
var propertyNames; var propertyNames;
var elementNames; var elementNames;
var total = 0; var total = 0;
// Find all the named properties. // Find all the named properties.
if (kind & PropertyKind.Named) { if (kind & PropertyKind.Named) {
// Get the local property names. // Get the local property names.
...@@ -1223,7 +1223,7 @@ PropertyMirror.prototype.setter = function() { ...@@ -1223,7 +1223,7 @@ PropertyMirror.prototype.setter = function() {
/** /**
* Returns whether this property is natively implemented by the host or a set * Returns whether this property is natively implemented by the host or a set
* through JavaScript code. * through JavaScript code.
* @return {boolean} True if the property is * @return {boolean} True if the property is
* UndefinedMirror if there is no setter for this property * UndefinedMirror if there is no setter for this property
*/ */
PropertyMirror.prototype.isNative = function() { PropertyMirror.prototype.isNative = function() {
...@@ -1390,7 +1390,7 @@ FrameMirror.prototype.index = function() { ...@@ -1390,7 +1390,7 @@ FrameMirror.prototype.index = function() {
FrameMirror.prototype.func = function() { FrameMirror.prototype.func = function() {
// Get the function for this frame from the VM. // Get the function for this frame from the VM.
var f = this.details_.func(); var f = this.details_.func();
// Create a function mirror. NOTE: MakeMirror cannot be used here as the // Create a function mirror. NOTE: MakeMirror cannot be used here as the
// value returned from the VM might be a string if the function for the // value returned from the VM might be a string if the function for the
// frame is unresolved. // frame is unresolved.
...@@ -1825,17 +1825,17 @@ ScriptMirror.prototype.toText = function() { ...@@ -1825,17 +1825,17 @@ ScriptMirror.prototype.toText = function() {
/** /**
* Returns a suggested script URL from comments in script code (if found), * Returns a suggested script URL from comments in script code (if found),
* undefined otherwise. Used primarily by debuggers for identifying eval()'ed * undefined otherwise. Used primarily by debuggers for identifying eval()'ed
* scripts. See * scripts. See
* http://fbug.googlecode.com/svn/branches/firebug1.1/docs/ReleaseNotes_1.1.txt * http://fbug.googlecode.com/svn/branches/firebug1.1/docs/ReleaseNotes_1.1.txt
* for details. * for details.
* *
* @return {?string} value for //@ sourceURL comment * @return {?string} value for //@ sourceURL comment
*/ */
ScriptMirror.prototype.sourceUrlFromComment_ = function() { ScriptMirror.prototype.sourceUrlFromComment_ = function() {
if (!('sourceUrl_' in this) && this.source()) { if (!('sourceUrl_' in this) && this.source()) {
// TODO(608): the spaces in a regexp below had to be escaped as \040 // TODO(608): the spaces in a regexp below had to be escaped as \040
// because this file is being processed by js2c whose handling of spaces // because this file is being processed by js2c whose handling of spaces
// in regexps is broken. // in regexps is broken.
// We're not using \s here to prevent \n from matching. // We're not using \s here to prevent \n from matching.
...@@ -1928,10 +1928,10 @@ JSONProtocolSerializer.prototype.serializeValue = function(mirror) { ...@@ -1928,10 +1928,10 @@ JSONProtocolSerializer.prototype.serializeValue = function(mirror) {
JSONProtocolSerializer.prototype.serializeReferencedObjects = function() { JSONProtocolSerializer.prototype.serializeReferencedObjects = function() {
// Collect the protocol representation of the referenced objects in an array. // Collect the protocol representation of the referenced objects in an array.
var content = []; var content = [];
// Get the number of referenced objects. // Get the number of referenced objects.
var count = this.mirrors_.length; var count = this.mirrors_.length;
for (var i = 0; i < count; i++) { for (var i = 0; i < count; i++) {
content.push(this.serialize_(this.mirrors_[i], false, false)); content.push(this.serialize_(this.mirrors_[i], false, false));
} }
...@@ -1966,7 +1966,7 @@ JSONProtocolSerializer.prototype.add_ = function(mirror) { ...@@ -1966,7 +1966,7 @@ JSONProtocolSerializer.prototype.add_ = function(mirror) {
return; return;
} }
} }
// Add the mirror to the list of mirrors to be serialized. // Add the mirror to the list of mirrors to be serialized.
this.mirrors_.push(mirror); this.mirrors_.push(mirror);
} }
...@@ -1978,7 +1978,7 @@ JSONProtocolSerializer.prototype.add_ = function(mirror) { ...@@ -1978,7 +1978,7 @@ JSONProtocolSerializer.prototype.add_ = function(mirror) {
* @param {Mirror} mirror Mirror to serialize. * @param {Mirror} mirror Mirror to serialize.
* @return {Object} Protocol reference object. * @return {Object} Protocol reference object.
*/ */
JSONProtocolSerializer.prototype.serializeReferenceWithDisplayData_ = JSONProtocolSerializer.prototype.serializeReferenceWithDisplayData_ =
function(mirror) { function(mirror) {
var o = {}; var o = {};
o.ref = mirror.handle(); o.ref = mirror.handle();
...@@ -2025,7 +2025,7 @@ JSONProtocolSerializer.prototype.serialize_ = function(mirror, reference, ...@@ -2025,7 +2025,7 @@ JSONProtocolSerializer.prototype.serialize_ = function(mirror, reference,
return {'ref' : mirror.handle()}; return {'ref' : mirror.handle()};
} }
} }
// Collect the JSON property/value pairs. // Collect the JSON property/value pairs.
var content = {}; var content = {};
...@@ -2137,7 +2137,7 @@ JSONProtocolSerializer.prototype.serialize_ = function(mirror, reference, ...@@ -2137,7 +2137,7 @@ JSONProtocolSerializer.prototype.serialize_ = function(mirror, reference,
// Always add the text representation. // Always add the text representation.
content.text = mirror.toText(); content.text = mirror.toText();
// Create and return the JSON string. // Create and return the JSON string.
return content; return content;
} }
...@@ -2170,7 +2170,7 @@ JSONProtocolSerializer.prototype.serializeObject_ = function(mirror, content, ...@@ -2170,7 +2170,7 @@ JSONProtocolSerializer.prototype.serializeObject_ = function(mirror, content,
if (mirror.hasIndexedInterceptor()) { if (mirror.hasIndexedInterceptor()) {
content.indexedInterceptor = true; content.indexedInterceptor = true;
} }
// Add function specific properties. // Add function specific properties.
if (mirror.isFunction()) { if (mirror.isFunction()) {
// Add function specific properties. // Add function specific properties.
...@@ -2185,7 +2185,7 @@ JSONProtocolSerializer.prototype.serializeObject_ = function(mirror, content, ...@@ -2185,7 +2185,7 @@ JSONProtocolSerializer.prototype.serializeObject_ = function(mirror, content,
if (mirror.script()) { if (mirror.script()) {
content.script = this.serializeReference(mirror.script()); content.script = this.serializeReference(mirror.script());
content.scriptId = mirror.script().id(); content.scriptId = mirror.script().id();
serializeLocationFields(mirror.sourceLocation(), content); serializeLocationFields(mirror.sourceLocation(), content);
} }
} }
...@@ -2224,13 +2224,13 @@ JSONProtocolSerializer.prototype.serializeObject_ = function(mirror, content, ...@@ -2224,13 +2224,13 @@ JSONProtocolSerializer.prototype.serializeObject_ = function(mirror, content,
* "position":"<position>", * "position":"<position>",
* "line":"<line>", * "line":"<line>",
* "column":"<column>", * "column":"<column>",
* *
* @param {SourceLocation} location The location to serialize, may be undefined. * @param {SourceLocation} location The location to serialize, may be undefined.
*/ */
function serializeLocationFields (location, content) { function serializeLocationFields (location, content) {
if (!location) { if (!location) {
return; return;
} }
content.position = location.position; content.position = location.position;
var line = location.line; var line = location.line;
if (!IS_UNDEFINED(line)) { if (!IS_UNDEFINED(line)) {
...@@ -2264,7 +2264,7 @@ function serializeLocationFields (location, content) { ...@@ -2264,7 +2264,7 @@ function serializeLocationFields (location, content) {
*/ */
JSONProtocolSerializer.prototype.serializeProperty_ = function(propertyMirror) { JSONProtocolSerializer.prototype.serializeProperty_ = function(propertyMirror) {
var result = {}; var result = {};
result.name = propertyMirror.name(); result.name = propertyMirror.name();
var propertyValue = propertyMirror.value(); var propertyValue = propertyMirror.value();
if (this.inlineRefs_() && propertyValue.isValue()) { if (this.inlineRefs_() && propertyValue.isValue()) {
...@@ -2316,7 +2316,7 @@ JSONProtocolSerializer.prototype.serializeFrame_ = function(mirror, content) { ...@@ -2316,7 +2316,7 @@ JSONProtocolSerializer.prototype.serializeFrame_ = function(mirror, content) {
if (!IS_UNDEFINED(source_line_text)) { if (!IS_UNDEFINED(source_line_text)) {
content.sourceLineText = source_line_text; content.sourceLineText = source_line_text;
} }
content.scopes = []; content.scopes = [];
for (var i = 0; i < mirror.scopeCount(); i++) { for (var i = 0; i < mirror.scopeCount(); i++) {
var scope = mirror.scope(i); var scope = mirror.scope(i);
...@@ -2358,5 +2358,5 @@ function NumberToJSON_(value) { ...@@ -2358,5 +2358,5 @@ function NumberToJSON_(value) {
return '-Infinity'; return '-Infinity';
} }
} }
return value; return value;
} }
...@@ -333,7 +333,7 @@ function RegExpGetLastMatch() { ...@@ -333,7 +333,7 @@ function RegExpGetLastMatch() {
function RegExpGetLastParen() { function RegExpGetLastParen() {
if (lastMatchInfoOverride) { if (lastMatchInfoOverride) {
var override = lastMatchInfoOverride; var override = lastMatchInfoOverride;
if (override.length <= 3) return ''; if (override.length <= 3) return '';
return override[override.length - 3]; return override[override.length - 3];
} }
var length = NUMBER_OF_CAPTURES(lastMatchInfo); var length = NUMBER_OF_CAPTURES(lastMatchInfo);
...@@ -416,8 +416,8 @@ var lastMatchInfo = [ ...@@ -416,8 +416,8 @@ var lastMatchInfo = [
// Override last match info with an array of actual substrings. // Override last match info with an array of actual substrings.
// Used internally by replace regexp with function. // Used internally by replace regexp with function.
// The array has the format of an "apply" argument for a replacement // The array has the format of an "apply" argument for a replacement
// function. // function.
var lastMatchInfoOverride = null; var lastMatchInfoOverride = null;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
...@@ -439,7 +439,7 @@ function SetupRegExp() { ...@@ -439,7 +439,7 @@ function SetupRegExp() {
%FunctionSetLength($RegExp.prototype.compile, 1); %FunctionSetLength($RegExp.prototype.compile, 1);
// The properties input, $input, and $_ are aliases for each other. When this // The properties input, $input, and $_ are aliases for each other. When this
// value is set the value it is set to is coerced to a string. // value is set the value it is set to is coerced to a string.
// Getter and setter for the input. // Getter and setter for the input.
function RegExpGetInput() { function RegExpGetInput() {
var regExpInput = LAST_INPUT(lastMatchInfo); var regExpInput = LAST_INPUT(lastMatchInfo);
......
...@@ -577,11 +577,11 @@ function SameValue(x, y) { ...@@ -577,11 +577,11 @@ function SameValue(x, y) {
if (IS_NUMBER(x)) { if (IS_NUMBER(x)) {
if (NUMBER_IS_NAN(x) && NUMBER_IS_NAN(y)) return true; if (NUMBER_IS_NAN(x) && NUMBER_IS_NAN(y)) return true;
// x is +0 and y is -0 or vice versa // x is +0 and y is -0 or vice versa
if (x === 0 && y === 0 && !%_IsSmi(x) && !%_IsSmi(y) && if (x === 0 && y === 0 && !%_IsSmi(x) && !%_IsSmi(y) &&
((1 / x < 0 && 1 / y > 0) || (1 / x > 0 && 1 / y < 0))) { ((1 / x < 0 && 1 / y > 0) || (1 / x > 0 && 1 / y < 0))) {
return false; return false;
} }
return x == y; return x == y;
} }
if (IS_STRING(x)) return %StringEquals(x, y); if (IS_STRING(x)) return %StringEquals(x, y);
if (IS_BOOLEAN(x))return %NumberEquals(%ToNumber(x),%ToNumber(y)); if (IS_BOOLEAN(x))return %NumberEquals(%ToNumber(x),%ToNumber(y));
......
...@@ -406,7 +406,7 @@ function addCaptureString(builder, matchInfo, index) { ...@@ -406,7 +406,7 @@ function addCaptureString(builder, matchInfo, index) {
}; };
// TODO(lrn): This array will survive indefinitely if replace is never // TODO(lrn): This array will survive indefinitely if replace is never
// called again. However, it will be empty, since the contents are cleared // called again. However, it will be empty, since the contents are cleared
// in the finally block. // in the finally block.
var reusableReplaceArray = $Array(16); var reusableReplaceArray = $Array(16);
...@@ -427,16 +427,16 @@ function StringReplaceRegExpWithFunction(subject, regexp, replace) { ...@@ -427,16 +427,16 @@ function StringReplaceRegExpWithFunction(subject, regexp, replace) {
try { try {
// Must handle exceptions thrown by the replace functions correctly, // Must handle exceptions thrown by the replace functions correctly,
// including unregistering global regexps. // including unregistering global regexps.
var res = %RegExpExecMultiple(regexp, var res = %RegExpExecMultiple(regexp,
subject, subject,
lastMatchInfo, lastMatchInfo,
resultArray); resultArray);
regexp.lastIndex = 0; regexp.lastIndex = 0;
if (IS_NULL(res)) { if (IS_NULL(res)) {
// No matches at all. // No matches at all.
return subject; return subject;
} }
var len = res.length; var len = res.length;
var i = 0; var i = 0;
if (NUMBER_OF_CAPTURES(lastMatchInfo) == 2) { if (NUMBER_OF_CAPTURES(lastMatchInfo) == 2) {
var match_start = 0; var match_start = 0;
...@@ -457,8 +457,8 @@ function StringReplaceRegExpWithFunction(subject, regexp, replace) { ...@@ -457,8 +457,8 @@ function StringReplaceRegExpWithFunction(subject, regexp, replace) {
match_start += elem.length; match_start += elem.length;
} }
i++; i++;
} }
} else { } else {
while (i < len) { while (i < len) {
var elem = res[i]; var elem = res[i];
if (!%_IsSmi(elem)) { if (!%_IsSmi(elem)) {
...@@ -484,7 +484,7 @@ function StringReplaceRegExpWithFunction(subject, regexp, replace) { ...@@ -484,7 +484,7 @@ function StringReplaceRegExpWithFunction(subject, regexp, replace) {
} else { // Not a global regexp, no need to loop. } else { // Not a global regexp, no need to loop.
var matchInfo = DoRegExpExec(regexp, subject, 0); var matchInfo = DoRegExpExec(regexp, subject, 0);
if (IS_NULL(matchInfo)) return subject; if (IS_NULL(matchInfo)) return subject;
var result = new ReplaceResultBuilder(subject); var result = new ReplaceResultBuilder(subject);
result.addSpecialSlice(0, matchInfo[CAPTURE0]); result.addSpecialSlice(0, matchInfo[CAPTURE0]);
var endOfMatch = matchInfo[CAPTURE1]; var endOfMatch = matchInfo[CAPTURE1];
...@@ -520,7 +520,7 @@ function ApplyReplacementFunction(replace, matchInfo, subject) { ...@@ -520,7 +520,7 @@ function ApplyReplacementFunction(replace, matchInfo, subject) {
// ECMA-262 section 15.5.4.12 // ECMA-262 section 15.5.4.12
function StringSearch(re) { function StringSearch(re) {
var regexp = new $RegExp(re); var regexp = new $RegExp(re);
var s = TO_STRING_INLINE(this); var s = TO_STRING_INLINE(this);
var match = DoRegExpExec(regexp, s, 0); var match = DoRegExpExec(regexp, s, 0);
......
...@@ -244,7 +244,7 @@ function URIDecode(uri) { ...@@ -244,7 +244,7 @@ function URIDecode(uri) {
if (cc == 61) return true; if (cc == 61) return true;
// ?@ // ?@
if (63 <= cc && cc <= 64) return true; if (63 <= cc && cc <= 64) return true;
return false; return false;
}; };
var string = ToString(uri); var string = ToString(uri);
...@@ -268,7 +268,7 @@ function isAlphaNumeric(cc) { ...@@ -268,7 +268,7 @@ function isAlphaNumeric(cc) {
if (65 <= cc && cc <= 90) return true; if (65 <= cc && cc <= 90) return true;
// 0 - 9 // 0 - 9
if (48 <= cc && cc <= 57) return true; if (48 <= cc && cc <= 57) return true;
return false; return false;
} }
...@@ -293,7 +293,7 @@ function URIEncode(uri) { ...@@ -293,7 +293,7 @@ function URIEncode(uri) {
if (cc == 95) return true; if (cc == 95) return true;
// ~ // ~
if (cc == 126) return true; if (cc == 126) return true;
return false; return false;
}; };
...@@ -316,7 +316,7 @@ function URIEncodeComponent(component) { ...@@ -316,7 +316,7 @@ function URIEncodeComponent(component) {
if (cc == 95) return true; if (cc == 95) return true;
// ~ // ~
if (cc == 126) return true; if (cc == 126) return true;
return false; return false;
}; };
...@@ -327,14 +327,14 @@ function URIEncodeComponent(component) { ...@@ -327,14 +327,14 @@ function URIEncodeComponent(component) {
function HexValueOf(c) { function HexValueOf(c) {
var code = c.charCodeAt(0); var code = c.charCodeAt(0);
// 0-9 // 0-9
if (code >= 48 && code <= 57) return code - 48; if (code >= 48 && code <= 57) return code - 48;
// A-F // A-F
if (code >= 65 && code <= 70) return code - 55; if (code >= 65 && code <= 70) return code - 55;
// a-f // a-f
if (code >= 97 && code <= 102) return code - 87; if (code >= 97 && code <= 102) return code - 87;
return -1; return -1;
} }
......
...@@ -482,7 +482,7 @@ PropertyDescriptor.prototype.hasSetter = function() { ...@@ -482,7 +482,7 @@ PropertyDescriptor.prototype.hasSetter = function() {
// ES5 section 8.12.1. // ES5 section 8.12.1.
function GetOwnProperty(obj, p) { function GetOwnProperty(obj, p) {
var desc = new PropertyDescriptor(); var desc = new PropertyDescriptor();
// An array with: // An array with:
// obj is a data property [false, value, Writeable, Enumerable, Configurable] // obj is a data property [false, value, Writeable, Enumerable, Configurable]
// obj is an accessor [true, Get, Set, Enumerable, Configurable] // obj is an accessor [true, Get, Set, Enumerable, Configurable]
...@@ -522,7 +522,7 @@ function HasProperty(obj, p) { ...@@ -522,7 +522,7 @@ function HasProperty(obj, p) {
} }
// ES5 8.12.9. // ES5 8.12.9.
function DefineOwnProperty(obj, p, desc, should_throw) { function DefineOwnProperty(obj, p, desc, should_throw) {
var current = GetOwnProperty(obj, p); var current = GetOwnProperty(obj, p);
var extensible = %IsExtensible(ToObject(obj)); var extensible = %IsExtensible(ToObject(obj));
...@@ -558,7 +558,7 @@ function DefineOwnProperty(obj, p, desc, should_throw) { ...@@ -558,7 +558,7 @@ function DefineOwnProperty(obj, p, desc, should_throw) {
} }
} }
// Send flags - enumerable and configurable are common - writable is // Send flags - enumerable and configurable are common - writable is
// only send to the data descriptor. // only send to the data descriptor.
// Take special care if enumerable and configurable is not defined on // Take special care if enumerable and configurable is not defined on
// desc (we need to preserve the existing values from current). // desc (we need to preserve the existing values from current).
...@@ -602,7 +602,7 @@ function ObjectGetPrototypeOf(obj) { ...@@ -602,7 +602,7 @@ function ObjectGetPrototypeOf(obj) {
} }
// ES5 section 15.2.3.3 // ES5 section 15.2.3.3
function ObjectGetOwnPropertyDescriptor(obj, p) { function ObjectGetOwnPropertyDescriptor(obj, p) {
if ((!IS_OBJECT(obj) || IS_NULL_OR_UNDEFINED(obj)) && !IS_FUNCTION(obj) && if ((!IS_OBJECT(obj) || IS_NULL_OR_UNDEFINED(obj)) && !IS_FUNCTION(obj) &&
!IS_UNDETECTABLE(obj)) !IS_UNDETECTABLE(obj))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment