zlib: make constants keep readonly
authorJackson Tian <puling.tyq@alibaba-inc.com>
Tue, 7 Apr 2015 05:48:52 +0000 (13:48 +0800)
committerShigeki Ohtsu <ohtsu@iij.ad.jp>
Tue, 7 Apr 2015 14:38:55 +0000 (23:38 +0900)
commit372bf83818fd87bae5ad7cedadfa121ddc5d4345
tree4d22770786a27fb489b00738cc63fbc4ea016e92
parentd726a177ed59c37cf5306983ed00ecd858cfbbef
zlib: make constants keep readonly

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>
lib/zlib.js
test/parallel/test-zlib-const.js [new file with mode: 0644]