Skip to content

Instantly share code, notes, and snippets.

@xingrz
Created January 23, 2013 15:52
Show Gist options
  • Save xingrz/4608504 to your computer and use it in GitHub Desktop.
Save xingrz/4608504 to your computer and use it in GitHub Desktop.
A依赖B,C依赖B,C直接修改了B中的属性,A中的B的属性会不会被改变?
var b = require('./b')
console.log(b.val)
process.nextTick(function () {
var c = require('./c')
console.log(b.val)
})
exports.val = 1
var b = require('./b')
b.val = 2
$ node a.js
1
2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment