| Index: src/messages.js
|
| ===================================================================
|
| --- src/messages.js (revision 2460)
|
| +++ src/messages.js (working copy)
|
| @@ -62,12 +62,16 @@
|
| unexpected_eos: "Unexpected end of input",
|
| malformed_regexp: "Invalid regular expression: /%0/: %1",
|
| unterminated_regexp: "Invalid regular expression: missing /",
|
| - regexp_flags: "Cannot supply flags when constructing one RegExp from another",
|
| + regexp_flags: "Cannot supply flags when constructing one " +
|
| + "RegExp from another",
|
| invalid_lhs_in_assignment: "Invalid left-hand side in assignment",
|
| invalid_lhs_in_for_in: "Invalid left-hand side in for-in",
|
| - invalid_lhs_in_postfix_op: "Invalid left-hand side expression in postfix operation",
|
| - invalid_lhs_in_prefix_op: "Invalid left-hand side expression in prefix operation",
|
| - multiple_defaults_in_switch: "More than one default clause in switch statement",
|
| + invalid_lhs_in_postfix_op: "Invalid left-hand side expression in " +
|
| + "postfix operation",
|
| + invalid_lhs_in_prefix_op: "Invalid left-hand side expression in " +
|
| + "prefix operation",
|
| + multiple_defaults_in_switch: "More than one default clause in switch " +
|
| + "statement",
|
| newline_after_throw: "Illegal newline after throw",
|
| redeclaration: "%0 '%1' has already been declared",
|
| no_catch_or_finally: "Missing catch or finally after try",
|
| @@ -85,18 +89,25 @@
|
| non_object_property_call: "Cannot call method '%0' of %1",
|
| with_expression: "%0 has no properties",
|
| illegal_invocation: "Illegal invocation",
|
| - no_setter_in_callback: "Cannot set property %0 of %1 which has only a getter",
|
| - apply_non_function: "Function.prototype.apply was called on %0, which is a %1 and not a function",
|
| - apply_wrong_args: "Function.prototype.apply: Arguments list has wrong type",
|
| - invalid_in_operator_use: "Cannot use 'in' operator to search for '%0' in %1",
|
| - instanceof_function_expected: "Expecting a function in instanceof check, but got %0",
|
| - instanceof_nonobject_proto: "Function has non-object prototype '%0' in instanceof check",
|
| + no_setter_in_callback: "Cannot set property %0 of %1 which has " +
|
| + "only a getter",
|
| + apply_non_function: "Function.prototype.apply was called on %0, " +
|
| + "which is a %1 and not a function",
|
| + apply_wrong_args: "Function.prototype.apply: Arguments list " +
|
| + "has wrong type",
|
| + invalid_in_operator_use: "Cannot use 'in' operator to search for " +
|
| + "'%0' in %1",
|
| + instanceof_function_expected: "Expecting a function in instanceof check, " +
|
| + "but got %0",
|
| + instanceof_nonobject_proto: "Function has non-object prototype '%0' in " +
|
| + "instanceof check",
|
| null_to_object: "Cannot convert null to object",
|
| reduce_no_initial: "Reduce of empty array with no initial value",
|
| // RangeError
|
| invalid_array_length: "Invalid array length",
|
| stack_overflow: "Maximum call stack size exceeded",
|
| - apply_overflow: "Function.prototype.apply cannot support %0 arguments",
|
| + apply_overflow: "Function.prototype.apply cannot support %0 " +
|
| + "arguments",
|
| // SyntaxError
|
| unable_to_parse: "Parse error",
|
| duplicate_regexp_flag: "Duplicate RegExp flag %0",
|
| @@ -125,7 +136,8 @@
|
|
|
|
|
| function ToDetailString(obj) {
|
| - if (obj != null && IS_OBJECT(obj) && obj.toString === $Object.prototype.toString) {
|
| + if (obj != null && IS_OBJECT(obj) &&
|
| + obj.toString === $Object.prototype.toString) {
|
| var constructor = obj.constructor;
|
| if (!constructor) return ToString(obj);
|
| var constructorName = constructor.name;
|
| @@ -290,11 +302,13 @@
|
| * @param {number} opt_line The line within the source. Default value is 0
|
| * @param {number} opt_column The column in within the line. Default value is 0
|
| * @param {number} opt_offset_position The offset from the begining of the
|
| - * source from where the line and column calculation starts. Default value is 0
|
| + * source from where the line and column calculation starts. Default
|
| + * value is 0
|
| * @return {SourceLocation}
|
| * If line is negative or not in the source null is returned.
|
| */
|
| -Script.prototype.locationFromLine = function (opt_line, opt_column, opt_offset_position) {
|
| +Script.prototype.locationFromLine = function (opt_line, opt_column,
|
| + opt_offset_position) {
|
| // Default is the first line in the script. Lines in the script is relative
|
| // to the offset within the resource.
|
| var line = 0;
|
| @@ -321,7 +335,9 @@
|
| return null;
|
| }
|
|
|
| - return this.locationFromPosition(this.line_ends[offset_line + line - 1] + 1 + column); // line > 0 here.
|
| + // line > 0 here.
|
| + return this.locationFromPosition(this.line_ends[offset_line + line - 1] +
|
| + 1 + column);
|
| }
|
| }
|
|
|
| @@ -337,8 +353,12 @@
|
| * invalid
|
| */
|
| Script.prototype.sourceSlice = function (opt_from_line, opt_to_line) {
|
| - var from_line = IS_UNDEFINED(opt_from_line) ? this.line_offset : opt_from_line;
|
| - var to_line = IS_UNDEFINED(opt_to_line) ? this.line_offset + this.lineCount() : opt_to_line
|
| + var from_line =
|
| + IS_UNDEFINED(opt_from_line) ? this.line_offset : opt_from_line;
|
| + var to_line =
|
| + IS_UNDEFINED(opt_to_line) ?
|
| + this.line_offset + this.lineCount() :
|
| + opt_to_line;
|
|
|
| // Adjust according to the offset within the resource.
|
| from_line -= this.line_offset;
|
| @@ -357,7 +377,8 @@
|
| var to_position = to_line == 0 ? 0 : this.line_ends[to_line - 1] + 1;
|
|
|
| // Return a source slice with line numbers re-adjusted to the resource.
|
| - return new SourceSlice(this, from_line + this.line_offset, to_line + this.line_offset,
|
| + return new SourceSlice(this, from_line + this.line_offset,
|
| + to_line + this.line_offset,
|
| from_position, to_position);
|
| }
|
|
|
| @@ -402,10 +423,10 @@
|
| * position : position within the source
|
| * start : position of start of source context (inclusive)
|
| * end : position of end of source context (not inclusive)
|
| - * Source text for the source context is the character interval [start, end[. In
|
| - * most cases end will point to a newline character. It might point just past
|
| - * the final position of the source if the last source line does not end with a
|
| - * newline character.
|
| + * Source text for the source context is the character interval [start, end[.
|
| + * In most cases end will point to a newline character. It might point just
|
| + * past the final position of the source if the last source line does not end
|
| + * with a newline character.
|
| * @param {Script} script The Script object for which this is a location
|
| * @param {number} position Source position for the location
|
| * @param {number} line The line number for the location
|
| @@ -865,7 +886,8 @@
|
| %SetProperty($Error.prototype, 'toString', function toString() {
|
| var type = this.type;
|
| if (type && !this.hasOwnProperty("message")) {
|
| - return this.name + ": " + FormatMessage({ type: type, args: this.arguments });
|
| + return this.name + ": " +
|
| + FormatMessage({ type: type, args: this.arguments });
|
| }
|
| var message = this.message;
|
| return this.name + (message ? (": " + message) : "");
|
|
|