46 using ::v8::Extension;
48 using ::v8::FunctionTemplate;
50 using ::v8::HandleScope;
55 using ::v8::ObjectTemplate;
56 using ::v8::Persistent;
58 using ::v8::StackTrace;
65 static void ExpectInt32(
int32_t expected, Local<Value> result) {
66 CHECK(result->IsInt32());
67 CHECK_EQ(expected, result->Int32Value());
75 Local<Value> result = CompileRun(
77 "function f0() { return x; }"
79 ExpectInt32(0, result);
87 Local<Value> result = CompileRun(
88 "function f1(x) { return x; }"
90 ExpectInt32(1, result);
95 TEST(stack_allocated_locals) {
98 Local<Value> result = CompileRun(
99 "function f2() { var x = 2; return x; }"
101 ExpectInt32(2, result);
106 TEST(context_allocated_locals) {
109 Local<Value> result = CompileRun(
111 " function g() { return x; }"
115 ExpectInt32(3, result);
120 TEST(read_from_outer_context) {
123 Local<Value> result = CompileRun(
125 " function g() { return x; }"
129 ExpectInt32(4, result);
137 Local<Value> result = CompileRun(
139 " with ({}) return x;"
142 ExpectInt32(5, result);
#define CHECK_EQ(expected, value)
kSerializedDataOffset Object
void(* MessageCallback)(Handle< Message > message, Handle< Value > error)
v8::Isolate * GetIsolate()
V8_INLINE Handle< Primitive > Undefined(Isolate *isolate)