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

Side by Side Diff: test/cctest/test-extra.js

Issue 2626793003: [promises] Remove unneeded PromiseCreate function from promise.js (Closed)
Patch Set: Created 3 years, 11 months 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') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 (function (global, binding, v8) { 5 (function (global, binding, v8) {
6 'use strict'; 6 'use strict';
7 binding.testExtraShouldReturnFive = function() { 7 binding.testExtraShouldReturnFive = function() {
8 return 5; 8 return 5;
9 }; 9 };
10 10
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 arrayToTest.splice(0, 1); 46 arrayToTest.splice(0, 1);
47 const slicedArray = arrayToTest.slice(); 47 const slicedArray = arrayToTest.slice();
48 const arraysOK = arrayToTest.length === 2 && arrayToTest[0] === "c" && 48 const arraysOK = arrayToTest.length === 2 && arrayToTest[0] === "c" &&
49 arrayToTest[1] === 1 && slicedArray.length === 2 && 49 arrayToTest[1] === 1 && slicedArray.length === 2 &&
50 slicedArray[0] === "c" && slicedArray[1] === 1; 50 slicedArray[0] === "c" && slicedArray[1] === 1;
51 51
52 binding.testExtraCanUseUtils = function() { 52 binding.testExtraCanUseUtils = function() {
53 const fulfilledPromise = v8.createPromise(); 53 const fulfilledPromise = v8.createPromise();
54 v8.resolvePromise( 54 v8.resolvePromise(
55 fulfilledPromise, 55 fulfilledPromise,
56 hasOwn({ test: 'test' }, 'test') ? 1 : -1 56 hasOwn({ test: 'test' }, 'test') ? 1 : -1,
57 undefined // pass an extra arg to test arguments adapter frame
57 ); 58 );
58 59
59 const fulfilledPromise2 = Promise_resolve(call(function (arg1, arg2) { 60 const fulfilledPromise2 = Promise_resolve(call(function (arg1, arg2) {
60 return (this.prop === arg1 && arg1 === 'value' && arg2) ? 2 : -1; 61 return (this.prop === arg1 && arg1 === 'value' && arg2) ? 2 : -1;
61 }, { prop: 'value' }, 'value', arraysOK)); 62 }, { prop: 'value' }, 'value', arraysOK));
62 63
63 const rejectedPromise = v8.createPromise(); 64 const rejectedPromise = v8.createPromise();
64 v8.rejectPromise(rejectedPromise, apply(function (arg1, arg2) { 65 v8.rejectPromise(rejectedPromise, apply(function (arg1, arg2) {
65 return (arg1 === arg2 && arg2 === 'x') ? 3 : -1; 66 return (arg1 === arg2 && arg2 === 'x') ? 3 : -1;
66 }, null, new v8.InternalPackedArray('x', 'x'))); 67 }, null, new v8.InternalPackedArray('x', 'x')));
67 68
68 const rejectedButHandledPromise = v8.createPromise(); 69 const rejectedButHandledPromise = v8.createPromise();
69 v8.rejectPromise(rejectedButHandledPromise, 4); 70 v8.rejectPromise(rejectedButHandledPromise, 4);
70 v8.markPromiseAsHandled(rejectedButHandledPromise); 71 v8.markPromiseAsHandled(rejectedButHandledPromise);
71 72
72 return { 73 return {
73 privateSymbol: v8.createPrivateSymbol('sym'), 74 privateSymbol: v8.createPrivateSymbol('sym'),
74 fulfilledPromise, // should be fulfilled with 1 75 fulfilledPromise, // should be fulfilled with 1
75 fulfilledPromise2, // should be fulfilled with 2 76 fulfilledPromise2, // should be fulfilled with 2
76 rejectedPromise, // should be rejected with 3 77 rejectedPromise, // should be rejected with 3
77 rejectedButHandledPromise // should be rejected but have a handler 78 rejectedButHandledPromise // should be rejected but have a handler
78 }; 79 };
79 }; 80 };
80 }) 81 })
OLDNEW
« no previous file with comments | « src/js/promise.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698