SSE4E GPError GPSystem ByteString ByteBuffer TLV TLVList Card Atr Key Crypto Application GPApplication GPSecDomain ASN1 CardFile IsoSecureChannel ApplFactory GPXML JsScript CardSim X509 CRL KeyStore CMSSignedData CMSGenerator XMLSignature OCSPQuery LDAP SOAP URLConnection PKCS11Provider PKCS11Session PKCS11Object OutlineNode OpenSCDP |
JsScript - Reference Documentation
Class implementing support for compiling and running script fragments Index of MethodsConstructorPrototypeJsScript(String filename) JsScript(String filename, Number lineno, String source) DescriptionCompile script.Arguments
Exceptions
Examplevar scriptsource = 'globalvar = 123; var localvar = 456;function f() { return 1};'; var s = new JsScript("sample", 1, scriptsource); newDynamicScope()Prototypevoid newDynamicScope(String constructor) DescriptionCreate a new dynamic scope using the given constructor function. A dynamic scope inherits all predefined top level functions and properties, but is otherwise a clean top level scope. Use this to create a runtime environment to execute scripts. Arguments
Return
Exceptions
Examplevar scope = JsScript.newDynamicScope("Object"); execute()Prototypevoid execute(Object scope) void execute(Object scope, String cwd) DescriptionExecute script within the defined scope object. The caller may specify a current working directory (cwd) which is used when executing the script. If not specified, then the current working directory of the calling script is used. Arguments
Return
Exceptions
Examples.execute(scope); assert(typeof(globalvar) == "undefined"); assert(typeof(scope.globalvar) != "undefined"); var thisdir = GPSystem.mapFilename("", GPSystem.CWD); var subdir = GPSystem.mapFilename("scriptdir", GPSystem.CWD); var s = new JsScript(subdir + "/test.js"); // Execute script with current directory of this script // The script will set the global variable cwd s.execute(this); assert(thisdir == cwd); // Execute script with subdirectory relative to this script s.execute(this, subdir); assert(subdir == cwd); © Copyright 2003 - 2010 CardContact Software & System Consulting, Minden, Germany |