53 if (is_initialized_) {
59 void Check(
const char* source,
60 int get,
int set,
int has,
73 void InitializeIfNeeded();
78 return function->InstanceTemplate();
105 : is_initialized_(
false), get_count_(0), set_count_(0), query_count_(0) {
111 if (is_initialized_)
return;
120 context_ = Context::New(0, function->InstanceTemplate(),
Local<Value>());
122 is_initialized_ =
true;
127 int get,
int set,
int query,
137 Local<Value> result = Script::Compile(String::New(source))->Run();
159 context->get_count_++;
160 return context->
Get(key);
168 context->set_count_++;
169 return context->
Set(key, value);
176 context->query_count_++;
177 return context->
Query(key);
208 context.
Check(
"var x; x",
216 context.
Check(
"var x = 0; x",
224 context.
Check(
"function x() { }; x",
232 context.
Check(
"const x; x",
240 context.
Check(
"const x = 0; x",
263 context.
Check(
"var x; x",
271 context.
Check(
"var x = 0; x",
279 context.
Check(
"function x() { }; x",
287 context.
Check(
"const x; x",
295 context.
Check(
"const x = 0; x",
317 context.
Check(
"var x; x",
325 context.
Check(
"var x = 0; x",
333 context.
Check(
"function x() { }; x",
341 context.
Check(
"const x; x",
349 context.
Check(
"const x = 0; x",
357 context.
Check(
"if (false) { var x = 0 }; x",
407 context.
Check(
"var x; x",
415 context.
Check(
"var x = 0; x",
423 context.
Check(
"function x() { }; x",
431 context.
Check(
"const x; x",
439 context.
Check(
"const x = 0; x",
499 context.
Check(
"const x; var x = 0",
518 return function->PrototypeTemplate();
524 i::FLAG_es52_globals =
true;
530 context.
Check(
"this.x = 87; this.x",
538 context.
Check(
"var x; x",
546 context.
Check(
"var x = 0; x",
554 context.
Check(
"const x; x",
562 context.
Check(
"const x = 0; x",
581 return function->PrototypeTemplate();
587 i::FLAG_es52_globals =
true;
591 context.
Check(
"if (false) { var x = 0; }; x",
#define CHECK_EQ(expected, value)
static v8::Handle< Value > HandleGet(Local< String > key, const AccessorInfo &info)
Local< Value > Exception() const
void InitializeIfNeeded()
virtual v8::Handle< Integer > Query(Local< String > key)
virtual v8::Handle< Integer > Query(Local< String > key)
virtual v8::Handle< Integer > Query(Local< String > key)
void SetVerbose(bool value)
virtual v8::Handle< Integer > Query(Local< String > key)
ReappearingPropertyContext()
static v8::Handle< Integer > HandleQuery(Local< String > key, const AccessorInfo &info)
void Check(const char *source, int get, int set, int has, Expectations expectations, v8::Handle< Value > value=Local< Value >())
static v8::Handle< Value > HandleSet(Local< String > key, Local< Value > value, const AccessorInfo &info)
virtual ~DeclarationContext()
virtual Local< ObjectTemplate > GetHolder(Local< FunctionTemplate > function)
virtual v8::Handle< Value > Get(Local< String > key)
virtual v8::Handle< Integer > Query(Local< String > key)
virtual v8::Handle< Integer > Query(Local< String > key)
AppearingPropertyContext()
virtual Local< ObjectTemplate > GetHolder(Local< FunctionTemplate > function)
virtual v8::Handle< Integer > Query(Local< String > key)
Handle< Primitive > V8EXPORT Undefined()
Local< Value > Data() const
virtual v8::Handle< Value > Set(Local< String > key, Local< Value > value)
virtual Local< ObjectTemplate > GetHolder(Local< FunctionTemplate > function)