Sha256: b45e93bb0a80ddf2dd7852aa488f677e6b13d437fae0688b2324ec49b51781e6

Contents?: true

Size: 1.68 KB

Versions: 34

Compression:

Stored size: 1.68 KB

Contents

var global    = require('./$.global')
  , core      = require('./$.core')
  , ctx       = require('./$.ctx')
  , PROTOTYPE = 'prototype';

var $export = function(type, name, source){
  var IS_FORCED = type & $export.F
    , IS_GLOBAL = type & $export.G
    , IS_STATIC = type & $export.S
    , IS_PROTO  = type & $export.P
    , IS_BIND   = type & $export.B
    , IS_WRAP   = type & $export.W
    , exports   = IS_GLOBAL ? core : core[name] || (core[name] = {})
    , target    = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE]
    , key, own, out;
  if(IS_GLOBAL)source = name;
  for(key in source){
    // contains in native
    own = !IS_FORCED && target && key in target;
    if(own && key in exports)continue;
    // export native or passed
    out = own ? target[key] : source[key];
    // prevent global pollution for namespaces
    exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]
    // bind timers to global for call from export context
    : IS_BIND && own ? ctx(out, global)
    // wrap global constructors for prevent change them in library
    : IS_WRAP && target[key] == out ? (function(C){
      var F = function(param){
        return this instanceof C ? new C(param) : C(param);
      };
      F[PROTOTYPE] = C[PROTOTYPE];
      return F;
    // make static versions for prototype methods
    })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
    if(IS_PROTO)(exports[PROTOTYPE] || (exports[PROTOTYPE] = {}))[key] = out;
  }
};
// type bitmap
$export.F = 1;  // forced
$export.G = 2;  // global
$export.S = 4;  // static
$export.P = 8;  // proto
$export.B = 16; // bind
$export.W = 32; // wrap
module.exports = $export;

Version data entries

34 entries across 17 versions & 7 rubygems

Version Path
ilog-0.4.1 node_modules/core-js/modules/library/$.export.js
ilog-0.4.1 node_modules/core-js/library/modules/$.export.js
ilog-0.4.0 node_modules/core-js/modules/library/$.export.js
ilog-0.4.0 node_modules/core-js/library/modules/$.export.js
ilog-0.3.3 node_modules/core-js/modules/library/$.export.js
ilog-0.3.3 node_modules/core-js/library/modules/$.export.js
locomotivecms-4.0.0.alpha1 app/javascript/node_modules/fbjs/node_modules/core-js/library/modules/$.export.js
locomotivecms-4.0.0.alpha1 app/javascript/node_modules/fbjs/node_modules/core-js/modules/library/$.export.js
locomotivecms-3.4.0 app/javascript/node_modules/fbjs/node_modules/core-js/library/modules/$.export.js
locomotivecms-3.4.0 app/javascript/node_modules/fbjs/node_modules/core-js/modules/library/$.export.js
cortex-0.1.3 spec/dummy/node_modules/fbjs/node_modules/core-js/library/modules/$.export.js
cortex-0.1.3 spec/dummy/node_modules/fbjs/node_modules/core-js/modules/library/$.export.js
lanes-0.8.0 node_modules/core-js/library/modules/$.export.js
lanes-0.8.0 node_modules/core-js/modules/library/$.export.js
xcodebuild-helper-1.2.5 externals/ios-sim-master/node_modules/core-js/library/modules/$.export.js
xcodebuild-helper-1.2.5 externals/ios-sim-master/node_modules/core-js/modules/library/$.export.js
xcodebuild-helper-1.2.3 externals/ios-sim-master/node_modules/core-js/library/modules/$.export.js
xcodebuild-helper-1.2.3 externals/ios-sim-master/node_modules/core-js/modules/library/$.export.js
babel-schmooze-sprockets-0.1.3 node_modules/core-js/modules/library/$.export.js
babel-schmooze-sprockets-0.1.3 node_modules/core-js/library/modules/$.export.js