Do not (eagerly) trigger exception in mjsunit.js.

R=jochen@chromium.org

Review URL: https://codereview.chromium.org/301673002

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21518 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
yangguo@chromium.org 2014-05-27 11:53:12 +00:00
parent 9678ff12c6
commit 2097644fcf

View File

@ -371,13 +371,10 @@ var assertUnoptimized;
throw new MjsUnitAssertionError(message);
};
var OptimizationStatus;
try {
OptimizationStatus =
new Function("fun", "sync", "return %GetOptimizationStatus(fun, sync);");
} catch (e) {
OptimizationStatus = function() {
var OptimizationStatus = function(fun, sync_opt) {
try {
return eval("%GetOptimizationStatus(fun, sync_opt);");
} catch (e) {
throw new Error("natives syntax not allowed");
}
}