majgis/ngify

Using strings for the annotation keys throws an exception

majgis opened this issue · 0 comments

This works (notice the annotation keys are not strings):

function channel () {

}

exports = module.exports = channel;

exports['@ng'] = {
    type: 'controller',
    name: 'channel'
};

This doesn't work:

function channel () {

}

exports = module.exports = channel;

exports['@ng'] = {
    'type': 'controller',
    'name': 'channel'
};

Here is the error:

events.js:85
throw er; // Unhandled 'error' event
^
TypeError: (ngify) Invalid non-string/buffer chunk while parsing file: /home/projects/ngradio/ngradio.js while parsing file: /home/projects/ngradio/ngradio.js
at validChunk (/home/projects/ngradio/node_modules/browserify/node_modules/readable-stream/lib/_stream_writable.js:180:14)
at DestroyableTransform.Writable.write (/home/projects/ngradio/node_modules/browserify/node_modules/readable-stream/lib/_stream_writable.js:209:12)
at Stream.ondata (stream.js:51:26)
at Stream.emit (events.js:107:17)
at drain (/home/projects/ngradio/node_modules/ngify/node_modules/through/index.js:36:16)
at Stream.stream.queue.stream.push (/home/projects/ngradio/node_modules/ngify/node_modules/through/index.js:45:5)
at NgifyJsStreamReader.end (/home/projects/ngradio/node_modules/ngify/lib/NgifyJavaScriptStreamReader.js:18:16)
at Stream.end (/home/projects/ngradio/node_modules/ngify/lib/ngify.js:23:22)
at _end (/home/projects/ngradio/node_modules/ngify/node_modules/through/index.js:65:9)
at Stream.stream.end (/home/projects/ngradio/node_modules/ngify/node_modules/through/index.js:74:5)