Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(99)

Side by Side Diff: test/cctest/test-api.cc

Issue 1394463003: [es6] refactor Promise resolution (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: add bug reference to the TODOs Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/js/promise.js ('k') | test/mjsunit/es6/promises.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « src/js/promise.js ('k') | test/mjsunit/es6/promises.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698