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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 v8::HandleScope scope(CcTest::isolate()); | 99 v8::HandleScope scope(CcTest::isolate()); |
100 v8::Handle<v8::Context> env = v8::Context::New(CcTest::isolate()); | 100 v8::Handle<v8::Context> env = v8::Context::New(CcTest::isolate()); |
101 env->Enter(); | 101 env->Enter(); |
102 Handle<Object> o = Test(); | 102 Handle<Object> o = Test(); |
103 CHECK(o->IsSmi() && Smi::cast(*o)->value() == 42); | 103 CHECK(o->IsSmi() && Smi::cast(*o)->value() == 42); |
104 env->Exit(); | 104 env->Exit(); |
105 } | 105 } |
106 | 106 |
107 | 107 |
108 void TestGetter( | 108 void TestGetter( |
109 v8::Local<v8::String> name, | 109 v8::Local<v8::Name> name, |
110 const v8::PropertyCallbackInfo<v8::Value>& info) { | 110 const v8::PropertyCallbackInfo<v8::Value>& info) { |
111 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(info.GetIsolate()); | 111 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(info.GetIsolate()); |
112 HandleScope scope(isolate); | 112 HandleScope scope(isolate); |
113 info.GetReturnValue().Set(v8::Utils::ToLocal(Test())); | 113 info.GetReturnValue().Set(v8::Utils::ToLocal(Test())); |
114 } | 114 } |
115 | 115 |
116 | 116 |
117 void TestSetter( | 117 void TestSetter( |
118 v8::Local<v8::String> name, | 118 v8::Local<v8::Name> name, |
119 v8::Local<v8::Value> value, | 119 v8::Local<v8::Value> value, |
120 const v8::PropertyCallbackInfo<void>& info) { | 120 const v8::PropertyCallbackInfo<void>& info) { |
121 UNREACHABLE(); | 121 UNREACHABLE(); |
122 } | 122 } |
123 | 123 |
124 | 124 |
125 Handle<AccessorInfo> TestAccessorInfo( | 125 Handle<AccessorInfo> TestAccessorInfo( |
126 Isolate* isolate, PropertyAttributes attributes) { | 126 Isolate* isolate, PropertyAttributes attributes) { |
127 Handle<String> name = isolate->factory()->NewStringFromStaticAscii("get"); | 127 Handle<String> name = isolate->factory()->NewStringFromStaticAscii("get"); |
128 return Accessors::MakeAccessor(isolate, name, &TestGetter, &TestSetter, | 128 return Accessors::MakeAccessor(isolate, name, &TestGetter, &TestSetter, |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 if (index < blocks.length() - 1) { | 229 if (index < blocks.length() - 1) { |
230 blocks[index] = blocks.RemoveLast(); | 230 blocks[index] = blocks.RemoveLast(); |
231 } else { | 231 } else { |
232 blocks.RemoveLast(); | 232 blocks.RemoveLast(); |
233 } | 233 } |
234 } | 234 } |
235 } | 235 } |
236 | 236 |
237 code_range.TearDown(); | 237 code_range.TearDown(); |
238 } | 238 } |
OLD | NEW |