Commit 85058ce9 authored by sigurds@chromium.org's avatar sigurds@chromium.org

Set ScopeInfo when compiling for unit tests.

This is required to correctly treat eval in unit tests.

BUG=
R=mstarzinger@chromium.org

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

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@23193 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 1def7567
...@@ -46,6 +46,8 @@ class FunctionTester : public InitializedHandleScope { ...@@ -46,6 +46,8 @@ class FunctionTester : public InitializedHandleScope {
CHECK(Rewriter::Rewrite(&info)); CHECK(Rewriter::Rewrite(&info));
CHECK(Scope::Analyze(&info)); CHECK(Scope::Analyze(&info));
CHECK_NE(NULL, info.scope()); CHECK_NE(NULL, info.scope());
Handle<ScopeInfo> scope_info = ScopeInfo::Create(info.scope(), info.zone());
info.shared_info()->set_scope_info(*scope_info);
EnsureDeoptimizationSupport(&info); EnsureDeoptimizationSupport(&info);
......
...@@ -59,6 +59,9 @@ class ChangesLoweringTester : public GraphBuilderTester<ReturnType> { ...@@ -59,6 +59,9 @@ class ChangesLoweringTester : public GraphBuilderTester<ReturnType> {
CHECK(Rewriter::Rewrite(&info)); CHECK(Rewriter::Rewrite(&info));
CHECK(Scope::Analyze(&info)); CHECK(Scope::Analyze(&info));
CHECK_NE(NULL, info.scope()); CHECK_NE(NULL, info.scope());
Handle<ScopeInfo> scope_info =
ScopeInfo::Create(info.scope(), info.zone());
info.shared_info()->set_scope_info(*scope_info);
Pipeline pipeline(&info); Pipeline pipeline(&info);
Linkage linkage(&info); Linkage linkage(&info);
Handle<Code> code = Handle<Code> code =
......
...@@ -50,6 +50,8 @@ class DeoptCodegenTester { ...@@ -50,6 +50,8 @@ class DeoptCodegenTester {
CHECK(Rewriter::Rewrite(&info)); CHECK(Rewriter::Rewrite(&info));
CHECK(Scope::Analyze(&info)); CHECK(Scope::Analyze(&info));
CHECK_NE(NULL, info.scope()); CHECK_NE(NULL, info.scope());
Handle<ScopeInfo> scope_info = ScopeInfo::Create(info.scope(), info.zone());
info.shared_info()->set_scope_info(*scope_info);
FunctionTester::EnsureDeoptimizationSupport(&info); FunctionTester::EnsureDeoptimizationSupport(&info);
......
...@@ -233,3 +233,15 @@ TEST(ReceiverPatching) { ...@@ -233,3 +233,15 @@ TEST(ReceiverPatching) {
Handle<JSObject> g(T.function->context()->global_object()->global_proxy()); Handle<JSObject> g(T.function->context()->global_object()->global_proxy());
T.CheckCall(g, T.undefined()); T.CheckCall(g, T.undefined());
} }
TEST(CallEval) {
FunctionTester T(
"var x = 42;"
"(function () {"
"function bar() { return eval('x') };"
"return bar;"
"})();");
T.CheckCall(T.Val(42), T.Val("x"), T.undefined());
}
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