Syntax | Effect | How/where it is used? |
{' javascript '} | Inline the javascript code in the generated code. It is used to implement basic operations that are provided by javascript language or can be expressed by minimal variations of it. Most times are used to implement basic operations like Primitive ops in smalltalk. | Use references tool with searchSource: for {' |
object#propertyName | Generate the code to direct access the property(propertyName) of the object. It is equivalent to dot op in javascript. The result can be undefined. It is reccomended to be written as object basicAt: propertyName(or basicAt:ifAbsent:) | See implementors of accessors to NativeObject properties e.g. HTMLElement>>#scrollTop |
#{aName} | Lookup for object named aName will be realized in javascript. The result can be undefined. Note: in case the name is lowercase, the S8 compiler do not force the existence of the target, so if the name is not found in the executing context lookup will continue at the javascript upper contexts (e.g. global object). | See implementation of Object>>#halt |
# aMessage | The use of # for receiver means the receiver is missing, and the function activated for the message will be look up in global context. For example # gcgenerates javascript code gc() | See implementation of Object>>#print: |
receiver #message: arg1 with: arg: 2 and: arg3 | Will call function "message" (selector up to first colon, ignoring remaining parts of the selector) with the arguments. In the example it will generate javascript codereceiver.message(arg1,arg2,arg3) | See implementation of Number>>#isNumber |
! Object methodsFor: #test ! sample | k m | k::',m' := self twoReturnedValues. ^k::',Mat@m'! !