I have this sample c2runtime.js
Important code has TESTVAR.
How do I migrate to c3 runtime?
Thanks
// ECMAScript 5 strict mode
"use strict";
assert2(cr, "cr namespace not created");
assert2(cr.plugins_, "cr.plugins_ not created");
/////////////////////////////////////
// Plugin class
cr.plugins_.MyCompany_SingleGlobal = function(runtime)
{
this.runtime = runtime;
};
(function ()
{
var TESTVAR=5;
var pluginProto = cr.plugins_.MyCompany_SingleGlobal.prototype;
/////////////////////////////////////
// Object type class
pluginProto.Type = function(plugin)
{
this.plugin = plugin;
this.runtime = plugin.runtime;
};
var typeProto = pluginProto.Type.prototype;
typeProto.onCreate = function()
{
};
/////////////////////////////////////
// Instance class
pluginProto.Instance = function(type)
{
this.type = type;
this.runtime = type.runtime;
// Initialise object properties
this.testProperty = 0;
};
var instanceProto = pluginProto.Instance.prototype;
instanceProto.onCreate = function()
{
// Read properties set in C3
this.testProperty = this.properties[0];
};
instanceProto.saveToJSON = function ()
{
return {};
};
instanceProto.loadFromJSON = function (o)
{
};
/**BEGIN-PREVIEWONLY**/
instanceProto.getDebuggerValues = function (propsections)
{
};
/**END-PREVIEWONLY**/
//////////////////////////////////////
// Conditions
function Cnds() {};
Cnds.prototype.IsLargeNumber = function (number)
{
//return number > 100;
return TESTVAR;
};
pluginProto.cnds = new Cnds();
//////////////////////////////////////
// Actions
function Acts() {};
Acts.prototype.Alert = function ()
{
alert("Test property = " + this.testProperty);
};
pluginProto.acts = new Acts();
//////////////////////////////////////
// Expressions
function Exps() {};
Exps.prototype.Double = function (ret, number)
{
ret.set_float(number * 2);
};
pluginProto.exps = new Exps();
}());