From d7586025d9492c77e1cece1798394146427a67a6 Mon Sep 17 00:00:00 2001 From: Nick Winter Date: Mon, 14 Jul 2014 11:05:51 -0700 Subject: [PATCH] Improved behavior of lint/runtime/transpilation problem error alert showing when not in JS mode. --- app/lib/world/thang_state.coffee | 3 ++- app/views/play/level/tome/spell_view.coffee | 7 +++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/lib/world/thang_state.coffee b/app/lib/world/thang_state.coffee index c4a1a540b..330e75892 100644 --- a/app/lib/world/thang_state.coffee +++ b/app/lib/world/thang_state.coffee @@ -30,6 +30,7 @@ module.exports = class ThangState if type is 'Vector' @props.push value?.copy() # could try storing [x, y, z] or {x, y, z} here instead if this is expensive else if type is 'object' or type is 'array' + console.log 'storing', prop, 'as', value if prop is 'myTiles' @props.push clone(value, true) else @props.push value @@ -144,7 +145,7 @@ module.exports = class ThangState # We make sure the array keys won't collide with any string keys by using some unprintable characters. stringPieces = ['\x1D'] # Group Separator for element in value - if element and element.isThang + if element and element.id # Was checking element.isThang, but we can't store non-strings anyway element = element.id stringPieces.push element, '\x1E' # Record Separator(s) value = stringPieces.join('') diff --git a/app/views/play/level/tome/spell_view.coffee b/app/views/play/level/tome/spell_view.coffee index 745e3c9fe..f9f43da33 100644 --- a/app/views/play/level/tome/spell_view.coffee +++ b/app/views/play/level/tome/spell_view.coffee @@ -368,7 +368,7 @@ module.exports = class SpellView extends View # Now that that's figured out, perform the update. # The web worker Aether won't track state, so don't have to worry about updating it finishUpdatingAether = (aether) => - @displayAether aether + @displayAether aether, codeIsAsCast @lastUpdatedAetherSpellThang = @spellThang @guessWhetherFinished aether if fromCodeChange @@ -396,10 +396,9 @@ module.exports = class SpellView extends View @aceSession.setAnnotations [] @highlightCurrentLine {} # This'll remove all highlights - displayAether: (aether) -> + displayAether: (aether, isCast=false) -> @displayedAether = aether - isCast = not _.isEmpty(aether.metrics) or _.some aether.problems.errors, {type: 'runtime'} - isCast = isCast or @spell.language isnt 'javascript' # Since we don't have linting for other languages + isCast = isCast or not _.isEmpty(aether.metrics) or _.some aether.problems.errors, {type: 'runtime'} problem.destroy() for problem in @problems # Just in case another problem was added since clearAetherDisplay() ran. @problems = [] annotations = []