Skip to content

Commit

Permalink
Make benchmark work with node 0.6
Browse files Browse the repository at this point in the history
node 0.6 does not support require.paths anymore
this also adds npm script targets so test and benchmark can be run more easily

http://code.google.com/p/esprima/issues/detail?id=122
  • Loading branch information
Swatinem authored and ariya committed Jan 5, 2012
1 parent 3d67ffd commit aa84b0f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,10 @@
"devDependencies": {
"mocha": ">= 0.8.1",
"should": ">= 0.4.2"
},
"scripts": {
"test": "node_modules/.bin/mocha test/test.js",
"benchmark": "node test/benchmarks.js",
"benchmark-quick": "node test/benchmarks.js quick"
}
}
3 changes: 1 addition & 2 deletions test/benchmarks.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,8 @@ if (typeof window !== 'undefined') {

(function () {
'use strict';
require.paths.push(__dirname + '/3rdparty/');
var fs = require('fs'),
Benchmark = require('benchmark'),
Benchmark = require('./3rdparty/benchmark'),
esprima = require('../esprima'),
option = process.argv[2];

Expand Down

0 comments on commit aa84b0f

Please sign in to comment.