Index: src/messages.js |
=================================================================== |
--- src/messages.js (revision 4215) |
+++ src/messages.js (working copy) |
@@ -27,7 +27,17 @@ |
// ------------------------------------------------------------------- |
+// |
+// Matches Script::Type from objects.h |
+var TYPE_NATIVE = 0; |
+var TYPE_EXTENSION = 1; |
+var TYPE_NORMAL = 2; |
+// Matches Script::CompilationType from objects.h |
+var COMPILATION_TYPE_HOST = 0; |
+var COMPILATION_TYPE_EVAL = 1; |
+var COMPILATION_TYPE_JSON = 2; |
+ |
// Lazily initialized. |
var kVowelSounds = 0; |
var kCapitalVowelSounds = 0; |
@@ -634,7 +644,7 @@ |
CallSite.prototype.isEval = function () { |
var script = %FunctionGetScript(this.fun); |
- return script && script.compilation_type == 1; |
+ return script && script.compilation_type == COMPILATION_TYPE_EVAL; |
}; |
CallSite.prototype.getEvalOrigin = function () { |
@@ -656,7 +666,7 @@ |
} |
// Maybe this is an evaluation? |
var script = %FunctionGetScript(this.fun); |
- if (script && script.compilation_type == 1) |
+ if (script && script.compilation_type == COMPILATION_TYPE_EVAL) |
return "eval"; |
return null; |
}; |
@@ -712,7 +722,7 @@ |
CallSite.prototype.isNative = function () { |
var script = %FunctionGetScript(this.fun); |
- return script ? (script.type == 0) : false; |
+ return script ? (script.type == TYPE_NATIVE) : false; |
}; |
CallSite.prototype.getPosition = function () { |
@@ -736,7 +746,7 @@ |
var eval_from_script = script.eval_from_script; |
if (eval_from_script) { |
- if (eval_from_script.compilation_type == 1) { |
+ if (eval_from_script.compilation_type == COMPILATION_TYPE_EVAL) { |
// eval script originated from another eval. |
eval_origin += " (eval at " + FormatEvalOrigin(eval_from_script) + ")"; |
} else { |