Handled a couple errors.

This commit is contained in:
Nick Winter 2014-01-22 10:56:49 -08:00
parent 24c4051442
commit 3b7a908dcd
2 changed files with 3 additions and 3 deletions

View file

@ -26,7 +26,7 @@ module.exports = class SpellToolbarView extends View
return unless total = @callState?.statementsExecuted
@statementIndex = Math.min(total - 1, Math.max(0, statementIndex))
@statementRatio = @statementIndex / (total - 1)
@statementTime = @callState.statements[@statementIndex].userInfo.time
@statementTime = @callState.statements[@statementIndex]?.userInfo.time ? 0
@$el.find('.bar').css('width', 100 * @statementRatio + '%')
Backbone.Mediator.publish 'tome:spell-statement-index-updated', statementIndex: @statementIndex, ace: @ace
@$el.find('.step-backward').prop('disabled', @statementIndex is 0)
@ -83,7 +83,7 @@ module.exports = class SpellToolbarView extends View
setCallState: (callState, statementIndex, @callIndex, @metrics) ->
return if callState is @callState and statementIndex is @statementIndex
return unless @callState = callState
if not @maintainIndexHover and not @maintainIndexScrub and statementIndex? and callState.statements[statementIndex].userInfo.time isnt @statementTime
if not @maintainIndexHover and not @maintainIndexScrub and statementIndex? and callState.statements[statementIndex]?.userInfo.time isnt @statementTime
@setStatementIndex statementIndex
else
@setStatementRatio @statementRatio

View file

@ -370,7 +370,7 @@ module.exports = class SpellView extends View
#console.log thangID, "got new castAether with raw", aether.raw, "problems", aether.problems
spellThang.castAether = aether
spellThang.aether = @spell.createAether e.world.getThangByID(thangID)
#console.log thangID, @spell.spellKey, "ran", aether.metrics.callsExecuted, "times over", aether.metrics.statementsExecuted, "statements, with max recursion depth", aether.metrics.maxDepth, "and full flow/metrics", aether.metrics, aether.flow
console.log thangID, @spell.spellKey, "ran", aether.metrics.callsExecuted, "times over", aether.metrics.statementsExecuted, "statements, with max recursion depth", aether.metrics.maxDepth, "and full flow/metrics", aether.metrics, aether.flow
@spell.transpile()
@updateAether false, false