Page 1 of 1

@Per: JS API functions not configurable

Posted: 25 Feb 2012, 04:29
by aubergine
QScriptValue::ReadOnly makes all the JS API functions exposed to the scripting environment non-configurable (in addition to being read-only), which means that I can't overwrite them with my own functions.

If the functions were configurable, I could backport some bug fixes and new features that are available in master in to public releases such as betas.

There are two reasons I want to do that:

1. Make my scripts ready for future versions and get them out in the wild sooner for people to test

2. Allow my scripts to run on more than just the latest release of WZ.

Specifically, I want to retain the existing function names so that the functions my script is calling match up with the JS API docs. I'd like to try creating a "backport.js" that could be include()'d in scripts to help make them work on a wider range of public releases. This will allow script devs to start using newer features sooner, overcome (some) bugs in current releases whilst keeping their code closely matched to master.

Could the QScriptValue::ReadOnly flag be removed? (leaving just the QScriptValue::Undeletable flag)

Re: @Per: JS API functions not configurable

Posted: 02 Mar 2012, 04:02
by aubergine
This topic can be nuked/closed - I've found out how to overwrite the non-configurable JS API properties/functions :)