Last active
August 29, 2015 13:55
-
-
Save nalply/8755615 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template name="index"> | |
Test 1: Non-enumerable property by prototype in a Handlebars expression. | |
<br>Expected: «Hello World by prototype» | |
<br>Actual: «{{hello}}» | |
<hr> | |
Test 2: Instance property in a Handlebars expression. | |
<br>Expected: «Hello World by field» | |
<br>Actual: «{{directHello}}» | |
<hr> | |
Test 3: Same non-enumerable property in a Handlebars helper. | |
<br>Expected: «Hello World by prototype» | |
<br>Actual: «{{helperHello}}» | |
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (Meteor.isServer) return | |
function Example() { this.directHello = "Hello World by field" } | |
Object.defineProperty(Example.prototype, 'hello', { | |
value: "Hello World by prototype" | |
}) | |
Router.map(function() { | |
this.route('index', {path: '/', data: function() { return new Example }}) | |
}) | |
Template.index.helperHello = function() { return (new Example).hello } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Test 1: Non-enumerable property by prototype in a Handlebars expression. | |
Expected: «Hello World by prototype» | |
Actual: «» | |
------------------------------------------------------------------------ | |
Test 2: Instance property in a Handlebars expression. | |
Expected: «Hello World by field» | |
Actual: «Hello World by field» | |
------------------------------------------------------------------------ | |
Test 3: Same non-enumerable property in a Handlebars helper. | |
Expected: «Hello World by prototype» | |
Actual: «Hello World by prototype» |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment