Permalink
Browse files

example: update the abs.js example for node v0.9.x

  • Loading branch information...
1 parent d661436 commit 81e725cf535aa26efa42f1e8501e16cce1caf247 @TooTallNate TooTallNate committed Dec 15, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 example/abs.js
View
@@ -20,10 +20,10 @@ var ref = require('ref')
var funcPtr = ffi.Callback('int', [ 'int' ], Math.abs)
var func = ffi.ForeignFunction(funcPtr, 'int', [ 'int' ])
-function loop() {
+function loop () {
for (var i = 0; i < 100; i++) {
assert.equal(Math.abs(-i), func(-i))
}
- process.nextTick(loop)
+ (typeof setImmediate != 'undefined' ? setImmediate : process.nextTick)(loop)
}
loop()

0 comments on commit 81e725c

Please sign in to comment.