wp/wp-includes/js/dist/warning.js
changeset 19 3d72ae0968f4
parent 18 be944660c56a
child 21 48c4eec2b7e6
equal deleted inserted replaced
18:be944660c56a 19:3d72ae0968f4
     1 this["wp"] = this["wp"] || {}; this["wp"]["warning"] =
     1 /******/ (function() { // webpackBootstrap
     2 /******/ (function(modules) { // webpackBootstrap
     2 /******/ 	"use strict";
     3 /******/ 	// The module cache
     3 /******/ 	// The require scope
     4 /******/ 	var installedModules = {};
     4 /******/ 	var __webpack_require__ = {};
     5 /******/
     5 /******/ 	
     6 /******/ 	// The require function
     6 /************************************************************************/
     7 /******/ 	function __webpack_require__(moduleId) {
     7 /******/ 	/* webpack/runtime/define property getters */
     8 /******/
     8 /******/ 	!function() {
     9 /******/ 		// Check if module is in cache
     9 /******/ 		// define getter functions for harmony exports
    10 /******/ 		if(installedModules[moduleId]) {
    10 /******/ 		__webpack_require__.d = function(exports, definition) {
    11 /******/ 			return installedModules[moduleId].exports;
    11 /******/ 			for(var key in definition) {
    12 /******/ 		}
    12 /******/ 				if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
    13 /******/ 		// Create a new module (and put it into the cache)
    13 /******/ 					Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
    14 /******/ 		var module = installedModules[moduleId] = {
    14 /******/ 				}
    15 /******/ 			i: moduleId,
    15 /******/ 			}
    16 /******/ 			l: false,
       
    17 /******/ 			exports: {}
       
    18 /******/ 		};
    16 /******/ 		};
    19 /******/
    17 /******/ 	}();
    20 /******/ 		// Execute the module function
    18 /******/ 	
    21 /******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
    19 /******/ 	/* webpack/runtime/hasOwnProperty shorthand */
    22 /******/
    20 /******/ 	!function() {
    23 /******/ 		// Flag the module as loaded
    21 /******/ 		__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
    24 /******/ 		module.l = true;
    22 /******/ 	}();
    25 /******/
    23 /******/ 	
    26 /******/ 		// Return the exports of the module
       
    27 /******/ 		return module.exports;
       
    28 /******/ 	}
       
    29 /******/
       
    30 /******/
       
    31 /******/ 	// expose the modules object (__webpack_modules__)
       
    32 /******/ 	__webpack_require__.m = modules;
       
    33 /******/
       
    34 /******/ 	// expose the module cache
       
    35 /******/ 	__webpack_require__.c = installedModules;
       
    36 /******/
       
    37 /******/ 	// define getter function for harmony exports
       
    38 /******/ 	__webpack_require__.d = function(exports, name, getter) {
       
    39 /******/ 		if(!__webpack_require__.o(exports, name)) {
       
    40 /******/ 			Object.defineProperty(exports, name, { enumerable: true, get: getter });
       
    41 /******/ 		}
       
    42 /******/ 	};
       
    43 /******/
       
    44 /******/ 	// define __esModule on exports
       
    45 /******/ 	__webpack_require__.r = function(exports) {
       
    46 /******/ 		if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
       
    47 /******/ 			Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
       
    48 /******/ 		}
       
    49 /******/ 		Object.defineProperty(exports, '__esModule', { value: true });
       
    50 /******/ 	};
       
    51 /******/
       
    52 /******/ 	// create a fake namespace object
       
    53 /******/ 	// mode & 1: value is a module id, require it
       
    54 /******/ 	// mode & 2: merge all properties of value into the ns
       
    55 /******/ 	// mode & 4: return value when already ns object
       
    56 /******/ 	// mode & 8|1: behave like require
       
    57 /******/ 	__webpack_require__.t = function(value, mode) {
       
    58 /******/ 		if(mode & 1) value = __webpack_require__(value);
       
    59 /******/ 		if(mode & 8) return value;
       
    60 /******/ 		if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
       
    61 /******/ 		var ns = Object.create(null);
       
    62 /******/ 		__webpack_require__.r(ns);
       
    63 /******/ 		Object.defineProperty(ns, 'default', { enumerable: true, value: value });
       
    64 /******/ 		if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
       
    65 /******/ 		return ns;
       
    66 /******/ 	};
       
    67 /******/
       
    68 /******/ 	// getDefaultExport function for compatibility with non-harmony modules
       
    69 /******/ 	__webpack_require__.n = function(module) {
       
    70 /******/ 		var getter = module && module.__esModule ?
       
    71 /******/ 			function getDefault() { return module['default']; } :
       
    72 /******/ 			function getModuleExports() { return module; };
       
    73 /******/ 		__webpack_require__.d(getter, 'a', getter);
       
    74 /******/ 		return getter;
       
    75 /******/ 	};
       
    76 /******/
       
    77 /******/ 	// Object.prototype.hasOwnProperty.call
       
    78 /******/ 	__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
       
    79 /******/
       
    80 /******/ 	// __webpack_public_path__
       
    81 /******/ 	__webpack_require__.p = "";
       
    82 /******/
       
    83 /******/
       
    84 /******/ 	// Load entry module and return exports
       
    85 /******/ 	return __webpack_require__(__webpack_require__.s = "WyMB");
       
    86 /******/ })
       
    87 /************************************************************************/
    24 /************************************************************************/
    88 /******/ ({
    25 var __webpack_exports__ = {};
    89 
    26 
    90 /***/ "8oxB":
    27 // EXPORTS
    91 /***/ (function(module, exports) {
    28 __webpack_require__.d(__webpack_exports__, {
       
    29   "default": function() { return /* binding */ warning; }
       
    30 });
    92 
    31 
    93 // shim for using process in browser
    32 ;// CONCATENATED MODULE: ./node_modules/@wordpress/warning/build-module/utils.js
    94 var process = module.exports = {};
    33 /**
       
    34  * Object map tracking messages which have been logged, for use in ensuring a
       
    35  * message is only logged once.
       
    36  *
       
    37  * @type {Set<string>}
       
    38  */
       
    39 const logged = new Set();
    95 
    40 
    96 // cached from whatever global is present so that test runners that stub it
    41 ;// CONCATENATED MODULE: ./node_modules/@wordpress/warning/build-module/index.js
    97 // don't break things.  But we need to wrap it in a try catch in case it is
    42 /**
    98 // wrapped in strict mode code which doesn't define any globals.  It's inside a
    43  * Internal dependencies
    99 // function because try/catches deoptimize in certain engines.
    44  */
   100 
       
   101 var cachedSetTimeout;
       
   102 var cachedClearTimeout;
       
   103 
       
   104 function defaultSetTimout() {
       
   105     throw new Error('setTimeout has not been defined');
       
   106 }
       
   107 function defaultClearTimeout () {
       
   108     throw new Error('clearTimeout has not been defined');
       
   109 }
       
   110 (function () {
       
   111     try {
       
   112         if (typeof setTimeout === 'function') {
       
   113             cachedSetTimeout = setTimeout;
       
   114         } else {
       
   115             cachedSetTimeout = defaultSetTimout;
       
   116         }
       
   117     } catch (e) {
       
   118         cachedSetTimeout = defaultSetTimout;
       
   119     }
       
   120     try {
       
   121         if (typeof clearTimeout === 'function') {
       
   122             cachedClearTimeout = clearTimeout;
       
   123         } else {
       
   124             cachedClearTimeout = defaultClearTimeout;
       
   125         }
       
   126     } catch (e) {
       
   127         cachedClearTimeout = defaultClearTimeout;
       
   128     }
       
   129 } ())
       
   130 function runTimeout(fun) {
       
   131     if (cachedSetTimeout === setTimeout) {
       
   132         //normal enviroments in sane situations
       
   133         return setTimeout(fun, 0);
       
   134     }
       
   135     // if setTimeout wasn't available but was latter defined
       
   136     if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
       
   137         cachedSetTimeout = setTimeout;
       
   138         return setTimeout(fun, 0);
       
   139     }
       
   140     try {
       
   141         // when when somebody has screwed with setTimeout but no I.E. maddness
       
   142         return cachedSetTimeout(fun, 0);
       
   143     } catch(e){
       
   144         try {
       
   145             // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
       
   146             return cachedSetTimeout.call(null, fun, 0);
       
   147         } catch(e){
       
   148             // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
       
   149             return cachedSetTimeout.call(this, fun, 0);
       
   150         }
       
   151     }
       
   152 
    45 
   153 
    46 
   154 }
       
   155 function runClearTimeout(marker) {
       
   156     if (cachedClearTimeout === clearTimeout) {
       
   157         //normal enviroments in sane situations
       
   158         return clearTimeout(marker);
       
   159     }
       
   160     // if clearTimeout wasn't available but was latter defined
       
   161     if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
       
   162         cachedClearTimeout = clearTimeout;
       
   163         return clearTimeout(marker);
       
   164     }
       
   165     try {
       
   166         // when when somebody has screwed with setTimeout but no I.E. maddness
       
   167         return cachedClearTimeout(marker);
       
   168     } catch (e){
       
   169         try {
       
   170             // When we are in I.E. but the script has been evaled so I.E. doesn't  trust the global object when called normally
       
   171             return cachedClearTimeout.call(null, marker);
       
   172         } catch (e){
       
   173             // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
       
   174             // Some versions of I.E. have different rules for clearTimeout vs setTimeout
       
   175             return cachedClearTimeout.call(this, marker);
       
   176         }
       
   177     }
       
   178 
       
   179 
       
   180 
       
   181 }
       
   182 var queue = [];
       
   183 var draining = false;
       
   184 var currentQueue;
       
   185 var queueIndex = -1;
       
   186 
       
   187 function cleanUpNextTick() {
       
   188     if (!draining || !currentQueue) {
       
   189         return;
       
   190     }
       
   191     draining = false;
       
   192     if (currentQueue.length) {
       
   193         queue = currentQueue.concat(queue);
       
   194     } else {
       
   195         queueIndex = -1;
       
   196     }
       
   197     if (queue.length) {
       
   198         drainQueue();
       
   199     }
       
   200 }
       
   201 
       
   202 function drainQueue() {
       
   203     if (draining) {
       
   204         return;
       
   205     }
       
   206     var timeout = runTimeout(cleanUpNextTick);
       
   207     draining = true;
       
   208 
       
   209     var len = queue.length;
       
   210     while(len) {
       
   211         currentQueue = queue;
       
   212         queue = [];
       
   213         while (++queueIndex < len) {
       
   214             if (currentQueue) {
       
   215                 currentQueue[queueIndex].run();
       
   216             }
       
   217         }
       
   218         queueIndex = -1;
       
   219         len = queue.length;
       
   220     }
       
   221     currentQueue = null;
       
   222     draining = false;
       
   223     runClearTimeout(timeout);
       
   224 }
       
   225 
       
   226 process.nextTick = function (fun) {
       
   227     var args = new Array(arguments.length - 1);
       
   228     if (arguments.length > 1) {
       
   229         for (var i = 1; i < arguments.length; i++) {
       
   230             args[i - 1] = arguments[i];
       
   231         }
       
   232     }
       
   233     queue.push(new Item(fun, args));
       
   234     if (queue.length === 1 && !draining) {
       
   235         runTimeout(drainQueue);
       
   236     }
       
   237 };
       
   238 
       
   239 // v8 likes predictible objects
       
   240 function Item(fun, array) {
       
   241     this.fun = fun;
       
   242     this.array = array;
       
   243 }
       
   244 Item.prototype.run = function () {
       
   245     this.fun.apply(null, this.array);
       
   246 };
       
   247 process.title = 'browser';
       
   248 process.browser = true;
       
   249 process.env = {};
       
   250 process.argv = [];
       
   251 process.version = ''; // empty string to avoid regexp issues
       
   252 process.versions = {};
       
   253 
       
   254 function noop() {}
       
   255 
       
   256 process.on = noop;
       
   257 process.addListener = noop;
       
   258 process.once = noop;
       
   259 process.off = noop;
       
   260 process.removeListener = noop;
       
   261 process.removeAllListeners = noop;
       
   262 process.emit = noop;
       
   263 process.prependListener = noop;
       
   264 process.prependOnceListener = noop;
       
   265 
       
   266 process.listeners = function (name) { return [] }
       
   267 
       
   268 process.binding = function (name) {
       
   269     throw new Error('process.binding is not supported');
       
   270 };
       
   271 
       
   272 process.cwd = function () { return '/' };
       
   273 process.chdir = function (dir) {
       
   274     throw new Error('process.chdir is not supported');
       
   275 };
       
   276 process.umask = function() { return 0; };
       
   277 
       
   278 
       
   279 /***/ }),
       
   280 
       
   281 /***/ "WyMB":
       
   282 /***/ (function(module, __webpack_exports__, __webpack_require__) {
       
   283 
       
   284 "use strict";
       
   285 __webpack_require__.r(__webpack_exports__);
       
   286 /* WEBPACK VAR INJECTION */(function(process) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return warning; });
       
   287 function isDev() {
    47 function isDev() {
   288   return typeof process !== 'undefined' && process.env && "production" !== 'production';
    48   return typeof process !== 'undefined' && process.env && "production" !== 'production';
   289 }
    49 }
   290 /**
    50 /**
   291  * Shows a warning with `message` if environment is not `production`.
    51  * Shows a warning with `message` if environment is not `production`.
   307 
    67 
   308 
    68 
   309 function warning(message) {
    69 function warning(message) {
   310   if (!isDev()) {
    70   if (!isDev()) {
   311     return;
    71     return;
       
    72   } // Skip if already logged.
       
    73 
       
    74 
       
    75   if (logged.has(message)) {
       
    76     return;
   312   } // eslint-disable-next-line no-console
    77   } // eslint-disable-next-line no-console
   313 
    78 
   314 
    79 
   315   console.warn(message); // Throwing an error and catching it immediately to improve debugging
    80   console.warn(message); // Throwing an error and catching it immediately to improve debugging
   316   // A consumer can use 'pause on caught exceptions'
    81   // A consumer can use 'pause on caught exceptions'
   317   // https://github.com/facebook/react/issues/4216
    82   // https://github.com/facebook/react/issues/4216
   318 
    83 
   319   try {
    84   try {
   320     throw Error(message);
    85     throw Error(message);
   321   } catch (x) {// do nothing
    86   } catch (x) {// Do nothing.
   322   }
    87   }
       
    88 
       
    89   logged.add(message);
   323 }
    90 }
   324 
    91 
   325 /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("8oxB")))
    92 (window.wp = window.wp || {}).warning = __webpack_exports__["default"];
   326 
    93 /******/ })()
   327 /***/ })
    94 ;
   328 
       
   329 /******/ })["default"];