Skip to content

Commit

Permalink
fix error message because of Chrome 49 Promise subclassing bug, close
Browse files Browse the repository at this point in the history
  • Loading branch information
zloirock committed Jan 9, 2016
1 parent ceec0ed commit 7dfea35
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions library/modules/es6.promise.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ var $ = require('./_')
, Internal, GenericPromiseCapability, Wrapper;

var testResolve = function(sub){
var test = new $Promise(function(){});
var test = new $Promise(function(){}), promise;
if(sub)test.constructor = Object;
return $Promise.resolve(test) === test;
(promise = $Promise.resolve(test))['catch'](function(){});
return promise === test;
};

var USE_NATIVE = function(){
Expand Down
5 changes: 3 additions & 2 deletions modules/es6.promise.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ var $ = require('./_')
, Internal, GenericPromiseCapability, Wrapper;

var testResolve = function(sub){
var test = new $Promise(function(){});
var test = new $Promise(function(){}), promise;
if(sub)test.constructor = Object;
return $Promise.resolve(test) === test;
(promise = $Promise.resolve(test))['catch'](function(){});
return promise === test;
};

var USE_NATIVE = function(){
Expand Down

0 comments on commit 7dfea35

Please sign in to comment.