mirror of https://github.com/lukechilds/node.git
Browse Source
In zlib module, a dozen constants were exported to user land, If user change the constant, maybe lead unexcepted error. Make them readonly and freezon. PR-URL: https://github.com/iojs/io.js/pull/1361 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Johan Bergström <bugs@bergstroem.nu> Reviewed-By: Shigeki Ohtsu <ohtsu@iij.ad.jp>v1.8.0-commit
committed by
Shigeki Ohtsu
2 changed files with 28 additions and 4 deletions
@ -0,0 +1,16 @@ |
|||
var common = require('../common'); |
|||
var assert = require('assert'); |
|||
|
|||
var zlib = require('zlib'); |
|||
|
|||
assert.equal(zlib.Z_OK, 0, 'Z_OK should be 0'); |
|||
zlib.Z_OK = 1; |
|||
assert.equal(zlib.Z_OK, 0, 'Z_OK should be 0'); |
|||
|
|||
assert.equal(zlib.codes.Z_OK, 0, 'Z_OK should be 0'); |
|||
zlib.codes.Z_OK = 1; |
|||
assert.equal(zlib.codes.Z_OK, 0, 'zlib.codes.Z_OK should be 0'); |
|||
zlib.codes = {Z_OK: 1}; |
|||
assert.equal(zlib.codes.Z_OK, 0, 'zlib.codes.Z_OK should be 0'); |
|||
|
|||
assert.ok(Object.isFrozen(zlib.codes), 'zlib.codes should be frozen'); |
Loading…
Reference in new issue