0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/benchmark/misc
Ben Noordhuis 50177fb13c benchmark: stop v8 benchmark clobbering RegExp
deps/v8/benchmarks/regexp.js clobbers the RegExp global, breaking
util.format() and console.log().  Unclobber it to keep the other
benchmarks working.

Fixes the following error when running benchmark/misc/v8-bench.js:

    $ out/Release/iojs benchmark/misc/v8-bench.js
    util.js:84
        if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) {
            ^
    TypeError: object is not a function
        at Object.exports.debuglog (util.js:84:9)
        at timers.js:12:29
        at NativeModule.compile (node.js:800:5)
        at NativeModule.require (node.js:769:18)
        at net.js:5:14
        at NativeModule.compile (node.js:800:5)
        at NativeModule.require (node.js:769:18)
        at tty.js:4:11
        at NativeModule.compile (node.js:800:5)
        at Function.NativeModule.require (node.js:769:18)

This could alternatively be addressed by caching the RegExp global
in lib/util.js.  That's not a bad approach and I considered it but
doing it for just RegExp and not other globals would be half-baked.

Maybe the more thorough approach where we cache all globals at
start-up is something for a follow-up pull request.

Fixes: https://github.com/iojs/io.js/pull/475
PR-URL: https://github.com/iojs/io.js/pull/489
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Yosuke Furukawa <yosuke.furukawa@gmail.com>
2015-01-18 14:08:29 +01:00
..
function_call benchmark: update misc to new v8 API 2013-08-01 15:02:38 -07:00
child-process-read.js bench: add child process read perf benchmark 2013-03-25 13:16:07 +01:00
domain-fn-args.js domain: forward args to .run(fn) 2014-12-12 12:14:11 +11:00
module-loader.js Remove excessive copyright/license boilerplate 2015-01-12 15:30:28 -08:00
next-tick-breadth.js bench: move next-tick to misc/next-tick-breadth 2013-02-19 14:14:34 -08:00
next-tick-depth.js Remove excessive copyright/license boilerplate 2015-01-12 15:30:28 -08:00
spawn-echo.js bench: Move process_loop to misc/spawn-echo 2013-02-19 14:14:34 -08:00
startup.js bench: Simplify duration arguments to benchmarks 2013-02-19 17:16:55 -08:00
string-creation.js bench: Consistency in benchmark filenames 2013-02-19 17:16:55 -08:00
timers.js bench: Move timers to misc/timers 2013-02-19 14:14:34 -08:00
url.js
v8-bench.js benchmark: stop v8 benchmark clobbering RegExp 2015-01-18 14:08:29 +01:00