File tree Expand file tree Collapse file tree 7 files changed +31
-10
lines changed
development-svelte-builds Expand file tree Collapse file tree 7 files changed +31
-10
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,10 @@ if (DEPRECATED_PARTIALS) {
11
11
} ;
12
12
}
13
13
14
+ if ( DEPRECATED_PARTIALS && someOtherThing ( ) ) {
15
+ doStuff ( ) ;
16
+ }
17
+
14
18
export let ObjectController ;
15
19
if ( DEPRECATED_CONTROLLERS ) {
16
20
ObjectController = class {
Original file line number Diff line number Diff line change @@ -11,6 +11,10 @@ if (DEPRECATED_PARTIALS) {
11
11
} ;
12
12
}
13
13
14
+ if ( DEPRECATED_PARTIALS && someOtherThing ( ) ) {
15
+ doStuff ( ) ;
16
+ }
17
+
14
18
export let ObjectController ;
15
19
16
20
if ( DEPRECATED_CONTROLLERS ) {
Original file line number Diff line number Diff line change @@ -9,6 +9,10 @@ if (DEPRECATED_PARTIALS) {
9
9
} ;
10
10
}
11
11
12
+ if ( DEPRECATED_PARTIALS && someOtherThing ( ) ) {
13
+ doStuff ( ) ;
14
+ }
15
+
12
16
export let ObjectController ;
13
17
if ( DEPRECATED_CONTROLLERS ) {
14
18
ObjectController = class {
Original file line number Diff line number Diff line change @@ -9,6 +9,10 @@ if (false) {
9
9
} ;
10
10
}
11
11
12
+ if ( false && someOtherThing ( ) ) {
13
+ doStuff ( ) ;
14
+ }
15
+
12
16
export let ObjectController ;
13
17
if ( true ) {
14
18
ObjectController = class {
Original file line number Diff line number Diff line change @@ -9,6 +9,10 @@ if (false) {
9
9
} ;
10
10
}
11
11
12
+ if ( false && someOtherThing ( ) ) {
13
+ doStuff ( ) ;
14
+ }
15
+
12
16
export let ObjectController ;
13
17
14
18
if ( true ) {
Original file line number Diff line number Diff line change @@ -9,6 +9,10 @@ if (DEPRECATED_PARTIALS) {
9
9
} ;
10
10
}
11
11
12
+ if ( DEPRECATED_PARTIALS && someOtherThing ( ) ) {
13
+ doStuff ( ) ;
14
+ }
15
+
12
16
export let ObjectController ;
13
17
if ( DEPRECATED_CONTROLLERS ) {
14
18
ObjectController = class {
@@ -22,4 +26,4 @@ export default class TheThingToReplaceControllers {
22
26
constructor ( ) {
23
27
this . isNew = true ;
24
28
}
25
- }
29
+ }
Original file line number Diff line number Diff line change @@ -98,11 +98,10 @@ module.exports = class Macros {
98
98
if ( binding !== undefined ) {
99
99
binding . referencePaths . forEach ( p => {
100
100
let t = builder . t ;
101
- if ( envFlags . DEBUG ) {
102
- if ( svelteMap [ source ] [ flag ] === false ) {
103
- if ( ! p . parentPath . isIfStatement ( ) ) {
104
- return ;
105
- }
101
+ // in debug builds add an error after a conditional (to ensure if the
102
+ // specific branch is taken, an error is thrown)
103
+ if ( envFlags . DEBUG && svelteMap [ source ] [ flag ] === false ) {
104
+ if ( p . parentPath . isIfStatement ( ) ) {
106
105
let consequent = p . parentPath . get ( 'consequent' ) ;
107
106
consequent . unshiftContainer (
108
107
'body' ,
@@ -115,10 +114,8 @@ module.exports = class Macros {
115
114
)
116
115
) ;
117
116
}
118
- } else {
119
- if ( p . parentPath . isIfStatement ( ) ) {
120
- p . replaceWith ( t . booleanLiteral ( svelteMap [ source ] [ flag ] ) ) ;
121
- }
117
+ } else if ( envFlags . DEBUG === false ) {
118
+ p . replaceWith ( t . booleanLiteral ( svelteMap [ source ] [ flag ] ) ) ;
122
119
}
123
120
} ) ;
124
121
You can’t perform that action at this time.
0 commit comments