Is it expected that readonly property attribute can only be used with string
property but not indexed property? For example, in this case, readonly flag
is ignored for "0" and "1" key (The same happens with 0 and 1 key as well)
v8::Locker l;
HandleScope hScope;
Persistent<Context> context = Context::New();
{
Context::Scope cScope(context);
Local<Object> obj = Object::New();
Local<String> zero = String::New("0");
Local<String> one = String::New("1");
Local<String> first = String::New("first");
Local<String> second = String::New("second");
obj->Set(first, zero, ReadOnly);
obj->Set(second, one, ReadOnly);
obj->Set(first, one);
obj->Set(second, zero);
obj->Set(zero, zero, ReadOnly);
obj->Set(one, one, ReadOnly);
obj->Set(zero, one);
obj->Set(one, zero);
printf("%s %s\n",
*String::Utf8Value(obj->Get(zero)->ToString()),*String::Utf8Value(obj->Get(first)->ToString()));
printf("%s %s\n",
*String::Utf8Value(obj->Get(one)->ToString()),*String::Utf8Value(obj->Get(second)->ToString()));
}
context.Dispose();
context.Clear();
--
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users