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 20290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
20301 | 20301 |
20302 // Chaining non-pending promises. | 20302 // Chaining non-pending promises. |
20303 CompileRun( | 20303 CompileRun( |
20304 "var x1 = 0;\n" | 20304 "var x1 = 0;\n" |
20305 "var x2 = 0;\n" | 20305 "var x2 = 0;\n" |
20306 "function f1(x) { x1 = x; return x+1 };\n" | 20306 "function f1(x) { x1 = x; return x+1 };\n" |
20307 "function f2(x) { x2 = x; return x+1 };\n"); | 20307 "function f2(x) { x2 = x; return x+1 };\n"); |
20308 Handle<Function> f1 = Handle<Function>::Cast(global->Get(v8_str("f1"))); | 20308 Handle<Function> f1 = Handle<Function>::Cast(global->Get(v8_str("f1"))); |
20309 Handle<Function> f2 = Handle<Function>::Cast(global->Get(v8_str("f2"))); | 20309 Handle<Function> f2 = Handle<Function>::Cast(global->Get(v8_str("f2"))); |
20310 | 20310 |
20311 // Chain | 20311 // Chain --- DISABLED |
Dan Ehrenberg
2015/11/12 22:08:19
TODO?
caitp (gmail)
2015/11/13 22:00:31
Acknowledged.
| |
20312 q->Chain(f1); | 20312 /* q->Chain(f1); |
20313 CHECK(global->Get(v8_str("x1"))->IsNumber()); | 20313 CHECK(global->Get(v8_str2("x1"))->IsNumber()); |
20314 CHECK_EQ(0, global->Get(v8_str("x1"))->Int32Value()); | 20314 CHECK_EQ(0, global->Get(v8_str("x1"))->Int32Value()); |
20315 isolate->RunMicrotasks(); | 20315 isolate->RunMicrotasks(); |
20316 CHECK(!global->Get(v8_str("x1"))->IsNumber()); | 20316 CHECK(!global->Get(v8_str("x1"))->IsNumber()); |
20317 CHECK(p->Equals(global->Get(v8_str("x1")))); | 20317 CHECK(p->Equals(global->Get(v8_str("x1")))); */ |
20318 | 20318 |
20319 // Then | 20319 // Then |
20320 CompileRun("x1 = x2 = 0;"); | 20320 CompileRun("x1 = x2 = 0;"); |
20321 q->Then(f1); | 20321 q->Then(f1); |
20322 CHECK_EQ(0, global->Get(v8_str("x1"))->Int32Value()); | 20322 CHECK_EQ(0, global->Get(v8_str("x1"))->Int32Value()); |
20323 isolate->RunMicrotasks(); | 20323 isolate->RunMicrotasks(); |
20324 CHECK_EQ(1, global->Get(v8_str("x1"))->Int32Value()); | 20324 CHECK_EQ(1, global->Get(v8_str("x1"))->Int32Value()); |
20325 | 20325 |
20326 // Then | 20326 // Then |
20327 CompileRun("x1 = x2 = 0;"); | 20327 CompileRun("x1 = x2 = 0;"); |
(...skipping 1752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
22080 env2->Global()->Set(v8_str("obj2"), object2); | 22080 env2->Global()->Set(v8_str("obj2"), object2); |
22081 ExpectString("typeof obj2.values", "function"); | 22081 ExpectString("typeof obj2.values", "function"); |
22082 CHECK_NE(*object->Get(v8_str("values")), *object2->Get(v8_str("values"))); | 22082 CHECK_NE(*object->Get(v8_str("values")), *object2->Get(v8_str("values"))); |
22083 | 22083 |
22084 auto values2 = Local<Function>::Cast(object2->Get(v8_str("values"))); | 22084 auto values2 = Local<Function>::Cast(object2->Get(v8_str("values"))); |
22085 auto fn2 = i::Handle<i::JSFunction>::cast(v8::Utils::OpenHandle(*values2)); | 22085 auto fn2 = i::Handle<i::JSFunction>::cast(v8::Utils::OpenHandle(*values2)); |
22086 auto ctx2 = v8::Utils::OpenHandle(*env2.local()); | 22086 auto ctx2 = v8::Utils::OpenHandle(*env2.local()); |
22087 CHECK_EQ(fn2->GetCreationContext(), *ctx2); | 22087 CHECK_EQ(fn2->GetCreationContext(), *ctx2); |
22088 } | 22088 } |
22089 } | 22089 } |
OLD | NEW |