Skip to content

Instantly share code, notes, and snippets.

@matschaffer
Created March 25, 2010 12:33
Show Gist options
  • Save matschaffer/343501 to your computer and use it in GitHub Desktop.
Save matschaffer/343501 to your computer and use it in GitHub Desktop.
var sys = require('sys'),
buffer = '{"values":[1,2,3]}';
sys.p(JSON.parse(buffer));
sys.puts("Before values extension worked fine.");
require.paths.unshift('express/lib');
require('express');
sys.p(JSON.parse(buffer));
sys.puts("If you see this, it worked. If not, it's busted.");
/* output:
08:35 mat@schaffer: ~/code/expressblog
> node --version
0.1.33
08:35 mat@schaffer: ~/code/expressblog
> GIT_DIR=express/.git git rev-parse HEAD
ab6ad94ec380675793c01aef71a45319d1f41c3a
08:35 mat@schaffer: ~/code/expressblog
> node simpletest.js
{ values: [ 1, 2, 3 ] }
Before values extension worked fine.
TypeError: Cannot set property values of #<an Object> which has only a getter
at Object.parse (native)
at Object.<anonymous> (/Users/mat/code/expressblog/simpletest.js:10:12)
at Module._compile (node.js:721:23)
at node.js:749:20
at fs:51:23
at node.js:810:9
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment