OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 6646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6657 Local<Value>(), | 6657 Local<Value>(), |
6658 signature)); | 6658 signature)); |
6659 proto->Set(v8_str("x"), v8_num(12)); | 6659 proto->Set(v8_str("x"), v8_num(12)); |
6660 | 6660 |
6661 instance->SetAccessor(v8_str("y"), ShadowYGetter, ShadowYSetter); | 6661 instance->SetAccessor(v8_str("y"), ShadowYGetter, ShadowYSetter); |
6662 | 6662 |
6663 Local<Value> o = t->GetFunction()->NewInstance(); | 6663 Local<Value> o = t->GetFunction()->NewInstance(); |
6664 context->Global()->Set(v8_str("__proto__"), o); | 6664 context->Global()->Set(v8_str("__proto__"), o); |
6665 | 6665 |
6666 Local<Value> value = | 6666 Local<Value> value = |
6667 Script::Compile(v8_str("propertyIsEnumerable(0)"))->Run(); | 6667 Script::Compile(v8_str("this.propertyIsEnumerable(0)"))->Run(); |
6668 CHECK(value->IsBoolean()); | 6668 CHECK(value->IsBoolean()); |
6669 CHECK(!value->BooleanValue()); | 6669 CHECK(!value->BooleanValue()); |
6670 | 6670 |
6671 value = Script::Compile(v8_str("x"))->Run(); | 6671 value = Script::Compile(v8_str("x"))->Run(); |
6672 CHECK_EQ(12, value->Int32Value()); | 6672 CHECK_EQ(12, value->Int32Value()); |
6673 | 6673 |
6674 value = Script::Compile(v8_str("f()"))->Run(); | 6674 value = Script::Compile(v8_str("f()"))->Run(); |
6675 CHECK_EQ(42, value->Int32Value()); | 6675 CHECK_EQ(42, value->Int32Value()); |
6676 | 6676 |
6677 Script::Compile(v8_str("y = 42"))->Run(); | 6677 Script::Compile(v8_str("y = 42"))->Run(); |
(...skipping 7822 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14500 | 14500 |
14501 THREADED_TEST(CallAPIFunctionOnNonObject) { | 14501 THREADED_TEST(CallAPIFunctionOnNonObject) { |
14502 v8::HandleScope scope; | 14502 v8::HandleScope scope; |
14503 LocalContext context; | 14503 LocalContext context; |
14504 Handle<FunctionTemplate> templ = v8::FunctionTemplate::New(NonObjectThis); | 14504 Handle<FunctionTemplate> templ = v8::FunctionTemplate::New(NonObjectThis); |
14505 Handle<Function> function = templ->GetFunction(); | 14505 Handle<Function> function = templ->GetFunction(); |
14506 context->Global()->Set(v8_str("f"), function); | 14506 context->Global()->Set(v8_str("f"), function); |
14507 TryCatch try_catch; | 14507 TryCatch try_catch; |
14508 CompileRun("f.call(2)"); | 14508 CompileRun("f.call(2)"); |
14509 } | 14509 } |
OLD | NEW |