Merge pull request #3165 from grschafer/master

Fix constructor_destructuring docs example to alert a defined value
This commit is contained in:
Jeremy Ashkenas
2013-10-20 08:04:44 -07:00
3 changed files with 8 additions and 2 deletions

View File

@@ -2,3 +2,5 @@ class Person
constructor: (options) ->
{@name, @age, @height} = options
tim = new Person age: 4

View File

@@ -805,7 +805,7 @@ Expressions
Destructuring assignment is also useful when combined with class constructors
to assign properties to your instance from an options object passed to the constructor.
</p>
<%= code_for('constructor_destructuring', 'contents.join("")') %>
<%= code_for('constructor_destructuring', 'tim.age') %>
<p>
<span id="fat-arrow" class="bookmark"></span>

View File

@@ -1,5 +1,5 @@
// Generated by CoffeeScript 1.6.3
var Person;
var Person, tim;
Person = (function() {
function Person(options) {
@@ -9,3 +9,7 @@ Person = (function() {
return Person;
})();
tim = new Person({
age: 4
});