Skip to content

Commit 8a4c04a

Browse files
committed
Merge pull request #197 from lrqdo/exports_promise
directly exports promise
2 parents 0ec2685 + f343678 commit 8a4c04a

File tree

4 files changed

+16
-25
lines changed

4 files changed

+16
-25
lines changed

dist/es6-promise.min.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

dist/es6-promise.js renamed to dist/lib/es6-promise.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
44
* @license Licensed under MIT license
55
* See https://raw.githubusercontent.com/jakearchibald/es6-promise/master/LICENSE
6-
* @version 3.2.2+35df15ea
6+
* @version 3.2.2+39aa2571
77
*/
88

99
(function() {
@@ -940,18 +940,16 @@
940940
}
941941
var lib$es6$promise$polyfill$$default = lib$es6$promise$polyfill$$polyfill;
942942

943-
var lib$es6$promise$umd$$ES6Promise = {
944-
'Promise': lib$es6$promise$promise$$default,
945-
'polyfill': lib$es6$promise$polyfill$$default
946-
};
943+
lib$es6$promise$promise$$default.Promise = lib$es6$promise$promise$$default;
944+
lib$es6$promise$promise$$default.polyfill = lib$es6$promise$polyfill$$default;
947945

948946
/* global define:true module:true window: true */
949947
if (typeof define === 'function' && define['amd']) {
950-
define(function() { return lib$es6$promise$umd$$ES6Promise; });
948+
define(function() { return lib$es6$promise$promise$$default; });
951949
} else if (typeof module !== 'undefined' && module['exports']) {
952-
module['exports'] = lib$es6$promise$umd$$ES6Promise;
950+
module['exports'] = lib$es6$promise$promise$$default;
953951
} else if (typeof this !== 'undefined') {
954-
this['ES6Promise'] = lib$es6$promise$umd$$ES6Promise;
952+
this['Promise'] = lib$es6$promise$promise$$default;
955953
}
956954

957955
lib$es6$promise$polyfill$$default();

lib/es6-promise.umd.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
import Promise from './es6-promise/promise';
22
import polyfill from './es6-promise/polyfill';
33

4-
var ES6Promise = {
5-
'Promise': Promise,
6-
'polyfill': polyfill
7-
};
4+
Promise.Promise = Promise;
5+
Promise.polyfill = polyfill;
86

97
/* global define:true module:true window: true */
108
if (typeof define === 'function' && define['amd']) {
11-
define(function() { return ES6Promise; });
9+
define(function() { return Promise; });
1210
} else if (typeof module !== 'undefined' && module['exports']) {
13-
module['exports'] = ES6Promise;
11+
module['exports'] = Promise;
1412
} else if (typeof this !== 'undefined') {
15-
this['ES6Promise'] = ES6Promise;
13+
this['ES6Promise'] = Promise;
1614
}
1715

1816
polyfill();

test/test-adapter.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@ var assert = require('assert');
22
var g = typeof window !== 'undefined' ?
33
window : typeof global !== 'undefined' ? global : this;
44

5-
var Promise = g.ES6Promise || require('./es6-promise').Promise;
5+
var Promise = g.ES6Promise || require('./es6-promise');
6+
7+
assert(typeof Promise.polyfill === 'function')
8+
assert(typeof Promise.Promise === 'function')
9+
assert(Promise.Promise === Promise)
610

711
function defer() {
812
var deferred = {};

0 commit comments

Comments
 (0)