| Index: test/cctest/test-api.cc
|
| diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
|
| index 1531f905d1b078f6286418e3c0096e98350a8a66..70c08975cc06af79b7ee48a71536912d62c43122 100644
|
| --- a/test/cctest/test-api.cc
|
| +++ b/test/cctest/test-api.cc
|
| @@ -6885,11 +6885,12 @@ THREADED_TEST(SetPrototype) {
|
| }
|
|
|
|
|
| -THREADED_TEST(SetPrototypeProperties) {
|
| +THREADED_TEST(SetPrototypeAttributes) {
|
| v8::HandleScope handle_scope;
|
| LocalContext context;
|
|
|
| Local<v8::FunctionTemplate> t1 = v8::FunctionTemplate::New();
|
| + t1->PrototypeTemplate()->Set(v8_str("x"), v8::Integer::New(42));
|
| t1->SetPrototypeAttributes(v8::DontDelete);
|
| context->Global()->Set(v8_str("func1"), t1->GetFunction());
|
| CHECK(CompileRun(
|
| @@ -6899,8 +6900,10 @@ THREADED_TEST(SetPrototypeProperties) {
|
| " (descriptor['enumerable'] == true) &&"
|
| " (descriptor['configurable'] == false);"
|
| "})()")->BooleanValue());
|
| + CHECK_EQ(42, CompileRun("func1.prototype.x")->Int32Value());
|
|
|
| Local<v8::FunctionTemplate> t2 = v8::FunctionTemplate::New();
|
| + t2->PrototypeTemplate()->Set(v8_str("x"), v8::Integer::New(42));
|
| t2->SetPrototypeAttributes(v8::DontEnum);
|
| context->Global()->Set(v8_str("func2"), t2->GetFunction());
|
| CHECK(CompileRun(
|
| @@ -6910,8 +6913,10 @@ THREADED_TEST(SetPrototypeProperties) {
|
| " (descriptor['enumerable'] == false) &&"
|
| " (descriptor['configurable'] == true);"
|
| "})()")->BooleanValue());
|
| + CHECK_EQ(42, CompileRun("func2.prototype.x")->Int32Value());
|
|
|
| Local<v8::FunctionTemplate> t3 = v8::FunctionTemplate::New();
|
| + t3->PrototypeTemplate()->Set(v8_str("x"), v8::Integer::New(42));
|
| t3->SetPrototypeAttributes(v8::ReadOnly);
|
| context->Global()->Set(v8_str("func3"), t3->GetFunction());
|
| CHECK(CompileRun(
|
| @@ -6921,8 +6926,10 @@ THREADED_TEST(SetPrototypeProperties) {
|
| " (descriptor['enumerable'] == true) &&"
|
| " (descriptor['configurable'] == true);"
|
| "})()")->BooleanValue());
|
| + CHECK_EQ(42, CompileRun("func3.prototype.x")->Int32Value());
|
|
|
| Local<v8::FunctionTemplate> t4 = v8::FunctionTemplate::New();
|
| + t4->PrototypeTemplate()->Set(v8_str("x"), v8::Integer::New(42));
|
| t4->SetPrototypeAttributes(v8::ReadOnly | v8::DontEnum | v8::DontDelete);
|
| context->Global()->Set(v8_str("func4"), t4->GetFunction());
|
| CHECK(CompileRun(
|
| @@ -6932,6 +6939,7 @@ THREADED_TEST(SetPrototypeProperties) {
|
| " (descriptor['enumerable'] == false) &&"
|
| " (descriptor['configurable'] == false);"
|
| "})()")->BooleanValue());
|
| + CHECK_EQ(42, CompileRun("func4.prototype.x")->Int32Value());
|
| }
|
|
|
|
|
|
|