| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 1991 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2002 v8::Local<v8::Value> res = CompileRun("var a = []; a;"); | 2002 v8::Local<v8::Value> res = CompileRun("var a = []; a;"); |
| 2003 i::Handle<i::JSObject> a(v8::Utils::OpenHandle(v8::Object::Cast(*res))); | 2003 i::Handle<i::JSObject> a(v8::Utils::OpenHandle(v8::Object::Cast(*res))); |
| 2004 CHECK(a->map()->instance_descriptors()->IsFixedArray()); | 2004 CHECK(a->map()->instance_descriptors()->IsFixedArray()); |
| 2005 CHECK_GT(i::FixedArray::cast(a->map()->instance_descriptors())->length(), 0); | 2005 CHECK_GT(i::FixedArray::cast(a->map()->instance_descriptors())->length(), 0); |
| 2006 CompileRun("Object.defineProperty(a, 'length', { writable: false });"); | 2006 CompileRun("Object.defineProperty(a, 'length', { writable: false });"); |
| 2007 CHECK_EQ(i::FixedArray::cast(a->map()->instance_descriptors())->length(), 0); | 2007 CHECK_EQ(i::FixedArray::cast(a->map()->instance_descriptors())->length(), 0); |
| 2008 // But we should still have an ExecutableAccessorInfo. | 2008 // But we should still have an ExecutableAccessorInfo. |
| 2009 i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); | 2009 i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); |
| 2010 i::LookupResult lookup(i_isolate); | 2010 i::LookupResult lookup(i_isolate); |
| 2011 i::Handle<i::String> name(v8::Utils::OpenHandle(*v8_str("length"))); | 2011 i::Handle<i::String> name(v8::Utils::OpenHandle(*v8_str("length"))); |
| 2012 i::LookupIterator it(a, name, i::LookupIterator::CHECK_PROPERTY); | 2012 i::LookupIterator it(a, name, i::LookupIterator::OWN_PROPERTY); |
| 2013 CHECK(it.HasProperty()); | 2013 CHECK(it.HasProperty()); |
| 2014 CHECK(it.GetAccessors()->IsExecutableAccessorInfo()); | 2014 CHECK(it.GetAccessors()->IsExecutableAccessorInfo()); |
| 2015 } | 2015 } |
| 2016 | 2016 |
| 2017 | 2017 |
| 2018 THREADED_TEST(EmptyInterceptorBreakTransitions) { | 2018 THREADED_TEST(EmptyInterceptorBreakTransitions) { |
| 2019 v8::HandleScope scope(CcTest::isolate()); | 2019 v8::HandleScope scope(CcTest::isolate()); |
| 2020 Handle<FunctionTemplate> templ = FunctionTemplate::New(CcTest::isolate()); | 2020 Handle<FunctionTemplate> templ = FunctionTemplate::New(CcTest::isolate()); |
| 2021 AddInterceptor(templ, EmptyInterceptorGetter, EmptyInterceptorSetter); | 2021 AddInterceptor(templ, EmptyInterceptorGetter, EmptyInterceptorSetter); |
| 2022 LocalContext env; | 2022 LocalContext env; |
| (...skipping 20935 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 22958 desc = x->GetOwnPropertyDescriptor(v8_str("p1")); | 22958 desc = x->GetOwnPropertyDescriptor(v8_str("p1")); |
| 22959 Local<Function> set = | 22959 Local<Function> set = |
| 22960 Local<Function>::Cast(Local<Object>::Cast(desc)->Get(v8_str("set"))); | 22960 Local<Function>::Cast(Local<Object>::Cast(desc)->Get(v8_str("set"))); |
| 22961 Local<Function> get = | 22961 Local<Function> get = |
| 22962 Local<Function>::Cast(Local<Object>::Cast(desc)->Get(v8_str("get"))); | 22962 Local<Function>::Cast(Local<Object>::Cast(desc)->Get(v8_str("get"))); |
| 22963 CHECK_EQ(v8_num(13), get->Call(x, 0, NULL)); | 22963 CHECK_EQ(v8_num(13), get->Call(x, 0, NULL)); |
| 22964 Handle<Value> args[] = { v8_num(14) }; | 22964 Handle<Value> args[] = { v8_num(14) }; |
| 22965 set->Call(x, 1, args); | 22965 set->Call(x, 1, args); |
| 22966 CHECK_EQ(v8_num(14), get->Call(x, 0, NULL)); | 22966 CHECK_EQ(v8_num(14), get->Call(x, 0, NULL)); |
| 22967 } | 22967 } |
| OLD | NEW |