Skip to content

Instantly share code, notes, and snippets.

@zpao
Created February 28, 2016 18:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zpao/2c815bbe453f0a9a9281 to your computer and use it in GitHub Desktop.
Save zpao/2c815bbe453f0a9a9281 to your computer and use it in GitHub Desktop.
Only in lib copy: .DS_Store
diff -U4 lib copy/CSSCore.js lib/CSSCore.js
--- lib copy/CSSCore.js 2016-02-27 17:48:04.000000000 -0800
+++ lib/CSSCore.js 2016-02-27 18:02:23.000000000 -0800
@@ -1,4 +1,6 @@
+'use strict';
+
/**
* Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
@@ -8,10 +10,8 @@
*
* @typechecks
*/
-'use strict';
-
var invariant = require('./invariant');
/**
* The CSSCore module specifies the API (and implements most of the methods)
diff -U4 lib copy/DataTransfer.js lib/DataTransfer.js
--- lib copy/DataTransfer.js 2016-02-27 17:48:04.000000000 -0800
+++ lib/DataTransfer.js 2016-02-27 18:02:25.000000000 -0800
@@ -1,4 +1,8 @@
+'use strict';
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
/**
* Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
@@ -8,12 +12,8 @@
*
* @typechecks
*/
-'use strict';
-
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
-
var PhotosMimeType = require('./PhotosMimeType');
var createArrayFromMixed = require('./createArrayFromMixed');
var emptyFunction = require('./emptyFunction');
@@ -37,9 +37,9 @@
return item.getAsFile();
}
}
-var DataTransfer = (function () {
+var DataTransfer = function () {
/**
* @param {object} data
*/
@@ -57,8 +57,9 @@
*
* @return {boolean}
*/
+
DataTransfer.prototype.isRichText = function isRichText() {
// If HTML is available, treat this data as rich text. This way, we avoid
// using a pasted image if it is packaged with HTML -- this may occur with
// pastes from MS Word, for example.
@@ -82,8 +83,9 @@
*
* @return {?string}
*/
+
DataTransfer.prototype.getText = function getText() {
var text;
if (this.data.getData) {
if (!this.types.length) {
@@ -100,8 +102,9 @@
*
* @return {?string}
*/
+
DataTransfer.prototype.getHTML = function getHTML() {
if (this.data.getData) {
if (!this.types.length) {
return this.data.getData('Text');
@@ -116,8 +119,9 @@
*
* @return {boolean}
*/
+
DataTransfer.prototype.isLink = function isLink() {
return this.types.some(function (type) {
return type.indexOf('Url') != -1 || type.indexOf('text/uri-list') != -1;
});
@@ -128,8 +132,9 @@
*
* @return {?string}
*/
+
DataTransfer.prototype.getLink = function getLink() {
if (this.data.getData) {
return this.types.indexOf('text/uri-list') != -1 ? this.data.getData('text/uri-list') : this.data.getData('url');
}
@@ -142,8 +147,9 @@
*
* @return {boolean}
*/
+
DataTransfer.prototype.isImage = function isImage() {
var isImage = this.types.some(function (type) {
// Firefox will have a type of application/x-moz-file for images during
// dragging
@@ -181,8 +187,9 @@
*
* @return {array}
*/
+
DataTransfer.prototype.getFiles = function getFiles() {
if (this.data.items) {
// createArrayFromMixed doesn't properly handle DataTransferItemLists.
return Array.prototype.slice.call(this.data.items).map(getFileFromDataTransfer).filter(emptyFunction.thatReturnsArgument);
@@ -198,12 +205,13 @@
*
* @return {boolean}
*/
+
DataTransfer.prototype.hasFiles = function hasFiles() {
return this.getFiles().length > 0;
};
return DataTransfer;
-})();
+}();
module.exports = DataTransfer;
\ No newline at end of file
diff -U4 lib copy/Deferred.js lib/Deferred.js
--- lib copy/Deferred.js 2016-02-27 17:48:04.000000000 -0800
+++ lib/Deferred.js 2016-02-27 18:02:23.000000000 -0800
@@ -25,9 +25,9 @@
* reject methods, you should export `getPromise` which returns a Promise with
* the same semantics excluding those methods.
*/
-var Deferred = (function () {
+var Deferred = function () {
function Deferred() {
var _this = this;
_classCallCheck(this, Deferred);
@@ -65,7 +65,7 @@
return this._settled;
};
return Deferred;
-})();
+}();
module.exports = Deferred;
\ No newline at end of file
diff -U4 lib copy/ErrorUtils.js lib/ErrorUtils.js
--- lib copy/ErrorUtils.js 2016-02-27 17:48:05.000000000 -0800
+++ lib/ErrorUtils.js 2016-02-27 18:02:25.000000000 -0800
@@ -1,4 +1,6 @@
+"use strict";
+
/**
* Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
@@ -9,10 +11,8 @@
*/
/* jslint unused:false */
-"use strict";
-
if (global.ErrorUtils) {
module.exports = global.ErrorUtils;
} else {
var ErrorUtils = {
diff -U4 lib copy/EventListener.js lib/EventListener.js
--- lib copy/EventListener.js 2016-02-27 17:48:05.000000000 -0800
+++ lib/EventListener.js 2016-02-27 18:02:25.000000000 -0800
@@ -1,4 +1,6 @@
+'use strict';
+
/**
* Copyright 2013-2015, Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,10 +17,8 @@
*
* @typechecks
*/
-'use strict';
-
var emptyFunction = require('./emptyFunction');
/**
* Upstream version of event listener. Does not take into account specific
diff -U4 lib copy/Keys.js lib/Keys.js
--- lib copy/Keys.js 2016-02-27 17:48:04.000000000 -0800
+++ lib/Keys.js 2016-02-27 18:02:23.000000000 -0800
@@ -1,4 +1,6 @@
+"use strict";
+
/**
* Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
@@ -7,10 +9,8 @@
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
-"use strict";
-
module.exports = {
BACKSPACE: 8,
TAB: 9,
RETURN: 13,
diff -U4 lib copy/Map.js lib/Map.js
--- lib copy/Map.js 2016-02-27 17:48:03.000000000 -0800
+++ lib/Map.js 2016-02-27 18:02:24.000000000 -0800
@@ -1,4 +1,6 @@
+'use strict';
+
/**
* Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
@@ -7,7 +9,5 @@
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
-'use strict';
-
module.exports = require('core-js/library/es6/map');
\ No newline at end of file
diff -U4 lib copy/PhotosMimeType.js lib/PhotosMimeType.js
--- lib copy/PhotosMimeType.js 2016-02-27 17:48:04.000000000 -0800
+++ lib/PhotosMimeType.js 2016-02-27 18:02:25.000000000 -0800
@@ -1,4 +1,8 @@
+'use strict';
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
/**
* Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
@@ -6,13 +10,10 @@
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
-'use strict';
-
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
-var PhotosMimeType = (function () {
+var PhotosMimeType = function () {
function PhotosMimeType(mimeString) {
_classCallCheck(this, PhotosMimeType);
// Allow this to be used as a function
@@ -32,7 +33,7 @@
this._parts[1] === 'jpeg' || this._parts[1] === 'pjpeg');
};
return PhotosMimeType;
-})();
+}();
module.exports = PhotosMimeType;
\ No newline at end of file
diff -U4 lib copy/Promise.js lib/Promise.js
--- lib copy/Promise.js 2016-02-27 17:48:03.000000000 -0800
+++ lib/Promise.js 2016-02-27 18:02:24.000000000 -0800
@@ -1,4 +1,6 @@
+'use strict';
+
/**
* Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
@@ -7,7 +9,5 @@
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
-'use strict';
-
module.exports = require('promise');
\ No newline at end of file
diff -U4 lib copy/PromiseMap.js lib/PromiseMap.js
--- lib copy/PromiseMap.js 2016-02-27 17:48:04.000000000 -0800
+++ lib/PromiseMap.js 2016-02-27 18:02:23.000000000 -0800
@@ -1,10 +1,4 @@
-'use strict';
-
-var Promise = require('./Promise');
-
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
-
/**
* Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
@@ -16,8 +10,10 @@
*/
'use strict';
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
var Deferred = require('./Deferred');
var invariant = require('./invariant');
@@ -26,9 +22,9 @@
* normal map, setting the value for a particular key more than once throws.
* Also unlike a normal map, a key can either be resolved or rejected.
*/
-var PromiseMap = (function () {
+var PromiseMap = function () {
function PromiseMap() {
_classCallCheck(this, PromiseMap);
this._deferred = {};
@@ -50,9 +46,9 @@
entry.reject(reason);
};
return PromiseMap;
-})();
+}();
function getDeferred(entries, key) {
if (!entries.hasOwnProperty(key)) {
entries[key] = new Deferred();
diff -U4 lib copy/Scroll.js lib/Scroll.js
--- lib copy/Scroll.js 2016-02-27 17:48:05.000000000 -0800
+++ lib/Scroll.js 2016-02-27 18:02:25.000000000 -0800
@@ -1,4 +1,6 @@
+"use strict";
+
/**
* Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
@@ -12,10 +14,8 @@
* @param {DOMElement} element
* @param {DOMDocument} doc
* @return {boolean}
*/
-"use strict";
-
function _isViewportScrollElement(element, doc) {
return !!doc && (element === doc.documentElement || element === doc.body);
}
diff -U4 lib copy/Set.js lib/Set.js
--- lib copy/Set.js 2016-02-27 17:48:03.000000000 -0800
+++ lib/Set.js 2016-02-27 18:02:24.000000000 -0800
@@ -1,4 +1,6 @@
+'use strict';
+
/**
* Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
@@ -7,7 +9,5 @@
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
-'use strict';
-
module.exports = require('core-js/library/es6/set');
\ No newline at end of file
diff -U4 lib copy/Style.js lib/Style.js
--- lib copy/Style.js 2016-02-27 17:48:03.000000000 -0800
+++ lib/Style.js 2016-02-27 18:02:24.000000000 -0800
@@ -1,4 +1,6 @@
+'use strict';
+
/**
* Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
@@ -8,10 +10,8 @@
*
* @typechecks
*/
-'use strict';
-
var getStyleProperty = require('./getStyleProperty');
/**
* @param {DOMNode} element [description]
diff -U4 lib copy/TokenizeUtil.js lib/TokenizeUtil.js
--- lib copy/TokenizeUtil.js 2016-02-27 17:48:03.000000000 -0800
+++ lib/TokenizeUtil.js 2016-02-27 18:02:24.000000000 -0800
@@ -26,8 +26,9 @@
// \u2E2E\u061f\u066a-\u066c\u061b\u060c\u060d\uFD3e\uFD3F
// is some Arabic punctuation marks
// \u1801\u0964\u104a\u104b
// is misc. other language punctuation marks
+
var PUNCTUATION = '[.,+*?$|#{}()\'\\^\\-\\[\\]\\\\\\/!@%"~=<>_:;' + '・、。〈-】〔-〟:-?!-/' + '[-`{-・⸮؟٪-٬؛،؍' + '﴾﴿᠁।၊။‐-‧‰-⁞' + '¡-±´-¸º»¿]';
module.exports = {
getPunctuation: function () {
diff -U4 lib copy/TouchEventUtils.js lib/TouchEventUtils.js
--- lib copy/TouchEventUtils.js 2016-02-27 17:48:04.000000000 -0800
+++ lib/TouchEventUtils.js 2016-02-27 18:02:23.000000000 -0800
@@ -1,4 +1,6 @@
+"use strict";
+
/**
* Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
@@ -7,10 +9,8 @@
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
-"use strict";
-
var TouchEventUtils = {
/**
* Utility function for common case of extracting out the primary touch from a
* touch event.
diff -U4 lib copy/URI.js lib/URI.js
--- lib copy/URI.js 2016-02-27 17:48:03.000000000 -0800
+++ lib/URI.js 2016-02-27 18:02:24.000000000 -0800
@@ -10,11 +10,11 @@
*/
'use strict';
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-var URI = (function () {
+var URI = function () {
function URI(uri) {
_classCallCheck(this, URI);
this._uri = uri;
@@ -24,7 +24,7 @@
return this._uri;
};
return URI;
-})();
+}();
module.exports = URI;
\ No newline at end of file
diff -U4 lib copy/UnicodeBidi.js lib/UnicodeBidi.js
--- lib copy/UnicodeBidi.js 2016-02-27 17:48:05.000000000 -0800
+++ lib/UnicodeBidi.js 2016-02-27 18:02:25.000000000 -0800
@@ -17,22 +17,22 @@
* Unicode Standard Annex #9 (UAX9)
* http://www.unicode.org/reports/tr9/
*/
+'use strict';
+
+var UnicodeBidiDirection = require('./UnicodeBidiDirection');
+
+var invariant = require('./invariant');
+
/**
* RegExp ranges of characters with a *Strong* Bidi_Class value.
*
* Data is based on DerivedBidiClass.txt in UCD version 7.0.0.
*
* NOTE: For performance reasons, we only support Unicode's
* Basic Multilingual Plane (BMP) for now.
*/
-'use strict';
-
-var UnicodeBidiDirection = require('./UnicodeBidiDirection');
-
-var invariant = require('./invariant');
-
var RANGE_BY_BIDI_TYPE = {
L: 'A-Za-zªµºÀ-ÖØ-öø-ƺƻ' + 'Ƽ-ƿǀ-ǃDŽ-ʓʔʕ-ʯʰ-ʸ' + 'ʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͷ' + 'ͺͻ-ͽͿΆΈ-ΊΌΎ-Ρ' + 'Σ-ϵϷ-ҁ҂Ҋ-ԯԱ-Ֆՙ' + '՚-՟ա-և։ःऄ-हऻऽ' + 'ा-ीॉ-ौॎ-ॏॐक़-ॡ।-॥' + '०-९॰ॱॲ-ঀং-ঃঅ-ঌ' + 'এ-ঐও-নপ-রলশ-হঽ' + 'া-ীে-ৈো-ৌৎৗড়-ঢ়' + 'য়-ৡ০-৯ৰ-ৱ৴-৹৺ਃ' + 'ਅ-ਊਏ-ਐਓ-ਨਪ-ਰਲ-ਲ਼' + 'ਵ-ਸ਼ਸ-ਹਾ-ੀਖ਼-ੜਫ਼੦-੯' + 'ੲ-ੴઃઅ-ઍએ-ઑઓ-નપ-ર' + 'લ-ળવ-હઽા-ીૉો-ૌૐ' + 'ૠ-ૡ૦-૯૰ଂ-ଃଅ-ଌଏ-ଐ' + 'ଓ-ନପ-ରଲ-ଳଵ-ହଽାୀ' + 'େ-ୈୋ-ୌୗଡ଼-ଢ଼ୟ-ୡ୦-୯' + '୰ୱ୲-୷ஃஅ-ஊஎ-ஐஒ-க' + 'ங-சஜஞ-டண-தந-பம-ஹ' + 'ா-ிு-ூெ-ைொ-ௌௐௗ' + '௦-௯௰-௲ఁ-ఃఅ-ఌఎ-ఐ' + 'ఒ-నప-హఽు-ౄౘ-ౙౠ-ౡ' + '౦-౯౿ಂ-ಃಅ-ಌಎ-ಐಒ-ನ' + 'ಪ-ಳವ-ಹಽಾಿೀ-ೄೆ' + 'ೇ-ೈೊ-ೋೕ-ೖೞೠ-ೡ೦-೯' + 'ೱ-ೲം-ഃഅ-ഌഎ-ഐഒ-ഺഽ' + 'ാ-ീെ-ൈൊ-ൌൎൗൠ-ൡ' + '൦-൯൰-൵൹ൺ-ൿං-ඃඅ-ඖ' + 'ක-නඳ-රලව-ෆා-ෑෘ-ෟ' + '෦-෯ෲ-ෳ෴ก-ะา-ำเ-ๅ' + 'ๆ๏๐-๙๚-๛ກ-ຂຄງ-ຈ' + 'ຊຍດ-ທນ-ຟມ-ຣລວ' + 'ສ-ຫອ-ະາ-ຳຽເ-ໄໆ' + '໐-໙ໜ-ໟༀ༁-༃༄-༒༓༔' + '༕-༗༚-༟༠-༩༪-༳༴༶༸' + '༾-༿ཀ-ཇཉ-ཬཿ྅ྈ-ྌ' + '྾-࿅࿇-࿌࿎-࿏࿐-࿔࿕-࿘' + '࿙-࿚က-ဪါ-ာေးျ-ြဿ' + '၀-၉၊-၏ၐ-ၕၖ-ၗၚ-ၝၡ' + 'ၢ-ၤၥ-ၦၧ-ၭၮ-ၰၵ-ႁ' + 'ႃ-ႄႇ-ႌႎႏ႐-႙ႚ-ႜ' + '႞-႟Ⴀ-ჅჇჍა-ჺ჻ჼ' + 'ჽ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈ' + 'ኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅ' + 'ወ-ዖዘ-ጐጒ-ጕጘ-ፚ፠-፨' + '፩-፼ᎀ-ᎏᎠ-Ᏼᐁ-ᙬ᙭-᙮' + 'ᙯ-ᙿᚁ-ᚚᚠ-ᛪ᛫-᛭ᛮ-ᛰ' + 'ᛱ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱ᜵-᜶' + 'ᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳាើ-ៅ' + 'ះ-ៈ។-៖ៗ៘-៚ៜ០-៩' + '᠐-᠙ᠠ-ᡂᡃᡄ-ᡷᢀ-ᢨᢪ' + 'ᢰ-ᣵᤀ-ᤞᤣ-ᤦᤩ-ᤫᤰ-ᤱ' + 'ᤳ-ᤸ᥆-᥏ᥐ-ᥭᥰ-ᥴᦀ-ᦫ' + 'ᦰ-ᧀᧁ-ᧇᧈ-ᧉ᧐-᧙᧚ᨀ-ᨖ' + 'ᨙ-ᨚ᨞-᨟ᨠ-ᩔᩕᩗᩡᩣ-ᩤ' + 'ᩭ-ᩲ᪀-᪉᪐-᪙᪠-᪦ᪧ᪨-᪭' + 'ᬄᬅ-ᬳᬵᬻᬽ-ᭁᭃ-᭄ᭅ-ᭋ' + '᭐-᭙᭚-᭠᭡-᭪᭴-᭼ᮂᮃ-ᮠ' + 'ᮡᮦ-ᮧ᮪ᮮ-ᮯ᮰-᮹ᮺ-ᯥᯧ' + 'ᯪ-ᯬᯮ᯲-᯳᯼-᯿ᰀ-ᰣᰤ-ᰫ' + 'ᰴ-ᰵ᰻-᰿᱀-᱉ᱍ-ᱏ᱐-᱙' + 'ᱚ-ᱷᱸ-ᱽ᱾-᱿᳀-᳇᳓᳡' + 'ᳩ-ᳬᳮ-ᳱᳲ-ᳳᳵ-ᳶᴀ-ᴫ' + 'ᴬ-ᵪᵫ-ᵷᵸᵹ-ᶚᶛ-ᶿḀ-ἕ' + 'Ἐ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝ' + 'Ὗ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌ' + 'ῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‎' + 'ⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝ' + 'ℤΩℨK-ℭℯ-ℴℵ-ℸℹ' + 'ℼ-ℿⅅ-ⅉⅎ⅏Ⅰ-ↂↃ-ↄ' + 'ↅ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿' + 'Ⰰ-Ⱞⰰ-ⱞⱠ-ⱻⱼ-ⱽⱾ-ⳤ' + 'Ⳬ-ⳮⳲ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ' + '⵰ⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾ' + 'ⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々〆〇' + '〡-〩〮-〯〱-〵〸-〺〻〼' + 'ぁ-ゖゝ-ゞゟァ-ヺー-ヾヿ' + 'ㄅ-ㄭㄱ-ㆎ㆐-㆑㆒-㆕㆖-㆟' + 'ㆠ-ㆺㇰ-ㇿ㈀-㈜㈠-㈩㈪-㉇' + '㉈-㉏㉠-㉻㉿㊀-㊉㊊-㊰㋀-㋋' + '㋐-㋾㌀-㍶㍻-㏝㏠-㏾㐀-䶵' + '一-鿌ꀀ-ꀔꀕꀖ-ꒌꓐ-ꓷꓸ-ꓽ' + '꓾-꓿ꔀ-ꘋꘌꘐ-ꘟ꘠-꘩ꘪ-ꘫ' + 'Ꙁ-ꙭꙮꚀ-ꚛꚜ-ꚝꚠ-ꛥꛦ-ꛯ' + '꛲-꛷Ꜣ-ꝯꝰꝱ-ꞇ꞉-꞊Ꞌ-ꞎ' + 'Ꞑ-ꞭꞰ-Ʇꟷꟸ-ꟹꟺꟻ-ꠁ' + 'ꠃ-ꠅꠇ-ꠊꠌ-ꠢꠣ-ꠤꠧ꠰-꠵' + '꠶-꠷ꡀ-ꡳꢀ-ꢁꢂ-ꢳꢴ-ꣃ' + '꣎-꣏꣐-꣙ꣲ-ꣷ꣸-꣺ꣻ꤀-꤉' + 'ꤊ-ꤥ꤮-꤯ꤰ-ꥆꥒ-꥓꥟ꥠ-ꥼ' + 'ꦃꦄ-ꦲꦴ-ꦵꦺ-ꦻꦽ-꧀꧁-꧍' + 'ꧏ꧐-꧙꧞-꧟ꧠ-ꧤꧦꧧ-ꧯ' + '꧰-꧹ꧺ-ꧾꨀ-ꨨꨯ-ꨰꨳ-ꨴ' + 'ꩀ-ꩂꩄ-ꩋꩍ꩐-꩙꩜-꩟ꩠ-ꩯ' + 'ꩰꩱ-ꩶ꩷-꩹ꩺꩻꩽꩾ-ꪯꪱ' + 'ꪵ-ꪶꪹ-ꪽꫀꫂꫛ-ꫜꫝ꫞-꫟' + 'ꫠ-ꫪꫫꫮ-ꫯ꫰-꫱ꫲꫳ-ꫴꫵ' + 'ꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮ' + 'ꬰ-ꭚ꭛ꭜ-ꭟꭤ-ꭥꯀ-ꯢꯣ-ꯤ' + 'ꯦ-ꯧꯩ-ꯪ꯫꯬꯰-꯹가-힣' + 'ힰ-ퟆퟋ-ퟻ-豈-舘並-龎' + 'ff-stﬓ-ﬗA-Za-zヲ-ッー' + 'ア-ン゙-゚ᅠ-하-ᅦᅧ-ᅬ' + 'ᅭ-ᅲᅳ-ᅵ',
diff -U4 lib copy/UnicodeBidiDirection.js lib/UnicodeBidiDirection.js
--- lib copy/UnicodeBidiDirection.js 2016-02-27 17:48:05.000000000 -0800
+++ lib/UnicodeBidiDirection.js 2016-02-27 18:02:25.000000000 -0800
@@ -25,11 +25,8 @@
*/
'use strict';
-Object.defineProperty(exports, '__esModule', {
- value: true
-});
var invariant = require('./invariant');
var NEUTRAL = 'NEUTRAL'; // No strong direction
var LTR = 'LTR'; // Left-to-Right direction
diff -U4 lib copy/UnicodeBidiService.js lib/UnicodeBidiService.js
--- lib copy/UnicodeBidiService.js 2016-02-27 17:48:05.000000000 -0800
+++ lib/UnicodeBidiService.js 2016-02-27 18:02:25.000000000 -0800
@@ -41,16 +41,16 @@
*/
'use strict';
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var UnicodeBidi = require('./UnicodeBidi');
var UnicodeBidiDirection = require('./UnicodeBidiDirection');
var invariant = require('./invariant');
-var UnicodeBidiService = (function () {
+var UnicodeBidiService = function () {
/**
* Stateful class for paragraph direction detection
*
@@ -75,8 +75,9 @@
* Instead of creating a new instance, You can just reset() your instance
* everytime you start a new loop.
*/
+
UnicodeBidiService.prototype.reset = function reset() {
this._lastDir = this._defaultDir;
};
@@ -87,13 +88,14 @@
* @param str A text block, e.g. paragraph, table cell, tag
* @return The resolved direction
*/
+
UnicodeBidiService.prototype.getDirection = function getDirection(str) {
this._lastDir = UnicodeBidi.getDirection(str, this._lastDir);
return this._lastDir;
};
return UnicodeBidiService;
-})();
+}();
module.exports = UnicodeBidiService;
\ No newline at end of file
diff -U4 lib copy/UnicodeCJK.js lib/UnicodeCJK.js
--- lib copy/UnicodeCJK.js 2016-02-27 17:48:05.000000000 -0800
+++ lib/UnicodeCJK.js 2016-02-27 18:02:25.000000000 -0800
@@ -24,8 +24,9 @@
* Latin
*
* NOTE: The code assumes these sets include only BMP characters.
*/
+
var R_LATIN_ASCII = 'a-zA-Z';
var R_LATIN_FULLWIDTH = 'A-Za-z';
var R_LATIN = R_LATIN_ASCII + R_LATIN_FULLWIDTH;
diff -U4 lib copy/UserAgent.js lib/UserAgent.js
--- lib copy/UserAgent.js 2016-02-27 17:48:05.000000000 -0800
+++ lib/UserAgent.js 2016-02-27 18:02:25.000000000 -0800
@@ -110,12 +110,14 @@
*
* @param {string} query Query of the form "Name [range expression]"
* @return {boolean}
*/
+
isBrowser: function (query) {
return compare(UserAgentData.browserName, UserAgentData.browserFullVersion, query);
},
+
/**
* Check if the User Agent browser uses a 32 or 64 bit architecture.
*
* @note Function results are memoized
@@ -126,8 +128,9 @@
isBrowserArchitecture: function (query) {
return compare(UserAgentData.browserArchitecture, null, query);
},
+
/**
* Check if the User Agent device matches `query`.
*
* `query` should be a string like "iPhone" or "iPad".
@@ -154,8 +157,9 @@
isDevice: function (query) {
return compare(UserAgentData.deviceName, null, query);
},
+
/**
* Check if the User Agent rendering engine matches `query`.
*
* `query` should be a string like "WebKit" or "WebKit >= 537".
@@ -180,8 +184,9 @@
isEngine: function (query) {
return compare(UserAgentData.engineName, UserAgentData.engineVersion, query);
},
+
/**
* Check if the User Agent platform matches `query`.
*
* `query` should be a string like "Windows" or "iOS 5 - 6".
@@ -219,8 +224,9 @@
isPlatform: function (query) {
return compare(UserAgentData.platformName, UserAgentData.platformFullVersion, query, normalizePlatformVersion);
},
+
/**
* Check if the User Agent platform is a 32 or 64 bit architecture.
*
* @note Function results are memoized
@@ -230,8 +236,7 @@
*/
isPlatformArchitecture: function (query) {
return compare(UserAgentData.platformArchitecture, null, query);
}
-
};
module.exports = mapObject(UserAgent, memoizeStringOnly);
\ No newline at end of file
diff -U4 lib copy/VersionRange.js lib/VersionRange.js
--- lib copy/VersionRange.js 2016-02-27 17:48:05.000000000 -0800
+++ lib/VersionRange.js 2016-02-27 18:02:25.000000000 -0800
@@ -9,10 +9,8 @@
*/
'use strict';
-var _slicedToArray = (function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i['return']) _i['return'](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError('Invalid attempt to destructure non-iterable instance'); } }; })();
-
var invariant = require('./invariant');
var componentRegex = /\./;
var orRegex = /\|\|/;
@@ -56,12 +54,10 @@
if (expressions.length === 1) {
return checkSimpleExpression(expressions[0], version);
} else {
- var _expressions = _slicedToArray(expressions, 2);
-
- var startVersion = _expressions[0];
- var endVersion = _expressions[1];
+ var startVersion = expressions[0];
+ var endVersion = expressions[1];
!(isSimpleVersion(startVersion) && isSimpleVersion(endVersion)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'operands to the "-" operator must be simple (no modifiers)') : invariant(false) : undefined;
return checkSimpleExpression('>=' + startVersion, version) && checkSimpleExpression('<=' + endVersion, version);
@@ -83,12 +79,12 @@
}
var versionComponents = version.split(componentRegex);
- var _getModifierAndComponents = getModifierAndComponents(range);
+ var _getModifierAndCompon = getModifierAndComponents(range);
- var modifier = _getModifierAndComponents.modifier;
- var rangeComponents = _getModifierAndComponents.rangeComponents;
+ var modifier = _getModifierAndCompon.modifier;
+ var rangeComponents = _getModifierAndCompon.rangeComponents;
switch (modifier) {
case '<':
return checkLessThan(versionComponents, rangeComponents);
@@ -334,12 +330,11 @@
*/
function compareComponents(a, b) {
var _normalizeVersions = normalizeVersions(a, b);
- var _normalizeVersions2 = _slicedToArray(_normalizeVersions, 2);
+ var aNormalized = _normalizeVersions[0];
+ var bNormalized = _normalizeVersions[1];
- var aNormalized = _normalizeVersions2[0];
- var bNormalized = _normalizeVersions2[1];
for (var i = 0; i < bNormalized.length; i++) {
var result = compareNumeric(aNormalized[i], bNormalized[i]);
if (result) {
@@ -381,8 +376,9 @@
* @param {string} range
* @param {string} version
* @returns {boolean}
*/
+
contains: function (range, version) {
return checkOrExpression(range.trim(), version.trim());
}
};
Common subdirectories: lib copy/__mocks__ and lib/__mocks__
diff -U4 lib copy/_shouldPolyfillES6Collection.js lib/_shouldPolyfillES6Collection.js
--- lib copy/_shouldPolyfillES6Collection.js 2016-02-27 17:48:04.000000000 -0800
+++ lib/_shouldPolyfillES6Collection.js 2016-02-27 18:02:23.000000000 -0800
@@ -1,4 +1,6 @@
+'use strict';
+
/**
* Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
@@ -13,10 +15,8 @@
/**
* Checks whether a collection name (e.g. "Map" or "Set") has a native polyfill
* that is safe to be used.
*/
-'use strict';
-
function shouldPolyfillES6Collection(collectionName) {
var Collection = global[collectionName];
if (Collection == null) {
return true;
diff -U4 lib copy/areEqual.js lib/areEqual.js
--- lib copy/areEqual.js 2016-02-27 17:48:04.000000000 -0800
+++ lib/areEqual.js 2016-02-27 18:02:23.000000000 -0800
@@ -1,4 +1,6 @@
+'use strict';
+
/**
* Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
@@ -8,10 +10,8 @@
*
*
*/
-'use strict';
-
var aStackPool = [];
var bStackPool = [];
/**
diff -U4 lib copy/camelize.js lib/camelize.js
--- lib copy/camelize.js 2016-02-27 17:48:04.000000000 -0800
+++ lib/camelize.js 2016-02-27 18:02:23.000000000 -0800
@@ -1,4 +1,6 @@
+"use strict";
+
/**
* Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
@@ -8,10 +10,8 @@
*
* @typechecks
*/
-"use strict";
-
var _hyphenPattern = /-(.)/g;
/**
* Camelcases a hyphenated string, for example:
diff -U4 lib copy/compactArray.js lib/compactArray.js
--- lib copy/compactArray.js 2016-02-27 17:48:04.000000000 -0800
+++ lib/compactArray.js 2016-02-27 18:02:25.000000000 -0800
@@ -11,8 +11,9 @@
* Returns a new Array containing all the element of the source array except
* `null` and `undefined` ones. This brings the benefit of strong typing over
* `Array.prototype.filter`.
*/
+
function compactArray(array) {
var result = [];
for (var i = 0; i < array.length; ++i) {
var elem = array[i];
diff -U4 lib copy/concatAllArray.js lib/concatAllArray.js
--- lib copy/concatAllArray.js 2016-02-27 17:48:04.000000000 -0800
+++ lib/concatAllArray.js 2016-02-27 18:02:25.000000000 -0800
@@ -1,4 +1,6 @@
+'use strict';
+
/**
* Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
@@ -8,10 +10,8 @@
*
* @typechecks
*/
-'use strict';
-
var push = Array.prototype.push;
/**
* Concats an array of arrays into a single flat array.
diff -U4 lib copy/containsNode.js lib/containsNode.js
--- lib copy/containsNode.js 2016-02-27 17:48:05.000000000 -0800
+++ lib/containsNode.js 2016-02-27 18:02:25.000000000 -0800
@@ -1,4 +1,6 @@
+'use strict';
+
/**
* Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
@@ -8,10 +10,8 @@
*
* @typechecks
*/
-'use strict';
-
var isTextNode = require('./isTextNode');
/*eslint-disable no-bitwise */
@@ -21,34 +21,23 @@
* @param {?DOMNode} outerNode Outer DOM node.
* @param {?DOMNode} innerNode Inner DOM node.
* @return {boolean} True if `outerNode` contains or is `innerNode`.
*/
-function containsNode(_x, _x2) {
- var _again = true;
-
- _function: while (_again) {
- var outerNode = _x,
- innerNode = _x2;
- _again = false;
-
- if (!outerNode || !innerNode) {
- return false;
- } else if (outerNode === innerNode) {
- return true;
- } else if (isTextNode(outerNode)) {
- return false;
- } else if (isTextNode(innerNode)) {
- _x = outerNode;
- _x2 = innerNode.parentNode;
- _again = true;
- continue _function;
- } else if (outerNode.contains) {
- return outerNode.contains(innerNode);
- } else if (outerNode.compareDocumentPosition) {
- return !!(outerNode.compareDocumentPosition(innerNode) & 16);
- } else {
- return false;
- }
+function containsNode(outerNode, innerNode) {
+ if (!outerNode || !innerNode) {
+ return false;
+ } else if (outerNode === innerNode) {
+ return true;
+ } else if (isTextNode(outerNode)) {
+ return false;
+ } else if (isTextNode(innerNode)) {
+ return containsNode(outerNode, innerNode.parentNode);
+ } else if (outerNode.contains) {
+ return outerNode.contains(innerNode);
+ } else if (outerNode.compareDocumentPosition) {
+ return !!(outerNode.compareDocumentPosition(innerNode) & 16);
+ } else {
+ return false;
}
}
module.exports = containsNode;
\ No newline at end of file
diff -U4 lib copy/crc32.js lib/crc32.js
--- lib copy/crc32.js 2016-02-27 17:48:04.000000000 -0800
+++ lib/crc32.js 2016-02-27 18:02:25.000000000 -0800
@@ -1,4 +1,6 @@
+"use strict";
+
/**
* Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
@@ -8,10 +10,8 @@
*
*
*/
-"use strict";
-
function crc32(str) {
/* jslint bitwise: true */
var crc = -1;
for (var i = 0, len = str.length; i < len; i++) {
diff -U4 lib copy/createArrayFromMixed.js lib/createArrayFromMixed.js
--- lib copy/createArrayFromMixed.js 2016-02-27 17:48:04.000000000 -0800
+++ lib/createArrayFromMixed.js 2016-02-27 18:02:23.000000000 -0800
@@ -1,4 +1,6 @@
+'use strict';
+
/**
* Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
@@ -8,10 +10,8 @@
*
* @typechecks
*/
-'use strict';
-
var invariant = require('./invariant');
/**
* Convert array-like objects to arrays.
diff -U4 lib copy/createNodesFromMarkup.js lib/createNodesFromMarkup.js
--- lib copy/createNodesFromMarkup.js 2016-02-27 17:48:04.000000000 -0800
+++ lib/createNodesFromMarkup.js 2016-02-27 18:02:24.000000000 -0800
@@ -1,4 +1,6 @@
+'use strict';
+
/**
* Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
@@ -10,10 +12,8 @@
*/
/*eslint-disable fb-www/unsafe-html*/
-'use strict';
-
var ExecutionEnvironment = require('./ExecutionEnvironment');
var createArrayFromMixed = require('./createArrayFromMixed');
var getMarkupWrap = require('./getMarkupWrap');
diff -U4 lib copy/cx.js lib/cx.js
--- lib copy/cx.js 2016-02-27 17:48:03.000000000 -0800
+++ lib/cx.js 2016-02-27 18:02:24.000000000 -0800
@@ -1,4 +1,6 @@
+'use strict';
+
/**
* Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
@@ -22,10 +24,8 @@
* determine if the className keys should be included.
* @param [string ...] Variable list of classNames in the string case.
* @return string Renderable space-separated CSS className.
*/
-'use strict';
-
function cx(classNames) {
if (typeof classNames == 'object') {
return Object.keys(classNames).filter(function (className) {
return classNames[className];
diff -U4 lib copy/distinctArray.js lib/distinctArray.js
--- lib copy/distinctArray.js 2016-02-27 17:48:04.000000000 -0800
+++ lib/distinctArray.js 2016-02-27 18:02:25.000000000 -0800
@@ -1,4 +1,6 @@
+'use strict';
+
/**
* Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
@@ -8,10 +10,8 @@
*
*
*/
-'use strict';
-
var Set = require('./Set');
/**
* Returns the distinct elements of an iterable. The result is an array whose
diff -U4 lib copy/emptyFunction.js lib/emptyFunction.js
--- lib copy/emptyFunction.js 2016-02-27 17:48:04.000000000 -0800
+++ lib/emptyFunction.js 2016-02-27 18:02:24.000000000 -0800
@@ -1,4 +1,6 @@
+"use strict";
+
/**
* Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
@@ -7,10 +9,8 @@
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
-"use strict";
-
function makeEmptyFunction(arg) {
return function () {
return arg;
};
diff -U4 lib copy/enumerate.js lib/enumerate.js
--- lib copy/enumerate.js 2016-02-27 17:48:04.000000000 -0800
+++ lib/enumerate.js 2016-02-27 18:02:24.000000000 -0800
@@ -1,4 +1,8 @@
+'use strict';
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
/**
* Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
@@ -8,26 +12,22 @@
*
*
*/
-'use strict';
-
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
-
var KIND_KEYS = 'keys';
var KIND_VALUES = 'values';
var KIND_ENTRIES = 'entries';
/**
* Specific Array iterators.
*/
-var ArrayIterators = (function () {
+var ArrayIterators = function () {
var hasNative = hasNativeIterator(Array);
var ArrayIterator = undefined;
if (!hasNative) {
- ArrayIterator = (function () {
+ ArrayIterator = function () {
// 22.1.5.1 CreateArrayIterator Abstract Operation
function ArrayIterator(array, kind) {
_classCallCheck(this, ArrayIterator);
@@ -38,8 +38,9 @@
}
// 22.1.5.2.1 %ArrayIteratorPrototype%.next()
+
ArrayIterator.prototype.next = function next() {
if (this._iteratedObject == null) {
return { value: undefined, done: true };
}
@@ -66,14 +67,15 @@
};
// 22.1.5.2.2 %ArrayIteratorPrototype%[@@iterator]()
+
ArrayIterator.prototype[Symbol.iterator] = function () {
return this;
};
return ArrayIterator;
- })();
+ }();
}
return {
keys: hasNative ? function (array) {
@@ -93,22 +95,22 @@
} : function (array) {
return new ArrayIterator(array, KIND_ENTRIES);
}
};
-})();
+}();
// -----------------------------------------------------------------
/**
* Specific String iterators.
*/
-var StringIterators = (function () {
+var StringIterators = function () {
var hasNative = hasNativeIterator(String);
var StringIterator = undefined;
if (!hasNative) {
- StringIterator = (function () {
+ StringIterator = function () {
// 21.1.5.1 CreateStringIterator Abstract Operation
function StringIterator(string) {
_classCallCheck(this, StringIterator);
@@ -118,8 +120,9 @@
}
// 21.1.5.2.1 %StringIteratorPrototype%.next()
+
StringIterator.prototype.next = function next() {
if (this._iteratedString == null) {
return { value: undefined, done: true };
}
@@ -153,21 +156,23 @@
};
// 21.1.5.2.2 %StringIteratorPrototype%[@@iterator]()
+
StringIterator.prototype[Symbol.iterator] = function () {
return this;
};
return StringIterator;
- })();
+ }();
}
return {
keys: function () {
throw TypeError('Strings default iterator doesn\'t implement keys.');
},
+
values: hasNative ? function (string) {
return string[Symbol.iterator]();
} : function (string) {
return new StringIterator(string);
@@ -176,9 +181,9 @@
entries: function () {
throw TypeError('Strings default iterator doesn\'t implement entries.');
}
};
-})();
+}();
function hasNativeIterator(classObject) {
return typeof classObject.prototype[Symbol.iterator] === 'function' && typeof classObject.prototype.values === 'function' && typeof classObject.prototype.keys === 'function' && typeof classObject.prototype.entries === 'function';
}
@@ -188,9 +193,9 @@
/**
* Generic object iterator.
*/
-var ObjectIterator = (function () {
+var ObjectIterator = function () {
function ObjectIterator(object, kind) {
_classCallCheck(this, ObjectIterator);
this._iteratedObject = object;
@@ -198,14 +203,8 @@
this._keys = Object.keys(object);
this._nextIndex = 0;
}
- /**
- * Generic object iterator, iterates over all own enumerable
- * properties. Used only if if no specific iterator is available,
- * and object don't implement iterator protocol.
- */
-
ObjectIterator.prototype.next = function next() {
var len = this._keys.length;
var index = this._nextIndex;
var kind = this._kind;
@@ -231,19 +230,24 @@
return this;
};
return ObjectIterator;
-})();
+}();
+
+/**
+ * Generic object iterator, iterates over all own enumerable
+ * properties. Used only if if no specific iterator is available,
+ * and object don't implement iterator protocol.
+ */
+
var GenericIterators = {
keys: function (object) {
return new ObjectIterator(object, KIND_KEYS);
},
-
values: function (object) {
return new ObjectIterator(object, KIND_VALUES);
},
-
entries: function (object) {
return new ObjectIterator(object, KIND_ENTRIES);
}
};
@@ -287,17 +291,16 @@
keys: function (object) {
return enumerate(object, KIND_KEYS);
},
-
values: function (object) {
return enumerate(object, KIND_VALUES);
},
-
entries: function (object) {
return enumerate(object, KIND_ENTRIES);
},
+
generic: GenericIterators.entries
});
diff -U4 lib copy/everySet.js lib/everySet.js
--- lib copy/everySet.js 2016-02-27 17:48:05.000000000 -0800
+++ lib/everySet.js 2016-02-27 18:02:25.000000000 -0800
@@ -9,14 +9,14 @@
*
* @typechecks
*/
+'use strict';
+
/**
* The everySet() method tests whether all elements in the given Set pass the
* test implemented by the provided function.
*/
-'use strict';
-
function everySet(set, callback, context) {
var iterator = set.entries();
var current = iterator.next();
while (!current.done) {
diff -U4 lib copy/fetch.js lib/fetch.js
--- lib copy/fetch.js 2016-02-27 17:48:03.000000000 -0800
+++ lib/fetch.js 2016-02-27 18:02:24.000000000 -0800
@@ -12,8 +12,9 @@
// This hopefully supports the React Native case, which is already bringing along
// its own fetch polyfill. That should exist on `global`. If that doesn't exist
// then we'll try to polyfill, which might not work correctly in all environments.
+
if (global.fetch) {
module.exports = global.fetch.bind(global);
} else {
module.exports = require('isomorphic-fetch');
diff -U4 lib copy/fetchWithRetries.js lib/fetchWithRetries.js
--- lib copy/fetchWithRetries.js 2016-02-27 17:48:04.000000000 -0800
+++ lib/fetchWithRetries.js 2016-02-27 18:02:25.000000000 -0800
@@ -1,14 +1,4 @@
-'use strict';
-
-Object.defineProperty(exports, '__esModule', {
- value: true
-});
-
-var Promise = require('./Promise');
-
-function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
-
/**
* Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
@@ -21,8 +11,12 @@
*/
'use strict';
+var Promise = require('./Promise');
+
+function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
+
var ExecutionEnvironment = require('./ExecutionEnvironment');
var sprintf = require('./sprintf');
var fetch = require('./fetch');
@@ -77,9 +71,9 @@
resolve(response);
} else if (shouldRetry(requestsAttempted)) {
// Fetch was not successful, retrying.
// TODO(#7595849): Only retry on transient HTTP errors.
- process.env.NODE_ENV !== 'production' ? process.env.NODE_ENV !== 'production' ? warning(false, 'fetchWithRetries: HTTP error, retrying.') : undefined : undefined, retryRequest();
+ process.env.NODE_ENV !== 'production' ? warning(false, 'fetchWithRetries: HTTP error, retrying.') : undefined, retryRequest();
} else {
// Request was not successful, giving up.
var error = new Error(sprintf('fetchWithRetries(): Still no successful response after ' + '%s retries, giving up.', requestsAttempted));
error.response = response;
diff -U4 lib copy/flatMapArray.js lib/flatMapArray.js
--- lib copy/flatMapArray.js 2016-02-27 17:48:05.000000000 -0800
+++ lib/flatMapArray.js 2016-02-27 18:02:25.000000000 -0800
@@ -1,4 +1,6 @@
+'use strict';
+
/**
* Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
@@ -8,10 +10,8 @@
*
* @typechecks
*/
-'use strict';
-
var push = Array.prototype.push;
/**
* Applies a function to every item in an array and concatenates the resulting
diff -U4 lib copy/flattenArray.js lib/flattenArray.js
--- lib copy/flattenArray.js 2016-02-27 17:48:04.000000000 -0800
+++ lib/flattenArray.js 2016-02-27 18:02:24.000000000 -0800
@@ -1,4 +1,6 @@
+"use strict";
+
/**
* Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
@@ -22,10 +24,8 @@
* @see https://github.com/jonschlinkert/arr-flatten
* @copyright 2014-2015 Jon Schlinkert
* @license MIT
*/
-"use strict";
-
function flattenArray(array) {
var result = [];
flatten(array, result);
return result;
diff -U4 lib copy/focusNode.js lib/focusNode.js
--- lib copy/focusNode.js 2016-02-27 17:48:05.000000000 -0800
+++ lib/focusNode.js 2016-02-27 18:02:25.000000000 -0800
@@ -12,8 +12,9 @@
/**
* @param {DOMElement} node input/textarea to focus
*/
+
function focusNode(node) {
// IE8 can throw "Can't move focus to the control because it is invisible,
// not enabled, or of a type that does not accept the focus." for all kinds of
// reasons that are too expensive and fragile to test.
diff -U4 lib copy/getActiveElement.js lib/getActiveElement.js
--- lib copy/getActiveElement.js 2016-02-27 17:48:05.000000000 -0800
+++ lib/getActiveElement.js 2016-02-27 18:02:25.000000000 -0800
@@ -1,4 +1,6 @@
+'use strict';
+
/**
* Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
@@ -17,10 +19,8 @@
*
* The activeElement will be null only if the document or document body is not
* yet defined.
*/
-'use strict';
-
function getActiveElement() /*?DOMElement*/{
if (typeof document === 'undefined') {
return null;
}
diff -U4 lib copy/getElementPosition.js lib/getElementPosition.js
--- lib copy/getElementPosition.js 2016-02-27 17:48:05.000000000 -0800
+++ lib/getElementPosition.js 2016-02-27 18:02:25.000000000 -0800
@@ -1,4 +1,6 @@
+'use strict';
+
/**
* Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
@@ -8,10 +10,8 @@
*
* @typechecks
*/
-'use strict';
-
var getElementRect = require('./getElementRect');
/**
* Gets an element's position in pixels relative to the viewport. The returned
diff -U4 lib copy/getElementRect.js lib/getElementRect.js
--- lib copy/getElementRect.js 2016-02-27 17:48:05.000000000 -0800
+++ lib/getElementRect.js 2016-02-27 18:02:25.000000000 -0800
@@ -1,4 +1,6 @@
+'use strict';
+
/**
* Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
@@ -8,10 +10,8 @@
*
* @typechecks
*/
-'use strict';
-
var containsNode = require('./containsNode');
/**
* Gets an element's bounding rect in pixels relative to the viewport.
diff -U4 lib copy/getMarkupWrap.js lib/getMarkupWrap.js
--- lib copy/getMarkupWrap.js 2016-02-27 17:48:04.000000000 -0800
+++ lib/getMarkupWrap.js 2016-02-27 18:02:24.000000000 -0800
@@ -1,4 +1,6 @@
+'use strict';
+
/**
* Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
@@ -9,10 +11,8 @@
*/
/*eslint-disable fb-www/unsafe-html */
-'use strict';
-
var ExecutionEnvironment = require('./ExecutionEnvironment');
var invariant = require('./invariant');
diff -U4 lib copy/getStyleProperty.js lib/getStyleProperty.js
--- lib copy/getStyleProperty.js 2016-02-27 17:48:05.000000000 -0800
+++ lib/getStyleProperty.js 2016-02-27 18:02:25.000000000 -0800
@@ -1,4 +1,6 @@
+'use strict';
+
/**
* Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
@@ -8,10 +10,8 @@
*
* @typechecks
*/
-'use strict';
-
var camelize = require('./camelize');
var hyphenate = require('./hyphenate');
function asString(value) /*?string*/{
diff -U4 lib copy/getUnboundedScrollPosition.js lib/getUnboundedScrollPosition.js
--- lib copy/getUnboundedScrollPosition.js 2016-02-27 17:48:03.000000000 -0800
+++ lib/getUnboundedScrollPosition.js 2016-02-27 18:02:24.000000000 -0800
@@ -20,8 +20,9 @@
*
* @param {DOMWindow|DOMElement} scrollable
* @return {object} Map with `x` and `y` keys.
*/
+
function getUnboundedScrollPosition(scrollable) {
if (scrollable === window) {
return {
x: window.pageXOffset || document.documentElement.scrollLeft,
diff -U4 lib copy/getViewportDimensions.js lib/getViewportDimensions.js
--- lib copy/getViewportDimensions.js 2016-02-27 17:48:05.000000000 -0800
+++ lib/getViewportDimensions.js 2016-02-27 18:02:25.000000000 -0800
@@ -1,16 +1,4 @@
-/**
- * Copyright 2013-2015, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- *
- *
- * @typechecks
- */
-
"use strict";
function getViewportWidth() {
var width = undefined;
@@ -22,9 +10,19 @@
width = document.body.clientWidth;
}
return width || 0;
-}
+} /**
+ * Copyright 2013-2015, Facebook, Inc.
+ * All rights reserved.
+ *
+ * This source code is licensed under the BSD-style license found in the
+ * LICENSE file in the root directory of this source tree. An additional grant
+ * of patent rights can be found in the PATENTS file in the same directory.
+ *
+ *
+ * @typechecks
+ */
function getViewportHeight() {
var height = undefined;
if (document.documentElement) {
diff -U4 lib copy/groupArray.js lib/groupArray.js
--- lib copy/groupArray.js 2016-02-27 17:48:05.000000000 -0800
+++ lib/groupArray.js 2016-02-27 18:02:25.000000000 -0800
@@ -19,8 +19,9 @@
* @param {array} array
* @param {function} fn Should return a string with a group name
* @return {object} items grouped using fn
*/
+
function groupArray(array, fn) {
var ret = {};
for (var ii = 0; ii < array.length; ii++) {
var result = fn.call(array, array[ii], ii);
diff -U4 lib copy/hyphenate.js lib/hyphenate.js
--- lib copy/hyphenate.js 2016-02-27 17:48:04.000000000 -0800
+++ lib/hyphenate.js 2016-02-27 18:02:24.000000000 -0800
@@ -1,4 +1,6 @@
+'use strict';
+
/**
* Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
@@ -8,10 +10,8 @@
*
* @typechecks
*/
-'use strict';
-
var _uppercasePattern = /([A-Z])/g;
/**
* Hyphenates a camelcased string, for example:
diff -U4 lib copy/isEmpty.js lib/isEmpty.js
--- lib copy/isEmpty.js 2016-02-27 17:48:04.000000000 -0800
+++ lib/isEmpty.js 2016-02-27 18:02:24.000000000 -0800
@@ -1,4 +1,6 @@
+'use strict';
+
/**
* Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
@@ -9,10 +11,8 @@
*/
/*eslint-disable no-unused-vars */
-'use strict';
-
var invariant = require('./invariant');
/**
* Mimics empty from PHP.
diff -U4 lib copy/isNode.js lib/isNode.js
--- lib copy/isNode.js 2016-02-27 17:48:05.000000000 -0800
+++ lib/isNode.js 2016-02-27 18:02:25.000000000 -0800
@@ -1,4 +1,6 @@
+'use strict';
+
/**
* Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
@@ -12,10 +14,8 @@
/**
* @param {*} object The object to check.
* @return {boolean} Whether or not the object is a DOM node.
*/
-'use strict';
-
function isNode(object) {
return !!(object && (typeof Node === 'function' ? object instanceof Node : typeof object === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string'));
}
diff -U4 lib copy/isTextNode.js lib/isTextNode.js
--- lib copy/isTextNode.js 2016-02-27 17:48:05.000000000 -0800
+++ lib/isTextNode.js 2016-02-27 18:02:25.000000000 -0800
@@ -1,4 +1,6 @@
+'use strict';
+
/**
* Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
@@ -8,10 +10,8 @@
*
* @typechecks
*/
-'use strict';
-
var isNode = require('./isNode');
/**
* @param {*} object The object to check.
diff -U4 lib copy/joinClasses.js lib/joinClasses.js
--- lib copy/joinClasses.js 2016-02-27 17:48:04.000000000 -0800
+++ lib/joinClasses.js 2016-02-27 18:02:24.000000000 -0800
@@ -17,8 +17,9 @@
*
* @param {...?string} className
* @return {string}
*/
+
function joinClasses(className /*, ... */) {
if (!className) {
className = '';
}
diff -U4 lib copy/keyOf.js lib/keyOf.js
--- lib copy/keyOf.js 2016-02-27 17:48:05.000000000 -0800
+++ lib/keyOf.js 2016-02-27 18:02:25.000000000 -0800
@@ -1,4 +1,6 @@
+"use strict";
+
/**
* Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
@@ -17,10 +19,8 @@
* have aliased that key to be 'xa12'. keyOf({className: null}) will return
* 'xa12' in that case. Resolve keys you want to use once at startup time, then
* reuse those resolutions.
*/
-"use strict";
-
var keyOf = function (oneKeyObj) {
var key;
for (key in oneKeyObj) {
if (!oneKeyObj.hasOwnProperty(key)) {
diff -U4 lib copy/maxBy.js lib/maxBy.js
--- lib copy/maxBy.js 2016-02-27 17:48:05.000000000 -0800
+++ lib/maxBy.js 2016-02-27 18:02:25.000000000 -0800
@@ -1,4 +1,6 @@
+'use strict';
+
/**
* Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
@@ -8,10 +10,8 @@
*
*
*/
-'use strict';
-
var minBy = require('./minBy');
var compareNumber = function (a, b) {
return a - b;
diff -U4 lib copy/memoizeStringOnly.js lib/memoizeStringOnly.js
--- lib copy/memoizeStringOnly.js 2016-02-27 17:48:04.000000000 -0800
+++ lib/memoizeStringOnly.js 2016-02-27 18:02:24.000000000 -0800
@@ -16,8 +16,9 @@
*
* @param {function} callback
* @return {function}
*/
+
function memoizeStringOnly(callback) {
var cache = {};
return function (string) {
if (!cache.hasOwnProperty(string)) {
diff -U4 lib copy/minBy.js lib/minBy.js
--- lib copy/minBy.js 2016-02-27 17:48:05.000000000 -0800
+++ lib/minBy.js 2016-02-27 18:02:25.000000000 -0800
@@ -1,4 +1,6 @@
+"use strict";
+
/**
* Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
@@ -8,10 +10,8 @@
*
*
*/
-"use strict";
-
var compareNumber = function (a, b) {
return a - b;
};
diff -U4 lib copy/nativeRequestAnimationFrame.js lib/nativeRequestAnimationFrame.js
--- lib copy/nativeRequestAnimationFrame.js 2016-02-27 17:48:04.000000000 -0800
+++ lib/nativeRequestAnimationFrame.js 2016-02-27 18:02:24.000000000 -0800
@@ -1,4 +1,6 @@
+"use strict";
+
/**
* Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
@@ -7,9 +9,7 @@
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
-"use strict";
-
var nativeRequestAnimationFrame = global.requestAnimationFrame || global.webkitRequestAnimationFrame || global.mozRequestAnimationFrame || global.oRequestAnimationFrame || global.msRequestAnimationFrame;
module.exports = nativeRequestAnimationFrame;
\ No newline at end of file
diff -U4 lib copy/nullthrows.js lib/nullthrows.js
--- lib copy/nullthrows.js 2016-02-27 17:48:05.000000000 -0800
+++ lib/nullthrows.js 2016-02-27 18:02:25.000000000 -0800
@@ -1,4 +1,6 @@
+"use strict";
+
/**
* Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
@@ -8,10 +10,8 @@
*
*
*/
-"use strict";
-
var nullthrows = function (x) {
if (x != null) {
return x;
}
diff -U4 lib copy/partitionArray.js lib/partitionArray.js
--- lib copy/partitionArray.js 2016-02-27 17:48:05.000000000 -0800
+++ lib/partitionArray.js 2016-02-27 18:02:25.000000000 -0800
@@ -1,4 +1,6 @@
+"use strict";
+
/**
* Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
@@ -14,10 +16,8 @@
* Partitions an array given a predicate. All elements satisfying the predicate
* are part of the first returned array, and all elements that don't are in the
* second.
*/
-"use strict";
-
function partitionArray(array, predicate, context) {
var first = [];
var second = [];
array.forEach(function (element, index) {
diff -U4 lib copy/performanceNow.js lib/performanceNow.js
--- lib copy/performanceNow.js 2016-02-27 17:48:05.000000000 -0800
+++ lib/performanceNow.js 2016-02-27 18:02:25.000000000 -0800
@@ -1,4 +1,6 @@
+'use strict';
+
/**
* Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
@@ -8,10 +10,8 @@
*
* @typechecks
*/
-'use strict';
-
var performance = require('./performance');
var performanceNow;
diff -U4 lib copy/removeFromArray.js lib/removeFromArray.js
--- lib copy/removeFromArray.js 2016-02-27 17:48:04.000000000 -0800
+++ lib/removeFromArray.js 2016-02-27 18:02:24.000000000 -0800
@@ -1,4 +1,6 @@
+"use strict";
+
/**
* Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
@@ -12,10 +14,8 @@
/**
* Removes an element from an array.
*/
-"use strict";
-
function removeFromArray(array, element) {
var index = array.indexOf(element);
if (index !== -1) {
array.splice(index, 1);
diff -U4 lib copy/requestAnimationFrame.js lib/requestAnimationFrame.js
--- lib copy/requestAnimationFrame.js 2016-02-27 17:48:03.000000000 -0800
+++ lib/requestAnimationFrame.js 2016-02-27 18:02:25.000000000 -0800
@@ -1,4 +1,6 @@
+'use strict';
+
/**
* Copyright 2014-2015, Facebook, Inc.
* All rights reserved.
*
@@ -7,10 +9,8 @@
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
-'use strict';
-
var emptyFunction = require('./emptyFunction');
var nativeRequestAnimationFrame = require('./nativeRequestAnimationFrame');
var lastTime = 0;
diff -U4 lib copy/someSet.js lib/someSet.js
--- lib copy/someSet.js 2016-02-27 17:48:05.000000000 -0800
+++ lib/someSet.js 2016-02-27 18:02:25.000000000 -0800
@@ -9,14 +9,14 @@
*
* @typechecks
*/
+'use strict';
+
/**
* The someSet() method tests whether some elements in the given Set pass the
* test implemented by the provided function.
*/
-'use strict';
-
function someSet(set, callback, context) {
var iterator = set.entries();
var current = iterator.next();
while (!current.done) {
diff -U4 lib copy/sprintf.js lib/sprintf.js
--- lib copy/sprintf.js 2016-02-27 17:48:04.000000000 -0800
+++ lib/sprintf.js 2016-02-27 18:02:24.000000000 -0800
@@ -1,4 +1,6 @@
+"use strict";
+
/**
* Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
@@ -17,10 +19,8 @@
* @param {string} format the base string
* @param ...args the values to insert
* @return {string} the replaced string
*/
-"use strict";
-
function sprintf(format) {
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
diff -U4 lib copy/xhrSimpleDataSerializer.js lib/xhrSimpleDataSerializer.js
--- lib copy/xhrSimpleDataSerializer.js 2016-02-27 17:48:05.000000000 -0800
+++ lib/xhrSimpleDataSerializer.js 2016-02-27 18:02:25.000000000 -0800
@@ -1,4 +1,6 @@
+'use strict';
+
/**
* Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
@@ -7,10 +9,8 @@
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
-'use strict';
-
function xhrSimpleDataSerializer(data) {
var uri = [];
var key;
for (key in data) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment