Remove FULL_CONTEXT from spec_helper

This commit is contained in:
kpdecker
2013-04-07 16:50:57 -05:00
parent 381c113d66
commit 73f2016a6a
2 changed files with 2 additions and 19 deletions
+1 -1
View File
@@ -421,7 +421,7 @@ describe "Parser" do
end
it "can pass through an already-compiled AST via compile/precompile" do
@context = Handlebars::Spec::FULL_CONTEXT
@context = Handlebars::Spec::CONTEXT
code = 'Handlebars.compile(new Handlebars.AST.ProgramNode([ new Handlebars.AST.ContentNode("Hello")]))();'
@context.eval(code).should == "Hello"
+1 -18
View File
@@ -87,7 +87,7 @@ module Handlebars
end
CompilerContext["compileWithPartial"] = proc do |this, *args|
template, options = args[0], args[1] || nil
FULL_CONTEXT["Handlebars"]["compile"].call(template, options);
context["Handlebars"]["compile"].call(template, options);
end
end
@@ -116,23 +116,6 @@ module Handlebars
end
end
end
FULL_CONTEXT = V8::Context.new
FULL_CONTEXT.instance_eval do |context|
Handlebars::Spec.load_helpers(context);
Handlebars::Spec.js_load(context, 'dist/handlebars.js');
context["Handlebars"]["logger"]["level"] = ENV["DEBUG_JS"] ? context["Handlebars"]["logger"][ENV["DEBUG_JS"]] : 4
context["Handlebars"]["logger"]["log"] = proc do |this, level, str|
logger_level = context["Handlebars"]["logger"]["level"].to_i
if logger_level <= level
puts str
end
end
end
end
end