diff options
author | eric thul <thul.eric@gmail.com> | 2016-11-19 13:57:32 -0500 |
---|---|---|
committer | eric thul <thul.eric@gmail.com> | 2016-11-19 13:57:32 -0500 |
commit | 45c62a2c766132a13c546b19025e9c1ef25bcd5b (patch) | |
tree | 108c0b3403f6b4ff2afbc85eca8532f305c94f77 /src/PscIde.js | |
parent | 28124e28f18c5aae38e149a3fc9624b46a906281 (diff) | |
download | purs-loader-45c62a2c766132a13c546b19025e9c1ef25bcd5b.tar.gz purs-loader-45c62a2c766132a13c546b19025e9c1ef25bcd5b.tar.zst purs-loader-45c62a2c766132a13c546b19025e9c1ef25bcd5b.zip |
Use emitError and emitWarning
Diffstat (limited to 'src/PscIde.js')
-rw-r--r-- | src/PscIde.js | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/PscIde.js b/src/PscIde.js index 2e105be..27b49f6 100644 --- a/src/PscIde.js +++ b/src/PscIde.js | |||
@@ -156,11 +156,17 @@ function rebuild(psModule) { | |||
156 | .then(resolve) | 156 | .then(resolve) |
157 | .catch(() => resolve(psModule)) | 157 | .catch(() => resolve(psModule)) |
158 | } | 158 | } |
159 | cache.errors = compileMessages.join('\n') | 159 | const errorMessage = compileMessages.join('\n'); |
160 | if (errorMessage.length) { | ||
161 | psModule.emitError(errorMessage); | ||
162 | } | ||
160 | resolve(psModule); | 163 | resolve(psModule); |
161 | } else { | 164 | } else { |
162 | cache.warnings = compileMessages.join('\n') | 165 | const warningMessage = compileMessages.join('\n'); |
163 | resolve(psModule) | 166 | if (options.warnings && warningMessage.length) { |
167 | psModule.emitWarning(warningMessage); | ||
168 | } | ||
169 | resolve(psModule); | ||
164 | } | 170 | } |
165 | }) | 171 | }) |
166 | }) | 172 | }) |