compiler doesn't catch client/server data access failure #94

Open
exterm opened this Issue Nov 19, 2012 · 1 comment

Projects

None yet

1 participant

exterm commented Nov 19, 2012

Hi there,

it would be really nice if the compiler could catch things like this

client canvas = {width: 400, height: 200} 
server function try_this() {                                                 
  canvas.height                                                            
}

at the moment, I get a runtime error looking like this:

Uncaught exception : TypeError: Cannot read property '1' of undefined
TypeError: Cannot read property '1' of undefined
    at global.ccont (/usr/lib/opa/static/opa-js-runtime-cps/main.js:23:42)
    at ___stub_canvas (/tmp/opabug/test.js:143:141)
    at ___try_this_skip (/tmp/opabug/test.js:144:62)
    at ___ui_main_skip (/tmp/opabug/test.js:147:60)
    at ___ui_main (/tmp/opabug/test.js:148:63)
    at /usr/lib/opa/stdlib/stdlib.qmljs/stdlib.core.web.server.opx/a.js:806:61
    at ___check_partial_lazy_66746a24 (/usr/lib/opa/stdlib/stdlib.qmljs/stdlib.core.parser.opx/a.js:52:240)
    at Object.<anonymous> (/usr/lib/opa/stdlib/stdlib.qmljs/stdlib.core.web.server.opx/a.js:807:78)
    at global.execute_ (/usr/lib/opa/static/opa-js-runtime-cps/main.js:20:49)
    at global.execute1 (/usr/lib/opa/static/opa-js-runtime-cps/main.js:21:50)
exterm commented Nov 19, 2012

I just realised I can get a warning for this with --slicer-check pedantic but it warns only This can be inefficient which doesn't suggest it leads to a runtime error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment