ember-template-compiler
Advanced tools
+1
-1
@@ -8,3 +8,3 @@ { | ||
| "description": "An npm module for the ember-template-compiler.js file that ships with ember.js", | ||
| "version": "1.3.0-beta.4", | ||
| "version": "1.3.0", | ||
| "repository": { | ||
@@ -11,0 +11,0 @@ "type": "git", |
+6
-1
@@ -15,2 +15,7 @@ | ||
| Additionally you can pass a second argument into `precompile` which will build the precompiled template as an object (`true` or `undefined`) or as a string (`false`). Building as a string is more efficient than building as an object then converting it to a string. | ||
| var input = compiler.precompile(template, false); | ||
| var output = "Ember.TEMPLATES['foo'] = Ember.Handlebars.template(" + input + ");"; | ||
| ##Handlebars Version | ||
@@ -23,3 +28,3 @@ | ||
| To run the tests | ||
| To run the tests you must have the following node packages installed: `jasmine-node`, and `handlebars`. Then run | ||
@@ -26,0 +31,0 @@ npm test |
+18
-2
@@ -6,9 +6,25 @@ var sut = require('../lib/main'); | ||
| describe("ember-template-compiler tests", function() { | ||
| var result, | ||
| template = fs.readFileSync(path.join(path.dirname(fs.realpathSync(__filename)),'file-system', 'app', 'templates', 'foo.handlebars')).toString(); | ||
| it("compiles down a handlebars template", function() { | ||
| var template = fs.readFileSync(path.join(path.dirname(fs.realpathSync(__filename)),'file-system', 'app', 'templates', 'foo.handlebars')).toString(); | ||
| var result = sut.precompile(template).toString(); | ||
| result = sut.precompile(template).toString(); | ||
| expect(result).toContain("outlet"); | ||
| }); | ||
| it("compiles down a handlebars template to a function when asObject isn't defined", function() { | ||
| result = sut.precompile(template); | ||
| expect(typeof(result)).toBe("function"); | ||
| }); | ||
| it("compiles down a handlebars template to a function when passed asObject=true", function() { | ||
| result = sut.precompile(template, true); | ||
| expect(typeof(result)).toBe("function"); | ||
| }); | ||
| it("compiles down a handlebars template to a string when asObject=false", function() { | ||
| result = sut.precompile(template, false); | ||
| expect(typeof(result)).toBe("string"); | ||
| }); | ||
| }); |
@@ -5,3 +5,3 @@ (function() { | ||
| * @overview Ember - JavaScript Application Framework | ||
| * @copyright Copyright 2011-2013 Tilde Inc. and contributors | ||
| * @copyright Copyright 2011-2014 Tilde Inc. and contributors | ||
| * Portions Copyright 2006-2011 Strobe Inc. | ||
@@ -11,3 +11,3 @@ * Portions Copyright 2008-2011 Apple Inc. All rights reserved. | ||
| * See https://raw.github.com/emberjs/ember.js/master/LICENSE | ||
| * @version 1.3.0-beta.4 | ||
| * @version 1.3.0 | ||
| */ | ||
@@ -34,5 +34,11 @@ | ||
| Ember.assert("Ember Handlebars requires Handlebars version 1.0 or 1.1. Include a SCRIPT tag in the HTML HEAD linking to the Handlebars file before you link to Ember.", Handlebars); | ||
| Ember.assert("Ember Handlebars requires Handlebars version 1.0 or 1.1, COMPILER_REVISION expected: 4, got: " + Handlebars.COMPILER_REVISION + " - Please note: Builds of master may have other COMPILER_REVISION values.", Handlebars.COMPILER_REVISION === 4); | ||
| Ember.assert("Ember Handlebars requires Handlebars version 1.0 or 1.1. Include " + | ||
| "a SCRIPT tag in the HTML HEAD linking to the Handlebars file " + | ||
| "before you link to Ember.", Handlebars); | ||
| Ember.assert("Ember Handlebars requires Handlebars version 1.0 or 1.1, " + | ||
| "COMPILER_REVISION expected: 4, got: " + Handlebars.COMPILER_REVISION + | ||
| " - Please note: Builds of master may have other COMPILER_REVISION values.", | ||
| Handlebars.COMPILER_REVISION === 4); | ||
| /** | ||
@@ -118,4 +124,2 @@ Prepares the Handlebars templating library for use inside Ember's view | ||
| /** | ||
| @private | ||
| Returns a helper function that renders the provided ViewClass. | ||
@@ -126,2 +130,3 @@ | ||
| @private | ||
| @method helper | ||
@@ -183,4 +188,2 @@ @for Ember.Handlebars | ||
| /** | ||
| @private | ||
| Override the default buffer for Ember Handlebars. By default, Handlebars | ||
@@ -190,2 +193,3 @@ creates an empty String at the beginning of each invocation and appends to | ||
| @private | ||
| @method appendToBuffer | ||
@@ -238,4 +242,2 @@ @param string {String} | ||
| /** | ||
| @private | ||
| Rewrite simple mustaches from `{{foo}}` to `{{bind "foo"}}`. This means that | ||
@@ -245,2 +247,3 @@ all simple mustaches in Ember's Handlebars will also set up an observer to | ||
| @private | ||
| @method mustache | ||
@@ -247,0 +250,0 @@ @for Ember.Handlebars.Compiler |
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
15636
7.92%291
6.59%1
-50%36
16.13%