Created
May 24, 2011 07:05
-
-
Save cjc/988243 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ node test.js | |
cjcbufferprotoprop | |
cjcstringprotoprop | |
cjcdateprotoprop | |
$ node | |
> require('./proto') | |
{} | |
> new Buffer(1).cjc | |
'cjcbufferprotoprop' | |
> new String('1').cjc | |
> new Date().cjc | |
> String.prototype.__defineGetter__('cjc',function() {return 'cjcstringprotoprop';}); | |
{ cjc: [Getter] } | |
> new String('1').cjc | |
'cjcstringprotoprop' | |
> Date.prototype.__defineGetter__('cjc', function() {return 'cjcdateprotoprop';}); | |
{ cjc: [Getter] } | |
> new Date().cjc | |
'cjcdateprotoprop' | |
> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String.prototype.__defineGetter__('cjc',function() {return 'cjcstringprotoprop';}); | |
Buffer.prototype.__defineGetter__('cjc', function() {return 'cjcbufferprotoprop';}); | |
Date.prototype.__defineGetter__('cjc', function() {return 'cjcdateprotoprop';}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sys = require('sys'); | |
require('./proto'); | |
sys.puts(new Buffer(1).cjc); | |
sys.puts(new String('1').cjc); | |
sys.puts(new Date().cjc); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment