Skip to content

Commit

Permalink
Replace removed API with new version
Browse files Browse the repository at this point in the history
  • Loading branch information
StorytellerCZ committed Apr 15, 2022
1 parent dc2cad0 commit 22962a6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion packages/blaze/builtins.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ Blaze._TemplateWith = function (arg, contentFunc) {
// parent Views in the current template. However, when there's an argument
// (`{{> Template.contentBlock arg}}`), the argument needs to be evaluated
// in the original scope. There's no good order to nest
// Blaze._InOuterTemplateScope and Spacebars.TemplateWith to achieve this,
// Blaze._InOuterTemplateScope and Blaze._TemplateWith to achieve this,
// so we wrap argFunc to run it in the "original parentView" of the
// Blaze._InOuterTemplateScope.
//
Expand Down
30 changes: 15 additions & 15 deletions packages/spacebars-tests/old_templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ Template.__define__("old_spacebars_template_test_triple2", (function() {

Template.__define__("old_spacebars_template_test_inclusion_args", (function() {
var view = this;
return Spacebars.TemplateWith(function() {
return Blaze._TemplateWith(function() {
return Spacebars.call(view.lookup("bar"));
}, function() {
return Spacebars.include(view.lookupTemplate("foo"));
Expand All @@ -134,7 +134,7 @@ Template.__define__("old_spacebars_template_test_inclusion_args", (function() {

Template.__define__("old_spacebars_template_test_inclusion_args2", (function() {
var view = this;
return Spacebars.TemplateWith(function() {
return Blaze._TemplateWith(function() {
return Spacebars.dataMustache(view.lookup("bar"), Spacebars.kw({
q: view.lookup("baz")
}));
Expand All @@ -145,7 +145,7 @@ Template.__define__("old_spacebars_template_test_inclusion_args2", (function() {

Template.__define__("old_spacebars_template_test_inclusion_dotted_args", (function() {
var view = this;
return Spacebars.TemplateWith(function() {
return Blaze._TemplateWith(function() {
return Spacebars.call(Spacebars.dot(view.lookup("bar"), "baz"));
}, function() {
return Spacebars.include(view.lookupTemplate("foo"));
Expand All @@ -154,7 +154,7 @@ Template.__define__("old_spacebars_template_test_inclusion_dotted_args", (functi

Template.__define__("old_spacebars_template_test_inclusion_slashed_args", (function() {
var view = this;
return Spacebars.TemplateWith(function() {
return Blaze._TemplateWith(function() {
return Spacebars.call(Spacebars.dot(view.lookup("bar"), "baz"));
}, function() {
return Spacebars.include(view.lookupTemplate("foo"));
Expand All @@ -172,7 +172,7 @@ Template.__define__("old_spacebars_template_test_block_helper", (function() {

Template.__define__("old_spacebars_template_test_block_helper_function_one_string_arg", (function() {
var view = this;
return Spacebars.TemplateWith(function() {
return Blaze._TemplateWith(function() {
return "bar";
}, function() {
return Spacebars.include(view.lookupTemplate("foo"), function() {
Expand All @@ -183,7 +183,7 @@ Template.__define__("old_spacebars_template_test_block_helper_function_one_strin

Template.__define__("old_spacebars_template_test_block_helper_function_one_helper_arg", (function() {
var view = this;
return Spacebars.TemplateWith(function() {
return Blaze._TemplateWith(function() {
return Spacebars.call(view.lookup("bar"));
}, function() {
return Spacebars.include(view.lookupTemplate("foo"), function() {
Expand Down Expand Up @@ -212,7 +212,7 @@ Template.__define__("old_spacebars_template_test_block_helper_component_three_he

Template.__define__("old_spacebars_template_test_block_helper_dotted_arg", (function() {
var view = this;
return Spacebars.TemplateWith(function() {
return Blaze._TemplateWith(function() {
return Spacebars.dataMustache(Spacebars.dot(view.lookup("bar"), "baz"), view.lookup("qux"));
}, function() {
return Spacebars.include(view.lookupTemplate("foo"), function() {
Expand All @@ -223,7 +223,7 @@ Template.__define__("old_spacebars_template_test_block_helper_dotted_arg", (func

Template.__define__("old_spacebars_template_test_nested_content", (function() {
var view = this;
return Spacebars.TemplateWith(function() {
return Blaze._TemplateWith(function() {
return {
condition: Spacebars.call(view.lookup("flag"))
};
Expand All @@ -238,7 +238,7 @@ Template.__define__("old_spacebars_template_test_nested_content", (function() {

Template.__define__("old_spacebars_template_test_iftemplate2", (function() {
var view = this;
return Spacebars.TemplateWith(function() {
return Blaze._TemplateWith(function() {
return {
condition: Spacebars.call(view.lookup("flag"))
};
Expand All @@ -261,7 +261,7 @@ Template.__define__("old_spacebars_template_test_iftemplate2", (function() {

Template.__define__("old_spacebars_template_test_nested_content2", (function() {
var view = this;
return Spacebars.TemplateWith(function() {
return Blaze._TemplateWith(function() {
return {
flag: Spacebars.call(view.lookup("x"))
};
Expand Down Expand Up @@ -333,7 +333,7 @@ Template.__define__("old_spacebars_template_test_dots", (function() {
return [ "\n C\n ", Blaze.Each(function() {
return Spacebars.call(view.lookup("items"));
}, function() {
return [ "\n D\n \n ", Spacebars.include(view.lookupTemplate("old_spacebars_template_test_dots_subtemplate")), "\n ", Spacebars.TemplateWith(function() {
return [ "\n D\n \n ", Spacebars.include(view.lookupTemplate("old_spacebars_template_test_dots_subtemplate")), "\n ", Blaze._TemplateWith(function() {
return Spacebars.call(view.lookup(".."));
}, function() {
return Spacebars.include(view.lookupTemplate("old_spacebars_template_test_dots_subtemplate"));
Expand Down Expand Up @@ -882,7 +882,7 @@ Template.__define__("old_spacebars_template_test_content_context", (function() {
return [ "\n ", Spacebars.With(function() {
return Spacebars.call(view.lookup("bar"));
}, function() {
return [ "\n ", Spacebars.TemplateWith(function() {
return [ "\n ", Blaze._TemplateWith(function() {
return {
condition: Spacebars.call(view.lookup("cond"))
};
Expand Down Expand Up @@ -1184,7 +1184,7 @@ Template.__define__("old_spacebars_test_falsy_with", (function() {

Template.__define__("old_spacebars_test_helpers_dont_leak", (function() {
var view = this;
return Spacebars.TemplateWith(function() {
return Blaze._TemplateWith(function() {
return {
foo: Spacebars.call("correct")
};
Expand Down Expand Up @@ -1480,7 +1480,7 @@ Template.__define__("old_spacebars_test_template_created_rendered_destroyed_each
return Blaze.Each(function() {
return Spacebars.call(view.lookup("items"));
}, function() {
return [ "\n ", HTML.DIV(Spacebars.TemplateWith(function() {
return [ "\n ", HTML.DIV(Blaze._TemplateWith(function() {
return Spacebars.call(view.lookup("_id"));
}, function() {
return Spacebars.include(view.lookupTemplate("old_spacebars_test_template_created_rendered_destroyed_each_sub"));
Expand Down Expand Up @@ -1688,7 +1688,7 @@ Template.__define__("old_spacebars_test_contentBlock_arg_inner", (function() {
return [ "\n ", Blaze.View(function() {
return Spacebars.mustache(Spacebars.dot(view.lookup("."), "foo"));
}), " ", Blaze.InOuterTemplateScope(view, function() {
return Spacebars.TemplateWith(function() {
return Blaze._TemplateWith(function() {
return Spacebars.call(view.lookup("."));
}, function() {
return Spacebars.include(function() {
Expand Down

0 comments on commit 22962a6

Please sign in to comment.