Status: Accepted
Owner: [email protected]
Labels: Type-Bug Priority-Medium

New issue 1470 by [email protected]: API Set with ReadOnly doesn't work with indexed properties
http://code.google.com/p/v8/issues/detail?id=1470

From v8-users mailinglist:

Setting read-only properties using the API does not work correctly when the property is an index.

What will reproduce the issue:
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();

Expected result:
Values of properties zero and one on obj should not change after being set as readonly.

Actual result:
They change value

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to