Closed creationix closed 12 years ago
I tried writing an object prototype like this:
StreamPrototype = { pipe: (self, stream) { self.onData = (chunk) { stream:write(chunk) } self.onEnd = () { stream:end() } } }
But the parser says Error on line 2: Expected string or number as object literal's key forcing me to rewrite it as:
Error on line 2: Expected string or number as object literal's key
StreamPrototype = {} StreamPrototype.pipe = (self, stream) { self.onData = (chunk) { stream:write(chunk) } self.onEnd = () { stream:end() } }
Thanks, fixed!
I tried writing an object prototype like this:
But the parser says
Error on line 2: Expected string or number as object literal's key
forcing me to rewrite it as: