Skip to content

Commit

Permalink
2.1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
zloirock committed Mar 12, 2016
1 parent 234a518 commit 4369fbb
Show file tree
Hide file tree
Showing 16 changed files with 210 additions and 195 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
## Changelog
##### 2.1.5 - 2016.03.12
- Improved support NodeJS domains in `Promise#then`, [#180](https://github.com/zloirock/core-js/issues/180)
- Added fallback for `Date#toJSON` bug in Qt Script, [#173](https://github.com/zloirock/core-js/issues/173#issuecomment-193972502)

##### 2.1.4 - 2016.03.08
- Added fallback for `Symbol` polyfill in Qt Script, [#173](https://github.com/zloirock/core-js/issues/173)
- Added one more fallback for IE11 `Script Access Denied` error with iframes, [#165](https://github.com/zloirock/core-js/issues/165)
Expand Down
90 changes: 45 additions & 45 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "core.js",
"main": "client/core.js",
"version": "2.1.4",
"version": "2.1.5",
"description": "Standard Library",
"keywords": [
"ES3",
Expand Down
4 changes: 2 additions & 2 deletions build/core-js-builder/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "core-js-builder",
"description": "core-js builder",
"version": "2.1.4",
"version": "2.1.5",
"repository": {
"type": "git",
"url": "https://github.com/zloirock/core-js.git"
},
"main": "index.js",
"dependencies": {
"core-js": "2.1.4",
"core-js": "2.1.5",
"webpack": "1.12.x",
"temp": "0.8.x"
},
Expand Down
94 changes: 49 additions & 45 deletions client/core.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* core-js 2.1.4
* core-js 2.1.5
* https://github.com/zloirock/core-js
* License: http://rock.mit-license.org
* © 2016 Denis Pushkarev
Expand Down Expand Up @@ -483,7 +483,7 @@
/* 3 */
/***/ function(module, exports) {

var core = module.exports = {version: '2.1.4'};
var core = module.exports = {version: '2.1.5'};
if(typeof __e == 'number')__e = core; // eslint-disable-line no-undef

/***/ },
Expand Down Expand Up @@ -3861,6 +3861,7 @@
, TypeError = global.TypeError
, process = global.process
, $Promise = global[PROMISE]
, process = global.process
, isNode = classof(process) == 'process'
, empty = function(){ /* empty */ }
, Internal, GenericPromiseCapability, Wrapper;
Expand Down Expand Up @@ -3918,14 +3919,20 @@
var handler = ok ? reaction.ok : reaction.fail
, resolve = reaction.resolve
, reject = reaction.reject
, domain = reaction.domain
, result, then;
try {
if(handler){
if(!ok){
if(promise._h == 2)onHandleUnhandled(promise);
promise._h = 1;
}
result = handler === true ? value : handler(value);
if(handler === true)result = value;
else {
if(domain)domain.enter();
result = handler(value);
if(domain)domain.exit();
}
if(result === reaction.promise){
reject(TypeError('Promise-chain cycle'));
} else if(then = isThenable(result)){
Expand Down Expand Up @@ -4044,9 +4051,10 @@
Internal.prototype = __webpack_require__(198)($Promise.prototype, {
// 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)
then: function then(onFulfilled, onRejected){
var reaction = newPromiseCapability(speciesConstructor(this, $Promise));
reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;
reaction.fail = typeof onRejected == 'function' && onRejected;
var reaction = newPromiseCapability(speciesConstructor(this, $Promise));
reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;
reaction.fail = typeof onRejected == 'function' && onRejected;
reaction.domain = isNode ? process.domain : undefined;
this._c.push(reaction);
if(this._a)this._a.push(reaction);
if(this._s)notify(this, false);
Expand Down Expand Up @@ -4266,17 +4274,11 @@
, head, last, notify;

var flush = function(){
var parent, domain, fn;
if(isNode && (parent = process.domain)){
process.domain = null;
parent.exit();
}
var parent, fn;
if(isNode && (parent = process.domain))parent.exit();
while(head){
domain = head.domain;
fn = head.fn;
if(domain)domain.enter();
fn = head.fn;
fn(); // <- currently we use it only for Promise - try / catch not required
if(domain)domain.exit();
head = head.next;
} last = undefined;
if(parent)parent.enter();
Expand All @@ -4289,11 +4291,11 @@
};
// browsers with MutationObserver
} else if(Observer){
var toggle = 1
var toggle = true
, node = document.createTextNode('');
new Observer(flush).observe(node, {characterData: true}); // eslint-disable-line no-new
notify = function(){
node.data = toggle = -toggle;
node.data = toggle = !toggle;
};
// environments with maybe non-completely correct, but existent Promise
} else if(Promise && Promise.resolve){
Expand All @@ -4314,7 +4316,7 @@
}

module.exports = function(fn){
var task = {fn: fn, next: undefined, domain: isNode && process.domain};
var task = {fn: fn, next: undefined};
if(last)last.next = task;
if(!head){
head = task;
Expand Down Expand Up @@ -5100,22 +5102,26 @@
// 20.3.3.1 / 15.9.4.4 Date.now()
var $export = __webpack_require__(7);

$export($export.S, 'Date', {now: function(){ return +new Date; }});
$export($export.S, 'Date', {now: function(){ return new Date().getTime(); }});

/***/ },
/* 222 */
/***/ function(module, exports, __webpack_require__) {

var DateProto = Date.prototype
, INVALID_DATE = 'Invalid Date'
, TO_STRING = 'toString'
, $toString = DateProto[TO_STRING];
if(new Date(NaN) + '' != INVALID_DATE){
__webpack_require__(16)(DateProto, TO_STRING, function toString(){
var value = +this;
return value === value ? $toString.call(this) : INVALID_DATE;
});
}
'use strict';
var $export = __webpack_require__(7)
, toObject = __webpack_require__(54)
, toPrimitive = __webpack_require__(14);

$export($export.P + $export.F * __webpack_require__(6)(function(){
return new Date(NaN).toJSON() !== null || Date.prototype.toJSON.call({toISOString: function(){ return 1; }}) !== 1;
}), 'Date', {
toJSON: function toJSON(key){
var O = toObject(this)
, pv = toPrimitive(O);
return typeof pv == 'number' && !isFinite(pv) ? null : O.toISOString();
}
});

/***/ },
/* 223 */
Expand All @@ -5124,7 +5130,8 @@
'use strict';
// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString()
var $export = __webpack_require__(7)
, fails = __webpack_require__(6);
, fails = __webpack_require__(6)
, getTime = Date.prototype.getTime;

var lz = function(num){
return num > 9 ? num : '0' + num;
Expand All @@ -5137,7 +5144,7 @@
new Date(NaN).toISOString();
})), 'Date', {
toISOString: function toISOString(){
if(!isFinite(this))throw RangeError('Invalid time value');
if(!isFinite(getTime.call(this)))throw RangeError('Invalid time value');
var d = this
, y = d.getUTCFullYear()
, m = d.getUTCMilliseconds()
Expand All @@ -5153,20 +5160,17 @@
/* 224 */
/***/ function(module, exports, __webpack_require__) {

'use strict';
var $export = __webpack_require__(7)
, toObject = __webpack_require__(54)
, toPrimitive = __webpack_require__(14);

$export($export.P + $export.F * __webpack_require__(6)(function(){
return new Date(NaN).toJSON() !== null || Date.prototype.toJSON.call({toISOString: function(){ return 1; }}) !== 1;
}), 'Date', {
toJSON: function toJSON(key){
var O = toObject(this)
, pv = toPrimitive(O);
return typeof pv == 'number' && !isFinite(pv) ? null : O.toISOString();
}
});
var DateProto = Date.prototype
, INVALID_DATE = 'Invalid Date'
, TO_STRING = 'toString'
, $toString = DateProto[TO_STRING]
, getTime = DateProto.getTime;
if(new Date(NaN) + '' != INVALID_DATE){
__webpack_require__(16)(DateProto, TO_STRING, function toString(){
var value = getTime.call(this);
return value === value ? $toString.call(this) : INVALID_DATE;
});
}

/***/ },
/* 225 */
Expand Down
8 changes: 4 additions & 4 deletions client/core.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/core.min.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit 4369fbb

Please sign in to comment.