Fixed logic for displaying runtime errors from last run based on code being the same as last cast.

This commit is contained in:
Nick Winter 2014-05-01 17:41:06 -07:00
parent 26cafd2f19
commit 9f18811701
2 changed files with 4 additions and 5 deletions

View file

@ -92,7 +92,7 @@ module.exports = class Spell
@worker.addEventListener "message", (e) =>
workerData = JSON.parse e.data
if workerData.function is "hasChangedSignificantly" and workerData.spellKey is @spellKey
@worker.removeEventListener("message",arguments.callee, false)
@worker.removeEventListener "message", arguments.callee, false
cb(workerData.hasChanged)
@worker.postMessage JSON.stringify(workerMessage)

View file

@ -324,7 +324,7 @@ module.exports = class SpellView extends View
needsUpdate = codeHasChangedSignificantly or @spellThang isnt @lastUpdatedAetherSpellThang
return if not needsUpdate and aether is @displayedAether
castAether = @spellThang.castAether
codeIsAsCast = castAether and not hasChanged
codeIsAsCast = castAether and source is castAether.raw
aether = castAether if codeIsAsCast
return if not needsUpdate and aether is @displayedAether
@ -345,7 +345,7 @@ module.exports = class SpellView extends View
@worker.addEventListener "message", (e) =>
workerData = JSON.parse e.data
if workerData.function is "transpile" and workerData.spellKey is @spell.spellKey
@worker.removeEventListener("message",arguments.callee, false)
@worker.removeEventListener "message", arguments.callee, false
aether.problems = workerData.problems
aether.raw = source
finishUpdatingAether(aether)
@ -353,7 +353,6 @@ module.exports = class SpellView extends View
else
finishUpdatingAether(aether)
clearAetherDisplay: ->
problem.destroy() for problem in @problems
@problems = []
@ -384,7 +383,7 @@ module.exports = class SpellView extends View
# Autocast:
# Goes immediately if the code is a) changed and b) complete/valid and c) the cursor is at beginning or end of a line
# We originall thought it would:
# We originally thought it would:
# - Go after specified delay if a) and b) but not c)
# - Go only when manually cast or deselecting a Thang when there are errors
# But the error message display was delayed, so now trying: