jshost error - test.js:2: ReferenceError: LoadModule is not defined

38 views
Skip to first unread message

Vasim attar

unread,
Mar 6, 2013, 6:33:12 AM3/6/13
to jsl...@googlegroups.com
Hi all,

    I am new to javascript and jslibs,

    I have checked out current sources of jslibs trunk (rev: 3651) from svn (http://jslibs.googlecode.com/svn/trunk/) and compiled it for my Linux (fedora-11).
    After compilation, It creates all shared objects (.so) and binaries under jslibs/Linux_32_opt

    But I am not able to run the scipts using "jshost", 

    When I run jshost to execute script, It gave me error that "ReferenceError: LoadModule is not defined"   
    Ex:
    $ jshost  test.js
    test.js:2: ReferenceError: LoadModule is not defined

My test.js file content are as follows:

------File helloword.js -----

 LoadModule('jsstd');
 LoadModule('jsnspr');
 
 var file = new File('file_test.txt');
 if ( file.exist ) {
    file.Open( File.RDONLY );
    print( 'file content:\n'+file.Read() );
    file.Close();
 }
  
------File helloword.js -----


Can anyone provide me input how to execute scrips using jshost?
                         OR
Am I doing something wrong in the script.
Where can I find the definition of  "LoadModule"?

Thanks in Advance,
Vasim Attar.





 


soubok

unread,
Mar 7, 2013, 8:43:18 AM3/7/13
to jsl...@googlegroups.com
Hello,
the on-line documentation is not up to date (the online documentation is related to latest downloadable binaries).
In latest jslibs versions I introduced the host object in the global namespace.
The LoadModule is now a member of the host object, you can use :
host.loadModule('jsstd');
-OR-
var loadModule = host.loadModule;
loadModule('jsstd');

Note that you can try to generate the latest documentation using: src/common/doc.js

Thanks,
Franck.
Reply all
Reply to author
Forward
0 new messages