mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-27 17:45:40 -05:00
Improved behavior of lint/runtime/transpilation problem error alert showing when not in JS mode.
This commit is contained in:
parent
ef30f6f477
commit
d7586025d9
2 changed files with 5 additions and 5 deletions
|
@ -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('')
|
||||
|
|
|
@ -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 = []
|
||||
|
|
Loading…
Reference in a new issue