Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Commit

Permalink
Update Mustache to v2.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
petetnt committed Dec 29, 2015
1 parent 239c937 commit 371f492
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 10 deletions.
17 changes: 17 additions & 0 deletions src/brackets.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,23 @@ define(function (require, exports, module) {
return CodeMirror;
}
});

// DEPRECATED: Mustache.compile has been deprecated since Mustache 0.8,
// but for now we use a polyfill for it so as to avoid breaking extensions in the
// interim.
Object.defineProperty(window.Mustache, "compile", {
get: function () {
DeprecationWarning.deprecationWarning('Use Mustache.parse(templateName) instead of Mustache.compile. For more information see https://github.com/janl/mustache.js/issues/346.', true);

return function (template) {
Mustache.parse(template);

return function (view, partials) {
return Mustache.render(template, view, partials);
};
};
}
});

// Load modules that self-register and just need to get included in the main project
require("command/DefaultMenus");
Expand Down
12 changes: 4 additions & 8 deletions src/extensibility/ExtensionManagerView.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ define(function (require, exports, module) {
LocalizationUtils = require("utils/LocalizationUtils"),
itemTemplate = require("text!htmlContent/extension-manager-view-item.html");

// Parse item template for future use
Mustache.parse(itemTemplate);

/**
* Creates a view enabling the user to install and manage extensions. Must be initialized
* with initialize(). When the view is closed, dispose() must be called.
Expand All @@ -56,7 +59,6 @@ define(function (require, exports, module) {
var self = this,
result = new $.Deferred();
this.model = model;
this._itemTemplate = Mustache.compile(itemTemplate);
this._itemViews = {};
this.$el = $("<div class='extension-list tab-pane' id='" + this.model.source + "'/>");
this._$emptyMessage = $("<div class='empty-message'/>")
Expand Down Expand Up @@ -100,12 +102,6 @@ define(function (require, exports, module) {
*/
ExtensionManagerView.prototype._$table = null;

/**
* @private
* @type {function} The compiled template we use for rendering items in the extension list.
*/
ExtensionManagerView.prototype._itemTemplate = null;

/**
* @private
* @type {Object.<string, jQueryObject>}
Expand Down Expand Up @@ -336,7 +332,7 @@ define(function (require, exports, module) {
context[helper] = registry_utils[helper];
});

return $(this._itemTemplate(context));
return $(Mustache.render(itemTemplate, context));
};

/**
Expand Down
2 changes: 1 addition & 1 deletion src/thirdparty/CodeMirror
2 changes: 1 addition & 1 deletion src/thirdparty/mustache
Submodule mustache updated 73 files
+20 −0 .eslintrc
+5 −5 .gitignore
+0 −5 .jshintrc
+13 −2 .travis.yml
+8 −0 .zuul.yml
+234 −0 CHANGELOG.md
+0 −43 CHANGES
+2 −1 LICENSE
+50 −0 MIGRATING.md
+334 −143 README.md
+30 −29 Rakefile
+131 −0 bin/mustache
+20 −0 bower.json
+22 −0 hooks/install-hooks.sh
+89 −0 hooks/pre-commit
+474 −381 mustache.js
+1 −1 mustache.js.nuspec
+1 −0 mustache.min.js
+46 −7 package.json
+1 −0 spec/_files/bom_as_whitespace.js
+1 −0 spec/_files/bom_as_whitespace.mustache
+1 −0 spec/_files/bom_as_whitespace.txt
+4 −0 test/_files/avoids_obj_prototype_in_view_cache.js
+1 −0 test/_files/avoids_obj_prototype_in_view_cache.mustache
+1 −0 test/_files/avoids_obj_prototype_in_view_cache.txt
+3 −0 test/_files/bug_length_property.js
+1 −0 test/_files/bug_length_property.mustache
+1 −0 test/_files/bug_length_property.txt
+3 −0 test/_files/cli.json
+1 −0 test/_files/cli.mustache
+1 −0 test/_files/cli.txt
+14 −0 test/_files/cli_with_partials.json
+7 −0 test/_files/cli_with_partials.mustache
+2 −0 test/_files/cli_with_partials.txt
+1 −1 test/_files/escaped.js
+1 −1 test/_files/escaped.txt
+10 −0 test/_files/falsy_array.js
+3 −0 test/_files/falsy_array.mustache
+6 −0 test/_files/falsy_array.txt
+8 −0 test/_files/implicit_iterator.js
+7 −0 test/_files/implicit_iterator.mustache
+3 −0 test/_files/implicit_iterator.txt
+1 −0 test/_files/nested_dot.js
+1 −0 test/_files/nested_dot.mustache
+1 −0 test/_files/nested_dot.txt
+9 −0 test/_files/null_lookup_array.js
+3 −0 test/_files/null_lookup_array.mustache
+3 −0 test/_files/null_lookup_array.txt
+31 −0 test/_files/null_lookup_object.js
+9 −0 test/_files/null_lookup_object.mustache
+7 −0 test/_files/null_lookup_object.txt
+7 −0 test/_files/section_functions_in_partials.js
+3 −0 test/_files/section_functions_in_partials.mustache
+1 −0 test/_files/section_functions_in_partials.partial
+3 −0 test/_files/section_functions_in_partials.txt
+30 −0 test/_files/uses_props_from_view_prototype.js
+1 −0 test/_files/uses_props_from_view_prototype.mustache
+1 −0 test/_files/uses_props_from_view_prototype.txt
+1 −0 test/_files/zero_view.js
+1 −0 test/_files/zero_view.mustache
+1 −0 test/_files/zero_view.txt
+116 −0 test/cli-test.js
+14 −4 test/context-test.js
+14 −0 test/create-browser-suite.js
+3 −1 test/helper.js
+2 −2 test/mustache-spec-test.js
+1 −1 test/parse-test.js
+55 −0 test/render-helper.js
+38 −0 test/render-test-browser-tmpl.mustache
+17 −50 test/render-test.js
+0 −43 test/writer-test.js
+3 −3 wrappers/qooxdoo/mustache.js.post
+61 −23 wrappers/qooxdoo/mustache.js.pre

0 comments on commit 371f492

Please sign in to comment.