aboutsummaryrefslogtreecommitdiff
path: root/node_modules/core-js/modules/es6.reflect.construct.js
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2017-04-20 03:09:25 +0200
committerFlorian Dold <florian.dold@gmail.com>2017-04-24 16:14:29 +0200
commit82f2b76e25a4a67e01ec67e5ebe39d14ad771ea8 (patch)
tree965f6eb89b84d65a62b49008fd972c004832ccd1 /node_modules/core-js/modules/es6.reflect.construct.js
parente6e0cbc387c2a77b48e4065c229daa65bf1aa0fa (diff)
Reorganize module loading.
We now use webpack instead of SystemJS, effectively bundling modules into one file (plus commons chunks) for every entry point. This results in a much smaller extension size (almost half). Furthermore we use yarn/npm even for extension run-time dependencies. This relieves us from manually vendoring and building dependencies. It's also easier to understand for new developers familiar with node.
Diffstat (limited to 'node_modules/core-js/modules/es6.reflect.construct.js')
-rw-r--r--node_modules/core-js/modules/es6.reflect.construct.js30
1 files changed, 11 insertions, 19 deletions
diff --git a/node_modules/core-js/modules/es6.reflect.construct.js b/node_modules/core-js/modules/es6.reflect.construct.js
index 96483d708..c3928cd92 100644
--- a/node_modules/core-js/modules/es6.reflect.construct.js
+++ b/node_modules/core-js/modules/es6.reflect.construct.js
@@ -1,29 +1,21 @@
// 26.1.2 Reflect.construct(target, argumentsList [, newTarget])
-var $export = require('./_export')
- , create = require('./_object-create')
- , aFunction = require('./_a-function')
- , anObject = require('./_an-object')
- , isObject = require('./_is-object')
- , fails = require('./_fails')
- , bind = require('./_bind')
- , rConstruct = (require('./_global').Reflect || {}).construct;
+var $ = require('./$')
+ , $export = require('./$.export')
+ , aFunction = require('./$.a-function')
+ , anObject = require('./$.an-object')
+ , isObject = require('./$.is-object')
+ , bind = Function.bind || require('./$.core').Function.prototype.bind;
-// MS Edge supports only 2 arguments and argumentsList argument is optional
+// MS Edge supports only 2 arguments
// FF Nightly sets third argument as `new.target`, but does not create `this` from it
-var NEW_TARGET_BUG = fails(function(){
+$export($export.S + $export.F * require('./$.fails')(function(){
function F(){}
- return !(rConstruct(function(){}, [], F) instanceof F);
-});
-var ARGS_BUG = !fails(function(){
- rConstruct(function(){});
-});
-
-$export($export.S + $export.F * (NEW_TARGET_BUG || ARGS_BUG), 'Reflect', {
+ return !(Reflect.construct(function(){}, [], F) instanceof F);
+}), 'Reflect', {
construct: function construct(Target, args /*, newTarget*/){
aFunction(Target);
anObject(args);
var newTarget = arguments.length < 3 ? Target : aFunction(arguments[2]);
- if(ARGS_BUG && !NEW_TARGET_BUG)return rConstruct(Target, args, newTarget);
if(Target == newTarget){
// w/o altered newTarget, optimization for 0-4 arguments
switch(args.length){
@@ -40,7 +32,7 @@ $export($export.S + $export.F * (NEW_TARGET_BUG || ARGS_BUG), 'Reflect', {
}
// with altered newTarget, not support built-in constructors
var proto = newTarget.prototype
- , instance = create(isObject(proto) ? proto : Object.prototype)
+ , instance = $.create(isObject(proto) ? proto : Object.prototype)
, result = Function.apply.call(Target, instance, args);
return isObject(result) ? result : instance;
}