Mysterious bug prevents casting


#1

I’ve been playing around with the gridmancer challenge and I managed to hit 33 with a fairly simple solution. I’ve been trying to improve upon that though and I think I’ve done it, however whenever I click cast it sends two errors to the js console and nothing happens on the web page. The two errors given are here.

Uncaught Error: These should be removed before the transform step vendor.js:59362
$BreakState.transform vendor.js:59362
$State.transformMachineState vendor.js:59254
$CPSTransformer.transformMachineStates vendor.js:60234
$CPSTransformer.generateMachineInnerFunction vendor.js:60156
$GeneratorTransformer.transformGeneratorBody vendor.js:60665
$GeneratorTransformer.transformGeneratorBody vendor.js:60684
$GeneratorTransformPass.transformBody_ vendor.js:60850
$GeneratorTransformPass.transformFunction_ vendor.js:60830
$GeneratorTransformPass.transformFunctionExpression vendor.js:60827
$FunctionExpression.transform vendor.js:49262
$ParseTreeTransformer.transformAny vendor.js:50933
$ParseTreeTransformer.transformBinaryOperator vendor.js:51008
$BinaryOperator.transform vendor.js:48501
$ParseTreeTransformer.transformAny vendor.js:50933
$ParseTreeTransformer.transformExpressionStatement vendor.js:51182
$ExpressionStatement.transform vendor.js:49081
$ParseTreeTransformer.transformAny vendor.js:50933
$ParseTreeTransformer.transformList vendor.js:50939
$TempVarTransformer.transformStatements_ vendor.js:56903
$TempVarTransformer.transformFunctionBody vendor.js:56938
$__superCall vendor.js:63659
$GeneratorTransformPass.transformBody_ vendor.js:60837
$GeneratorTransformPass.transformFunction_ vendor.js:60830
$GeneratorTransformPass.transformFunctionExpression vendor.js:60827
$FunctionExpression.transform vendor.js:49262
$ParseTreeTransformer.transformAny vendor.js:50933
$ParseTreeTransformer.transformCallExpression vendor.js:51036
$CallExpression.transform vendor.js:48608
$ParseTreeTransformer.transformAny vendor.js:50933
$ParseTreeTransformer.transformParenExpression vendor.js:51392
$ParenExpression.transform vendor.js:49738
$ParseTreeTransformer.transformAny vendor.js:50933
$ParseTreeTransformer.transformReturnStatement vendor.js:51443
$ReturnStatement.transform vendor.js:49912
$ParseTreeTransformer.transformAny vendor.js:50933
$ParseTreeTransformer.transformList vendor.js:50939
$TempVarTransformer.transformStatements_ vendor.js:56903
$TempVarTransformer.transformScript vendor.js:56923
$Script.transform vendor.js:49802
$ParseTreeTransformer.transformAny vendor.js:50933
$GeneratorTransformPass.transformTree vendor.js:60868
(anonymous function) vendor.js:63190
chain vendor.js:63199
transform vendor.js:63188
$ProgramTransformer.transformTree_ vendor.js:63218
$ProgramTransformer.transform vendor.js:63179
$ProgramTransformer.transformFile_ vendor.js:63170
(anonymous function) vendor.js:63164
$ProgramTransformer.transform_ vendor.js:63163
ProgramTransformer.transform vendor.js:63243
$Compiler.transform_ vendor.js:63592
$Compiler.compile_ vendor.js:63573
module.exports.Aether.traceurify vendor.js:66021
module.exports.Aether.purifyCode vendor.js:66139
module.exports.Aether.transpile vendor.js:65849
module.exports.Spell.transpile app.js:36388
module.exports.SpellView.onFirepadLoaded app.js:37439
(anonymous function) app.js:37244

XMLHttpRequest cannot load http://errorception.com/projects/51a79585ee207206390002a2/err. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://codecombat.com' is therefore not allowed access.

EDIT:
It appears upon refreshing that it also prevents the level from loading. It just be that the level isn’t loading though.

EDIT 2:
I looked carefully, it loads the level but then screws up at the building world phase with the same errors as above.


#2

This sounds like a bug in Aether related to traceur not letting you use break statements. I’ll have to check it out.

Meantime, it sounds like I’ll have to go in and recover the code, since CodeCombat won’t build the world given the Aether bug. Can you let me know your email (feel free to send it privately) or Wizard _id (just go to http://codecombat.com/auth/whoami)? That’ll let me pull that up.

Thanks! Excited to see this improved-upon solution so I can put it into the game itself. :smile:


#3

Nice chatting with you in-game today, and congratulations on getting to 30 rectangles! You beat me by three, and only one away from theoretical optimal. That’s solid.

To any other players trying to use break statements in a plan() method, it’s a confirmed bug in Aether (through traceur) which I’ll have quite some time fixing–sorry. Try wrapping your loops in booleans as a workaround. (I know it’s nasty.)


#4

Whoops, I hit this too while having a rather frustrating time with the editor. I was breaking out of a loop so +1 on needing to fix it :slight_smile:


#5

I did make a small improvement such that it shouldn’t horribly crash when you use a break statement (haven’t fixed continue yet though)–did the break do the wrong thing, or did it prevent the spell from casting at all?

We’ll see what the traceur guys have to say about how I can fix this: https://github.com/google/traceur-compiler/issues/605


#6

In my case it seems I’ve rendered the site inoperable, not sure if adding the break statement was the final straw in the hat but one of the last things I did. I didn’t have an account yet so this is what I have from above wizzard ID link:

{
  "_id": "52bf9aa899264e565d0010ee",
  "testGroupNumber": 155,
  "__v": 1,
  "volume": 0,
  "wizardColor1": 0.7879119499120861,
  "preferredLanguage": "en-US",
  "anonymous": true,
  "permissions": [],
  "emailSubscriptions": [
    "announcement"
  ],
  "music": false,
  "name": "",
  "dateCreated": "2013-12-29T03:44:40.732Z",
  "emailHash": "5e543256c480ac577d30f76f9120eb74"
}

#7

Okay, that helped. I see that you had a break breakHere; labeled break statement, which is doubly problematic for my poor transpiler! Sorry about that. I’ve recovered your code so you could try again to work around it. Thanks for your patience, and for helping to debug this one.