Created
November 13, 2013 19:09
-
-
Save jots/7454559 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
#iced = require('iced-coffee-script').iced | |
fs = require("fs") | |
class T | |
constructor: (cb) -> | |
console.log "asdf" | |
await fs.readFile __filename, "utf8", defer(err,res) | |
cb(err,res) | |
module.exports = T |
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
T = require "./t.js" | |
await t = new T defer(err,res) | |
console.log err | |
console.log res |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am also on IcedCoffeeScript version 1.6.3-g
I dropped the ".js" and still got the same error.
I was trying to think of a way to avoid the callback in the constructor, but haven't yet.
The real code is (the bare beginnings of) a DB framework, and I want to get a list of all the tables and their columns to populate an instance variable. await in the constructor seems to be the way to do it so far.