Constants should be readOnly and DontDelete

pull/22966/head
Fedor Indutny 2010-08-30 16:04:31 +07:00 committed by Ryan Dahl
parent 635986e433
commit db23af05b0
1 changed files with 2 additions and 1 deletions

View File

@ -25,7 +25,8 @@ namespace node {
#define NODE_DEFINE_CONSTANT(target, constant) \
(target)->Set(v8::String::NewSymbol(#constant), \
v8::Integer::New(constant))
v8::Integer::New(constant), \
static_cast<v8::PropertyAttribute>(v8::ReadOnly|v8::DontDelete))
#define NODE_SET_METHOD(obj, name, callback) \
obj->Set(v8::String::NewSymbol(name), \