Index: src/messages.js |
diff --git a/src/messages.js b/src/messages.js |
index a111660bc44804d28d9700088fc45dd963396bc0..712dba428adc6b2c9c3750117a7bc87d62ff57a6 100644 |
--- a/src/messages.js |
+++ b/src/messages.js |
@@ -5,7 +5,12 @@ |
// ------------------------------------------------------------------- |
var $errorToString; |
+var $getStackTraceLine; |
var $internalErrorSymbol; |
+var $messageGetPositionInLine; |
+var $messageGetLineNumber; |
+var $messageGetSourceLine; |
+var $stackOverflowBoilerplate; |
var $stackTraceSymbol; |
var MakeError; |
var MakeEvalError; |
@@ -208,16 +213,6 @@ |
} |
-//Returns the offset of the given position within the containing line. |
-function GetColumnNumber(message) { |
- var script = %MessageGetScript(message); |
- var start_position = %MessageGetStartPosition(message); |
- var location = script.locationFromPosition(start_position, true); |
- if (location == null) return -1; |
- return location.column; |
-} |
- |
- |
// Returns the source code line containing the given source |
// position, or the empty string if the position is invalid. |
function GetSourceLine(message) { |
@@ -227,7 +222,6 @@ |
if (location == null) return ""; |
return location.sourceText(); |
} |
- |
/** |
* Find a line number given a specific source position. |
@@ -560,6 +554,17 @@ |
["script", "from_line", "to_line", "from_position", "to_position"], |
["sourceText", SourceSliceSourceText] |
); |
+ |
+ |
+// Returns the offset of the given position within the containing |
+// line. |
+function GetPositionInLine(message) { |
+ var script = %MessageGetScript(message); |
+ var start_position = %MessageGetStartPosition(message); |
+ var location = script.locationFromPosition(start_position, true); |
+ if (location == null) return -1; |
+ return location.column; |
+} |
function GetStackTraceLine(recv, fun, pos, isGlobal) { |
@@ -1000,6 +1005,9 @@ |
['toString', ErrorToString]); |
$errorToString = ErrorToString; |
+$messageGetPositionInLine = GetPositionInLine; |
+$messageGetLineNumber = GetLineNumber; |
+$messageGetSourceLine = GetSourceLine; |
MakeError = function(type, arg0, arg1, arg2) { |
return MakeGenericError(GlobalError, type, arg0, arg1, arg2); |
@@ -1023,8 +1031,8 @@ |
// Boilerplate for exceptions for stack overflows. Used from |
// Isolate::StackOverflow(). |
-var StackOverflowBoilerplate = MakeRangeError(kStackOverflow); |
-%DefineAccessorPropertyUnchecked(StackOverflowBoilerplate, 'stack', |
+$stackOverflowBoilerplate = MakeRangeError(kStackOverflow); |
+%DefineAccessorPropertyUnchecked($stackOverflowBoilerplate, 'stack', |
StackTraceGetter, StackTraceSetter, |
DONT_ENUM); |
@@ -1051,10 +1059,6 @@ |
to.NoSideEffectToString = NoSideEffectToString; |
to.ToDetailString = ToDetailString; |
to.MakeError = MakeGenericError; |
- to.MessageGetLineNumber = GetLineNumber; |
- to.MessageGetColumnNumber = GetColumnNumber; |
- to.MessageGetSourceLine = GetSourceLine; |
- to.StackOverflowBoilerplate = StackOverflowBoilerplate; |
}); |
}); |