eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'JavaScriptEnvironment':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: JavaScriptEnvironment


Inheritance:

   Object
   |
   +--JavaScriptEnvironment

Package:
stx:libjavascript
Category:
Languages-JavaScript-Framework
Version:
rev: 1.48 date: 2017/10/22 18:44:31
user: cg
file: JavaScriptEnvironment.st directory: libjavascript
module: stx stc-classLibrary: libjavascript

Class protocol:

queries
o  scriptingNamespace
return a namespace, in which the scripts global variables
are searched. Returning myself here, will make Math and Date
visible (maybe more in the future)


Instance protocol:

accessing
o  __theReceiver
keep this for backward compatibility

o  _argVariables

o  _beHTMLEnvironment

o  _defineFunction: aFunction as: selector
_functions isNil ifTrue:[

o  _defineVariable: name value: initialValue

o  _functions

** This is an obsolete interface - do not use it (it may vanish in future versions) **

o  _functions: aDictionary

** This is an obsolete interface - do not use it (it may vanish in future versions) **

o  _isHTMLEnvironment

o  _localVariables

o  _localVariables: aDictionary

o  _outStream

o  _outStream: aStream

o  _outerEnvironment

o  _outerEnvironment: anEnvironment

o  _theReceiver
keep this for backward compatibility

o  _theReceiver: anObject

o  _topEnvironment

o  isReturnedFrom: something
isReturnedFrom := something.

o  receiver

builtin functions
o  alert: msg

o  confirm: msg
(comment from inherited method)
open a modal yes-no dialog.
Return true for yes, false for no.
If no GUI is present (headless applications), true is returned.

Someone in the sender chain may redefine the confirmation handler
by handling the UserConfirmation.

o  js_alert: msg

o  js_confirm: msg

o  print: msg

o  println

o  println: msg

error handling
o  doesNotUnderstand: aMessage
(comment from inherited method)
this message is sent by the runtime system (VM) when
a message is not understood by some object (i.e. there
is no method for that selector). The original message has
been packed into aMessage (i.e. the receiver, selector and
any arguments) and the original receiver is then sent the
#doesNotUnderstand: message.
Here, we raise another signal which usually enters the debugger.
You can of course redefine #doesNotUnderstand: in your classes
to implement message delegation,
or handle the MessageNotUnderstood exception gracefully.

expression evaluation
o  _evaluateAction: aString with: aComponentName
invoked when some HTML-element (such as a button) with an ONCLICK
action is pressed. This is supposed to parse the passed string as
an expression in my language (i.e. javaScript) and invoke that
function.

o  _readEvalFrom: inputStream to: outputStream errorTo: errorStream

o  _readEvalFrom: inputStream to: outputStream errorTo: errorStream print: doPrint
self warn:'error in script: ' , ex description

o  _readEvalPrintFrom: inputStream to: outputStream errorTo: errorStream

o  exitWith: val

html-browser interaction
o  _start
cannot do:
usage example(s):
self perform:#js_start ifNotUnderstood:[].

o  _stop
cannot do:
usage example(s):
self perform:#js_stop ifNotUnderstood:[].

queries
o  _isFunctionEnvironment

o  isInnerFunction

o  isInnerJavaScriptBlock

o  isJavaScriptClassNode

setup
o  _setupForWindow: aWindow
painter notNil ifTrue:[


Private classes:

    AppletObject
    AppletsObject
    Array
    Date
    Document
    DocumentObject
    FormFieldObject
    FormObject
    FormsObject
    HistoryObject
    Math
    String
    WindowObject


ST/X 7.1.0.0; WebServer 1.663 at exept.de:8081; Mon, 19 Nov 2018 22:01:01 GMT