Permalink
Browse files

Merge branch 'release/0.5.4'

  • Loading branch information...
2 parents a3c16a8 + 287c903 commit 674a0d124a1ef0d859b4b977000040df01b21309 @agate agate committed May 16, 2012
View
103 CHANGELOG
@@ -1,92 +1,111 @@
-0.4.6.pre2
-----------
+### 0.5.4
+
+ * added haml filter support
+
+### 0.5.3
+
+ * fixed self problem in bootstrap
+
+### 0.5.2
+
+ * fixed #3
+
+### 0.5.0
+
+ * adding shortcut for returning "=> foo"
+ * sinatra support
+ * removing jsml
+
+### 0.4.6.pre3
+
+ * fixing #590
+
+### 0.4.6.pre2
+
* adding auto return to shortcut mappers
-0.4.6.pre1
-----------
+### 0.4.6.pre1
+
* adding shortcut mappers
-0.4.5
-----------
+### 0.4.5
+
* merged 0.4.4.pre1 changes
-0.4.4 (yanked)
-----------
+### 0.4.4 (yanked)
+
* fixed gem package build error
* fixed npm bin execute probelm
* added ms-parse and ms-run in gem's bin dir
* improved gem/npm publish command
-0.4.4.pre1
-----------
+### 0.4.4.pre1
+
* added self to methods
-0.4.3.pre5
-----------
+### 0.4.3.pre4
-0.4.3.pre4
-----------
* fixing node bin files
-0.4.3.pre
----------
+### 0.4.3.pre
+
* adding jsml support
* dog-fooding
* took out string interpolation for heredocs for now
-0.4.0
------
+### 0.4.0
+
* adding experimental export and public classes for common.js
-0.4.0.pre14
------------
+### 0.4.0.pre14
+
* lookback error when no spacing
-0.4.0.pre13
------------
+### 0.4.0.pre13
+
* lookback off by 1
* added pp for printing tree
-0.4.0.pre12
------------
+### 0.4.0.pre12
+
* regex bug
* rails support
-0.4.0.pre11
------------
+### 0.4.0.pre11
+
* adding boot strap for web browsers
-0.4.0.pre10
------------
+### 0.4.0.pre10
+
* multi-line comment parsing fix
-0.4.0.pre8
-----------
+### 0.4.0.pre8
+
* adding filename to module._compile for better debugging
-0.4.0.pre7
-----------
+### 0.4.0.pre7
+
* added node adapter for system calls
-0.4.0.pre6
-----------
+### 0.4.0.pre6
+
* fixed divide/regex bug with spacing
-0.4.0.pre5
-----------
+### 0.4.0.pre5
+
* fixed bad merge
-0.4.0.pre4
-----------
+### 0.4.0.pre4
+
* fixed foreach length bug
-0.4.0.pre3
-----------
+### 0.4.0.pre3
+
* fixed "module" keyword conflict bug
-0.4.0.pre2
-----------
+### 0.4.0.pre2
+
* adding static var/function
* adding jsml
* adding divide/regex parsing support
View
@@ -3,4 +3,4 @@ source "http://rubygems.org"
gem 'rspec'
gem 'therubyracer'
gem 'json'
-gemspec
+#gemspec
View
@@ -62,8 +62,10 @@ In main.js:
var obj = new Hello();
obj.say();
-More on Syntax
---------------
+
+## More on Syntax
+
+Mochiscript syntax is a superset of JavaScript's. This means that any JavaScript you write will run just fine in Mochiscript. Mochiscript simply adds extra features that make development life a little easier.
## Object Oriented Features
@@ -134,6 +136,84 @@ This is a little unorthodox part of Mochiscript which allows you to add a "close
}
}
+### Accessing "self"
+
+A lot of times, you need access to the "this" object in a callback. The problem is that "this" often points to something else in a different context. The workaround is usually:
+
+ class Foo {
+ var hello = "hello";
+ function setup() {
+ var self = this;
+ $('.hello').click(#{ alert(self.hello) });
+ }
+ }
+
+In mochiscript, it is no longer necessary to create a "self" variable. Its given to you in all methods:
+
+ class Foo {
+ var hello = "hello";
+ function setup() {
+ $('.hello').click(#{ alert(self.hello) });
+ }
+ }
+
+## Syntactic Sugar
+
+### Shorthand Functions
+
+There are two ways to use this feature:
+
+ var myFunct = #{ console.log($1) }; // prints out first argument (supports up to 3 args)
+ var myFunct = #(msg){ console.log(msg) };
+
+### Shorthand returns
+
+ [ 1, 2, 3 ].map(#{ => $1 + 1 });
+
+### Foreach
+
+ var array = [ 'hello', 'world' ];
+ foreach (var word in array) {
+ console.log(word);
+ }
+
+ // foreach with iterator
+ foreach (var word:i in array) {
+ console.log(i, word);
+ }
+
+### Heredocs
+
+ var message = <<END;
+ this is a lot of text
+ here.
+ END
+
+### Enumerable Functions (experimental)
+
+ var greetings = [ 'hi', 'hello' ];
+ var mapped = greetings#map { $1 + " there!" };
+ var some = greetings#some { $1 == 'hi' };
+
+## Node-specific module exporters
+
+Mochiscript has two helpers for exporting your files:
+
+ public class MyClass {
+
+ }
+
+ // equivalent to
+ // exports.MyClass = MyClass;
+
+Or make it the default export:
+
+ export class MyClass {
+
+ }
+
+ // equivalent to
+ // module.exports = MyClass;
Authors
-------
View
@@ -3,7 +3,7 @@ require 'json'
require 'pp'
SRC_DIR = %|./src|
-BOOT = %W| class jsml |
+BOOT = %W| class events |
PARSER = %W| tokens parsers cli |
VERSION = File.read("./VERSION").strip;
View
@@ -1 +1 @@
-0.4.6.pre2
+0.5.4
Oops, something went wrong.

0 comments on commit 674a0d1

Please sign in to comment.