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
for(var i=0; i<10; i++) { | |
try { | |
var z = 0; | |
break; | |
} | |
catch(e) { | |
console.log(e); | |
} | |
finally { | |
console.log('gosh, finally'); |
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
module.exports = function(grunt) { | |
grunt.initConfig({ | |
sweetjs: { | |
options: { | |
modules: ['es6-macros'], | |
sourceMap: true, | |
nodeSourceMapSupport: true | |
}, | |
src: { |
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
Now I can do this: | |
% ./build/bin/sjs -p -n 1 destructure.sjs | |
destruct_next var ( arr ) [ x , y ]; | |
Whereas it used to throw an error because it kept trying to convert to a TermTree: | |
% ./bin/sjs -p -n 1 destructure.sjs | |
/Users/james/projects/sweet.js/lib/sweet.js:99 |
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
;; unicode in terminals | |
(defadvice multi-term (after advise-ansi-term-coding-system) | |
(set-buffer-process-coding-system 'utf-8-unix 'utf-8-unix)) | |
(ad-activate 'multi-term) | |
;; no bell | |
(setq visible-bell nil) |
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
macro foo1 { | |
rule { $x } => { | |
var $x | |
} | |
} | |
let var = macro { | |
rule { $x } => { | |
bar($x) | |
} |
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
macro _update { | |
rule { ( .push($val) ) } => { | |
{ $push: $val } | |
} | |
rule { ( .unshift($val) ) } => { | |
{ $unshift: $val } | |
} |
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
var dom = React.DOM; | |
var App = React.createClass({ | |
getInitialState: function() { | |
return { todos: [] }; | |
}, | |
addTodo: function() { | |
this.setState(update(this.state) { | |
todos.push({ value: '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
macro _string { | |
case { _ $x } => { | |
var stx = #{$x}; | |
var val = stx[0].token.value; | |
return [makeValue(val, #{_})]; | |
} | |
} | |
macro foo { | |
rule { $x } => { |
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
window.onerror = function(msg, url, line, col, err) { | |
console.log(err); | |
}; | |
// #1 - err is null: | |
function foo1() { | |
var x = null | |
x.foo; | |
} |
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
*** You have joined channel #webcomponents [12:03] | |
*** Users on #webcomponents: jlongster jkomoros_ ericbidelman Guest76083 | |
joshbavari geekles pickachu cyee GeekShadow Ablu brainproxy qmx | |
kcherkashin__ eddh dfreedm higgins dglazkov mmalecki Domenic_ leptonix | |
addyo mathiasbynens sindresorhus thiagopnts Tudmotu1 bterlson theefer | |
kentaromiura | |
*** #webcomponents modes: +cnt | |
*** #webcomponents was created on 2012-06-29 09:34:49 | |
<dglazkov> yay jlongster!!! | |
<jlongster> haha hi! |
OlderNewer