/**
 * @generated SignedSource<<6c1a82d2f5918f03f3f0e5825e1f32f3>>
 *
 * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 * !! This file is a check-in of a static_upstream project!      !!
 * !!                                                            !!
 * !! You should not modify this file directly. Instead:         !!
 * !! 1) Use `fjs use-upstream` to temporarily replace this with !!
 * !!    the latest version from upstream.                       !!
 * !! 2) Make your changes, test them, etc.                      !!
 * !! 3) Use `fjs push-upstream` to copy your changes back to    !!
 * !!    static_upstream.                                        !!
 * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 *
 * Copyright 2013-2014 Facebook, Inc.
 * @providesModule _shouldPolyfillES6Collection
 * @preventMunge
 * @typechecks
 */

/**
 * Given a collection class name (Map or Set) return whether it's safe to use
 * the native polyfill.
 *
 * @param {string} collectionName
 */
function shouldPolyfillES6Collection(collectionName) {
  var Collection = global[collectionName];
  if (Collection == null) {
    return true;
  }

  var proto = Collection.prototype;

  // These checks are adapted from es6-shim https://fburl.com/34437854
  return Collection == null ||
    typeof Collection !== 'function' ||
    typeof proto.clear !== 'function' ||
    new Collection().size !== 0 ||
    typeof proto.keys !== 'function' ||
    typeof proto.forEach !== 'function' ||
    isCallableWithoutNew(Collection) ||
    !supportsSubclassing(Collection);
}

/**
 * Given a class can we subclass it?
 *
 * @param {function} Collection
 */
function supportsSubclassing(Collection) {
  class SubCollection extends Collection {}
  try {
    var s = (new SubCollection([]));
    // Firefox 32 will throw a type error when any operation is called on a
    // subclass.
    s.size;
    return s instanceof Collection;
  } catch (e) {
    return false;
  }
}

/**
 * Given a constructor can we call it without `new`?
 *
 * @param {function} Collection
 */
function isCallableWithoutNew(Collection) {
  try {
    Collection();
  } catch (e) {
    return false;
  }
  return true;
}

module.exports = shouldPolyfillES6Collection;

@@ -29,40 +29,40 @@
 ce%3C%3C
-6c1a82d2f5918f03f3f0e5825e1f32f3
+bf0749e529897a7c9687fff37310d4d2
 %3E%3E%0A 
@@ -765,30 +765,52 @@
 t 20
-13-2014 Facebook, Inc.
+04-present Facebook. All Rights Reserved.%0A *
 %0A * 
@@ -879,18 +879,12 @@
  * @
-typechecks
+flow
 %0A */
@@ -888,29 +888,38 @@
  */%0A%0A/**%0A * 
-Given
+Checks whether
  a collectio
@@ -924,124 +924,84 @@
 ion 
-class 
 name (
+e.g. %22
 Map
+%22
  or 
+%22
 Set
+%22
 ) 
-return whether it's safe to use%0A * the native polyfill.%0A *%0A * @param %7Bstring%7D collectionName
+has a native polyfill%0A * that is safe to be used.
 %0A */
@@ -1052,17 +1052,34 @@
 tionName
-)
+: string): boolean
  %7B%0A  var
@@ -1172,207 +1172,287 @@
 %0A%0A  
-var proto = Collection.prototype;%0A%0A  // These checks are adapted from es6-shim https://fburl.com/34437854%0A  return Collection == null %7C%7C%0A    typeof Collection !== 'function' %7C%7C%0A    typeof proto.clear
+// The iterator protocol depends on %60Symbol.iterator%60. If a collection is%0A  // implemented, but %60Symbol%60 is not, it's going to break iteration because%0A  // we'll be using custom %22@@iterator%22 instead, which is not implemented on%0A  // native collections.%0A  if (typeof global.Symbol
  !==
@@ -1466,822 +1466,517 @@
 ion'
- %7C%7C
+) %7B
 %0A    
-new Collection().size !== 0 %7C%7C%0A    typeof proto.keys !== 'function' %7C%7C%0A    typeof proto.forEach !== 'function' %7C%7C%0A    isCallableWithoutNew(Collection) %7C%7C%0A    !supportsSubclassing(Collection);%0A%7D%0A%0A/**%0A * Given a class can we subclass it?%0A *%0A * @param %7Bfunction%7D Collection%0A */%0Afunction supportsSubclassing(Collection) %7B%0A  class SubCollection extends Collection %7B%7D%0A  try %7B%0A    var s = (new SubCollection(%5B%5D));%0A    // Firefox 32 will throw a type error when any operation is called on a%0A    // subclass.%0A    s.size;%0A    return s instanceof Collection;%0A  %7D catch (e) %7B%0A    return false;%0A  %7D%0A%7D%0A%0A/**%0A * Given a constructor can we call it without %60new%60?%0A *%0A * @param %7Bfunction%7D Collection%0A */%0Afunction isCallableWithoutNew(Collection) %7B%0A  try %7B%0A    Collection();%0A  %7D catch (e) %7B%0A    return false;%0A  %7D%0A  return true
+return true;%0A  %7D%0A%0A  var proto = Collection.prototype;%0A%0A  // These checks are adapted from es6-shim: https://fburl.com/34437854%0A  // NOTE: %60isCallableWithoutNew%60 and %60!supportsSubclassing%60 are not checked%0A  // because they make debugging with %22break on exceptions%22 difficult.%0A  return Collection == null %7C%7C%0A    typeof Collection !== 'function' %7C%7C%0A    typeof proto.clear !== 'function' %7C%7C%0A    new Collection().size !== 0 %7C%7C%0A    typeof proto.keys !== 'function' %7C%7C%0A    typeof proto.forEach !== 'function'
 ;%0A%7D%0A

Remove Throwing Collection Checks (rFBOBJC)