Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Global init level is wrong type #954

Open
david-pfx opened this issue Mar 5, 2023 · 2 comments
Open

Global init level is wrong type #954

david-pfx opened this issue Mar 5, 2023 · 2 comments

Comments

@david-pfx
Copy link

initLevel is of type Object, but level is of type Level. This is the core bug.

If a compile fails before it creates any levels, then the level is never set correctly, and convertLevelToString fails with a TypeError. So there is no output from the test.

As well, wrapper.js suppresses all console output, making this a totally silent and mysterious failure.

As a workaround, patching consolePrint() in wrapper.js is enough to allow these errors to be diagnosed. Why is it switched off?

I'm happy to provide fixes, but need feedback first.

@increpare
Copy link
Owner

increpare commented Mar 10, 2023

Hello, this issue has me a bit confused.

Could you tell me the name of one of the tests that exhibits this behaviour?

When you say there's no output from the test - if there's no output from a test I'd assume the test would loudly fail...are you saying that some tests aren't actually being run because they're terminating mid-way?

@david-pfx
Copy link
Author

Just run the tests in the debugger and watch the console. See below.
There are two exceptions that are trapped but do not emit error messages (except to the console). The rest are type errors that should not happen. I know why, but the fix is not one I'd like to make without consultation.

compiler.js:2914 aborting compilation
testingFrameWork.js:83 TypeError: Cannot read properties of undefined (reading 'STRIDE_MOV')
    at setGameState (engine.js:604:23)
    at compile (compiler.js:2959:9)
    at runCompilationTest (testingFrameWork.js:81:3)
    at Object.<anonymous> (tests.js:57:8)
    at Test.run (qunit-1.12.0.js:203:18)
    at qunit-1.12.0.js:361:10
    at process (qunit-1.12.0.js:1453:24)
    at next (qunit-1.12.0.js:1446:3)
compiler.js:2914 Error: Too many errors/warnings; aborting compilation.
    at TooManyErrors (parser.js:32:11)
    at logError (parser.js:67:17)
    at checkObjectsAreLayered (compiler.js:2203:17)
    at loadFile (compiler.js:2847:5)
    at compile (compiler.js:2911:21)
    at runCompilationTest (testingFrameWork.js:81:3)
    at Object.<anonymous> (tests.js:57:8)
    at Test.run (qunit-1.12.0.js:203:18)
    at qunit-1.12.0.js:361:10
    at process (qunit-1.12.0.js:1453:24)
compiler.js:2914 TypeError: Cannot read properties of undefined (reading 'layer')
    at generateExtraMembers (compiler.js:358:51)
    at loadFile (compiler.js:2817:5)
    at compile (compiler.js:2911:21)
    at runCompilationTest (testingFrameWork.js:81:3)
    at Object.<anonymous> (tests.js:57:8)
    at Test.run (qunit-1.12.0.js:203:18)
    at qunit-1.12.0.js:361:10
    at process (qunit-1.12.0.js:1453:24)
    at next (qunit-1.12.0.js:1446:3)
testingFrameWork.js:83 TypeError: Cannot read properties of undefined (reading 'STRIDE_MOV')
    at setGameState (engine.js:604:23)
    at compile (compiler.js:2959:9)
    at runCompilationTest (testingFrameWork.js:81:3)
    at Object.<anonymous> (tests.js:57:8)
    at Test.run (qunit-1.12.0.js:203:18)
    at qunit-1.12.0.js:361:10
    at process (qunit-1.12.0.js:1453:24)
    at next (qunit-1.12.0.js:1446:3)
compiler.js:2914 TypeError: Cannot read properties of undefined (reading 'push')
    at generateSoundData (compiler.js:2699:56)
    at loadFile (compiler.js:2853:5)
    at compile (compiler.js:2911:21)
    at runCompilationTest (testingFrameWork.js:81:3)
    at Object.<anonymous> (tests.js:57:8)
    at Test.run (qunit-1.12.0.js:203:18)
    at qunit-1.12.0.js:361:10
    at process (qunit-1.12.0.js:1453:24)
    at next (qunit-1.12.0.js:1446:3)
compiler.js:2914 TypeError: Cannot read properties of undefined (reading 'anyBitsInCommon')
    at levelFromString (compiler.js:476:34)
    at levelsToArray (compiler.js:505:21)
    at loadFile (compiler.js:2819:5)
    at compile (compiler.js:2911:21)
    at runCompilationTest (testingFrameWork.js:81:3)
    at Object.<anonymous> (tests.js:57:8)
    at Test.run (qunit-1.12.0.js:203:18)
    at qunit-1.12.0.js:361:10
    at process (qunit-1.12.0.js:1453:24)
    at next (qunit-1.12.0.js:1446:3)
testingFrameWork.js:83 TypeError: Cannot read properties of undefined (reading 'STRIDE_MOV')
    at setGameState (engine.js:604:23)
    at compile (compiler.js:2959:9)
    at runCompilationTest (testingFrameWork.js:81:3)
    at Object.<anonymous> (tests.js:57:8)
    at Test.run (qunit-1.12.0.js:203:18)
    at qunit-1.12.0.js:361:10
    at process (qunit-1.12.0.js:1453:24)
    at next (qunit-1.12.0.js:1446:3)
compiler.js:2914 TypeError: Cannot read properties of undefined (reading 'groupNumber')
    at processRuleString (compiler.js:678:73)
    at rulesToArray (compiler.js:897:23)
    at loadFile (compiler.js:2820:5)
    at compile (compiler.js:2911:21)
    at runCompilationTest (testingFrameWork.js:81:3)
    at Object.<anonymous> (tests.js:57:8)
    at Test.run (qunit-1.12.0.js:203:18)
    at qunit-1.12.0.js:361:10
    at process (qunit-1.12.0.js:1453:24)
    at next (qunit-1.12.0.js:1446:3)
testingFrameWork.js:83 TypeError: Cannot read properties of undefined (reading 'STRIDE_MOV')
    at setGameState (engine.js:604:23)
    at compile (compiler.js:2959:9)
    at runCompilationTest (testingFrameWork.js:81:3)
    at Object.<anonymous> (tests.js:57:8)
    at Test.run (qunit-1.12.0.js:203:18)
    at qunit-1.12.0.js:361:10
    at process (qunit-1.12.0.js:1453:24)
    at next (qunit-1.12.0.js:1446:3)
compiler.js:2914 TypeError: Cannot read properties of undefined (reading 'reverse')
    at rewriteUpLeftRules (compiler.js:991:25)
    at rulesToArray (compiler.js:933:9)
    at loadFile (compiler.js:2820:5)
    at compile (compiler.js:2911:21)
    at runCompilationTest (testingFrameWork.js:81:3)
    at Object.<anonymous> (tests.js:57:8)
    at Test.run (qunit-1.12.0.js:203:18)
    at qunit-1.12.0.js:361:10
    at process (qunit-1.12.0.js:1453:24)
    at next (qunit-1.12.0.js:1446:3)
testingFrameWork.js:83 TypeError: Cannot read properties of undefined (reading 'STRIDE_MOV')
    at setGameState (engine.js:604:23)
    at compile (compiler.js:2959:9)
    at runCompilationTest (testingFrameWork.js:81:3)
    at Object.<anonymous> (tests.js:57:8)
    at Test.run (qunit-1.12.0.js:203:18)
    at qunit-1.12.0.js:361:10
    at process (qunit-1.12.0.js:1453:24)
    at next (qunit-1.12.0.js:1446:3)
compiler.js:2914 aborting compilation
testingFrameWork.js:83 TypeError: Cannot read properties of undefined (reading 'STRIDE_MOV')
    at setGameState (engine.js:604:23)
    at compile (compiler.js:2959:9)
    at runCompilationTest (testingFrameWork.js:81:3)
    at Object.<anonymous> (tests.js:57:8)
    at Test.run (qunit-1.12.0.js:203:18)
    at qunit-1.12.0.js:361:10
    at process (qunit-1.12.0.js:1453:24)
    at next (qunit-1.12.0.js:1446:3)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants