UNPKG

1.11 kBJavaScriptView Raw
1/**
2 * Copyright (c) 2013-present, Facebook, Inc.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 *
7 *
8 */
9'use strict';
10
11/**
12 * WARNING: DO NOT manually require this module.
13 * This is a replacement for `invariant(...)` used by the error code system
14 * and will _only_ be required by the corresponding babel pass.
15 * It always throws.
16 */
17
18function reactProdInvariant(code) {
19 var argCount = arguments.length - 1;
20
21 var message = 'Minified React error #' + code + '; visit ' + 'http://facebook.github.io/react/docs/error-decoder.html?invariant=' + code;
22
23 for (var argIdx = 0; argIdx < argCount; argIdx++) {
24 message += '&args[]=' + encodeURIComponent(arguments[argIdx + 1]);
25 }
26
27 message += ' for the full message or use the non-minified dev environment' + ' for full errors and additional helpful warnings.';
28
29 var error = new Error(message);
30 error.name = 'Invariant Violation';
31 error.framesToPop = 1; // we don't care about reactProdInvariant's own frame
32
33 throw error;
34}
35
36module.exports = reactProdInvariant;
\No newline at end of file