29
import _ReactError from \\"shared/ReactError\\";
30
import invariant from 'shared/invariant';
31
32
-(function () {
33
- if (!condition) {
34
- if (__DEV__) {
35
- throw _ReactError(Error(\\"Do not override existing functions.\\"));
36
- } else {
37
- throw _ReactErrorProd(Error(16));
38
- }
32
+if (!condition) {
33
+ if (__DEV__) {
34
+ throw _ReactError(Error(\\"Do not override existing functions.\\"));
35
+ } else {
36
+ throw _ReactErrorProd(Error(16));
37
}
40
-})();"
38
+}"
39
`;
40
41
exports[`error transform should support invariant calls with a concatenated template string and args 1`] = `
43
import _ReactError from \\"shared/ReactError\\";
44
import invariant from 'shared/invariant';
45
48
-(function () {
49
- if (!condition) {
50
- if (__DEV__) {
51
- throw _ReactError(Error(\\"Expected a component class, got \\" + Foo + \\".\\" + Bar));
52
- } else {
53
- throw _ReactErrorProd(Error(18), Foo, Bar);
54
- }
46
+if (!condition) {
47
+ if (__DEV__) {
48
+ throw _ReactError(Error(\\"Expected a component class, got \\" + Foo + \\".\\" + Bar));
49
+ } else {
50
+ throw _ReactErrorProd(Error(18), Foo, Bar);
51
}
56
-})();"
52
+}"
53
`;
54
55
exports[`error transform should support invariant calls with args 1`] = `
57
import _ReactError from \\"shared/ReactError\\";
58
import invariant from 'shared/invariant';
59
64
-(function () {
65
- if (!condition) {
66
- if (__DEV__) {
67
- throw _ReactError(Error(\\"Expected \\" + foo + \\" target to be an array; got \\" + bar));
68
- } else {
69
- throw _ReactErrorProd(Error(7), foo, bar);
70
- }
60
+if (!condition) {
61
+ if (__DEV__) {
62
+ throw _ReactError(Error(\\"Expected \\" + foo + \\" target to be an array; got \\" + bar));
63
+ } else {
64
+ throw _ReactErrorProd(Error(7), foo, bar);
65
}
72
-})();"
66
+}"
67
`;
68
69
exports[`error transform should support noMinify option 1`] = `
70
"import _ReactError from \\"shared/ReactError\\";
71
import invariant from 'shared/invariant';
72
79
-(function () {
80
- if (!condition) {
81
- throw _ReactError(Error(\\"Do not override existing functions.\\"));
82
- }
83
-})();"
73
+if (!condition) {
74
+ throw _ReactError(Error(\\"Do not override existing functions.\\"));
75
+}"
76
`;