| Index: test/webkit/fast/js/Promise-resolve.js
|
| diff --git a/test/webkit/sort-with-side-effecting-comparisons.js b/test/webkit/fast/js/Promise-resolve.js
|
| similarity index 74%
|
| copy from test/webkit/sort-with-side-effecting-comparisons.js
|
| copy to test/webkit/fast/js/Promise-resolve.js
|
| index 6794e322f5df200658ec6f20bc367228e8874d49..40f313d7619fc0017a26a56c68132315ddc49c96 100644
|
| --- a/test/webkit/sort-with-side-effecting-comparisons.js
|
| +++ b/test/webkit/fast/js/Promise-resolve.js
|
| @@ -1,4 +1,4 @@
|
| -// Copyright 2013 the V8 project authors. All rights reserved.
|
| +// Copyright 2014 the V8 project authors. All rights reserved.
|
| // Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
|
| //
|
| // Redistribution and use in source and binary forms, with or without
|
| @@ -21,22 +21,22 @@
|
| // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
| // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
| -description(
|
| -"Checks that sorting an array with a side-effecting comparison function doesn't trigger assertions."
|
| -);
|
| +// Flags: --harmony
|
| +'use strict';
|
| +description('Test Promise resolution.');
|
|
|
| -var array = [];
|
| +var thisInOnFulfilled;
|
| +var result;
|
|
|
| -for (var i = 0; i < 20000; ++i)
|
| - array.push(i);
|
| -
|
| -array.sort(function(a, b) {
|
| - array.shift();
|
| - if (a < b)
|
| - return -1;
|
| - if (a > b)
|
| - return 1;
|
| - return 0;
|
| +new Promise(function(resolve) {
|
| + resolve('hello');
|
| +}).then(function(localResult) {
|
| + thisInOnFulfilled = this;
|
| + shouldBe('thisInOnFulfilled', 'undefined');
|
| + result = localResult;
|
| + shouldBeEqualToString('result', 'hello');
|
| + finishJSTest();
|
| +}, function() {
|
| + fail('rejected');
|
| + finishJSTest();
|
| });
|
| -
|
| -testPassed("It worked.");
|
|
|