author | Claus Gittinger <cg@exept.de> |
Fri, 21 Feb 2020 20:48:14 +0100 | |
changeset 1231 | b7d945ef967a |
parent 1190 | 73848707e95c |
child 1234 | 5a99959b4e99 |
permissions | -rw-r--r-- |
342 | 1 |
" |
911 | 2 |
COPYRIGHT (c) 2006 by Claus Gittinger / eXept Software AG |
342 | 3 |
All Rights Reserved |
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
217 | 12 |
"{ Package: 'stx:libjavascript' }" |
13 |
||
853 | 14 |
"{ NameSpace: Smalltalk }" |
15 |
||
217 | 16 |
LibraryDefinition subclass:#stx_libjavascript |
17 |
instanceVariableNames:'' |
|
18 |
classVariableNames:'' |
|
19 |
poolDictionaries:'' |
|
249 | 20 |
category:'* Projects & Packages *' |
217 | 21 |
! |
22 |
||
342 | 23 |
!stx_libjavascript class methodsFor:'documentation'! |
24 |
||
25 |
copyright |
|
26 |
" |
|
911 | 27 |
COPYRIGHT (c) 2006 by Claus Gittinger / eXept Software AG |
342 | 28 |
All Rights Reserved |
29 |
||
30 |
This software is furnished under a license and may be used |
|
31 |
only in accordance with the terms of that license and with the |
|
32 |
inclusion of the above copyright notice. This software may not |
|
33 |
be provided or otherwise made available to, or used by, any |
|
34 |
other person. No title to or ownership of the software is |
|
35 |
hereby transferred. |
|
36 |
" |
|
37 |
! |
|
38 |
||
39 |
documentation |
|
40 |
" |
|
853 | 41 |
Package documentation: |
42 |
||
43 |
This library contains a JavaSript Parser/Compiler, generating Smalltalk bytecode. |
|
44 |
It is integrated into the browser, and allows programming in a JavaScript-like |
|
45 |
language in a similar fashion to Smalltalk. |
|
46 |
(i.e. incremental compilation, debugging, changing code in the debugger etc) |
|
911 | 47 |
|
48 |
[author:] |
|
49 |
cg |
|
50 |
||
51 |
[primary maintainer:] |
|
52 |
cg |
|
342 | 53 |
" |
54 |
! ! |
|
217 | 55 |
|
329 | 56 |
!stx_libjavascript class methodsFor:'description'! |
57 |
||
58 |
excludedFromPreRequisites |
|
432 | 59 |
"list all packages which should be ignored in the automatic |
60 |
preRequisites scan. See #preRequisites for more." |
|
61 |
||
329 | 62 |
^ #( |
1179 | 63 |
"/ #'stx:libbasic2' "Random - referenced by Math class>>randomInteger:_: " |
329 | 64 |
#'stx:libview' "Color - referenced by JavaScriptSyntaxHighlighter>>markSelector:from:to:receiverNode:numArgs: " |
999 | 65 |
#'stx:libview2' "ApplicationModel - referenced by JavaScriptCodeGeneratorTool>>anyApplicationClassInProjectOf:" |
66 |
#'stx:libwidg' "Workspace - referenced by JavaScriptEnvironment>>doesNotUnderstand:" |
|
67 |
#'stx:goodies/refactoryBrowser/parser' "ParseTreeSearcher - referenced by JavaScriptCodeGeneratorTool>>codeFor_shouldImplementFor:inClass:" |
|
68 |
#'stx:goodies/webServer' "HTTPService - referenced by JavaScriptCodeGeneratorTool>>createDocumentationMethodFor:" |
|
329 | 69 |
) |
999 | 70 |
|
71 |
"Modified: / 05-07-2018 / 11:46:12 / Stefan Vogel" |
|
329 | 72 |
! |
73 |
||
578
c1ddcb0b55b1
Now preRequiites are separated in mandatoryPreRequisites and referencedPreRequisites
Stefan Vogel <sv@exept.de>
parents:
577
diff
changeset
|
74 |
mandatoryPreRequisites |
875
84461495c7ee
class: SequenceableCollection
Claus Gittinger <cg@exept.de>
parents:
862
diff
changeset
|
75 |
"list packages which are mandatory as a prerequisite. |
84461495c7ee
class: SequenceableCollection
Claus Gittinger <cg@exept.de>
parents:
862
diff
changeset
|
76 |
This are packages containing superclasses of my classes and classes which |
84461495c7ee
class: SequenceableCollection
Claus Gittinger <cg@exept.de>
parents:
862
diff
changeset
|
77 |
are extended by myself. |
84461495c7ee
class: SequenceableCollection
Claus Gittinger <cg@exept.de>
parents:
862
diff
changeset
|
78 |
They are mandatory, because we need these packages as a prerequisite for loading and compiling. |
1121 | 79 |
When loading whole packages, |
80 |
mandatoryPreRequisites will be automatically loaded |
|
81 |
BEFORE this packet has been loaded. |
|
875
84461495c7ee
class: SequenceableCollection
Claus Gittinger <cg@exept.de>
parents:
862
diff
changeset
|
82 |
This method is generated automatically, |
934 | 83 |
by searching along the inheritance chain of all of my classes. |
84 |
Please take a look at the #referencedPreRequisites method as well." |
|
432 | 85 |
|
329 | 86 |
^ #( |
1179 | 87 |
#'stx:libbasic' "AbstractMultidimensionalArray - extended" |
88 |
#'stx:libbasic2' "Matrix - extended" |
|
875
84461495c7ee
class: SequenceableCollection
Claus Gittinger <cg@exept.de>
parents:
862
diff
changeset
|
89 |
#'stx:libbasic3' "HTMLDocGenerator - superclass of HTMLDocGeneratorForJavaScript" |
84461495c7ee
class: SequenceableCollection
Claus Gittinger <cg@exept.de>
parents:
862
diff
changeset
|
90 |
#'stx:libcomp' "AssignmentNode - superclass of JavaScriptParser::JavaScriptAssignmentNode" |
993 | 91 |
#'stx:libtool' "CodeGeneratorTool - superclass of JavaScriptCodeGeneratorTool" |
578
c1ddcb0b55b1
Now preRequiites are separated in mandatoryPreRequisites and referencedPreRequisites
Stefan Vogel <sv@exept.de>
parents:
577
diff
changeset
|
92 |
) |
c1ddcb0b55b1
Now preRequiites are separated in mandatoryPreRequisites and referencedPreRequisites
Stefan Vogel <sv@exept.de>
parents:
577
diff
changeset
|
93 |
! |
c1ddcb0b55b1
Now preRequiites are separated in mandatoryPreRequisites and referencedPreRequisites
Stefan Vogel <sv@exept.de>
parents:
577
diff
changeset
|
94 |
|
c1ddcb0b55b1
Now preRequiites are separated in mandatoryPreRequisites and referencedPreRequisites
Stefan Vogel <sv@exept.de>
parents:
577
diff
changeset
|
95 |
referencedPreRequisites |
875
84461495c7ee
class: SequenceableCollection
Claus Gittinger <cg@exept.de>
parents:
862
diff
changeset
|
96 |
"list packages which are a prerequisite, because they contain |
84461495c7ee
class: SequenceableCollection
Claus Gittinger <cg@exept.de>
parents:
862
diff
changeset
|
97 |
classes which are referenced by my classes. |
934 | 98 |
These packages are NOT needed as a prerequisite for compiling or loading, |
875
84461495c7ee
class: SequenceableCollection
Claus Gittinger <cg@exept.de>
parents:
862
diff
changeset
|
99 |
however, a class from it may be referenced during execution and having it |
84461495c7ee
class: SequenceableCollection
Claus Gittinger <cg@exept.de>
parents:
862
diff
changeset
|
100 |
unloaded then may lead to a runtime doesNotUnderstand error, unless the caller |
84461495c7ee
class: SequenceableCollection
Claus Gittinger <cg@exept.de>
parents:
862
diff
changeset
|
101 |
includes explicit checks for the package being present. |
1121 | 102 |
When loading whole packages, |
103 |
referencedPreRequisites will be automatically loaded |
|
104 |
AFTER this packet has been loaded. |
|
875
84461495c7ee
class: SequenceableCollection
Claus Gittinger <cg@exept.de>
parents:
862
diff
changeset
|
105 |
This method is generated automatically, |
934 | 106 |
by searching all classes (and their packages) which are referenced by my classes. |
107 |
Please also take a look at the #mandatoryPreRequisites method" |
|
578
c1ddcb0b55b1
Now preRequiites are separated in mandatoryPreRequisites and referencedPreRequisites
Stefan Vogel <sv@exept.de>
parents:
577
diff
changeset
|
108 |
|
c1ddcb0b55b1
Now preRequiites are separated in mandatoryPreRequisites and referencedPreRequisites
Stefan Vogel <sv@exept.de>
parents:
577
diff
changeset
|
109 |
^ #( |
329 | 110 |
) |
1160 | 111 |
! |
112 |
||
113 |
subProjects |
|
114 |
"list packages which are known as subprojects. |
|
115 |
The generated makefile will enter those and make there as well. |
|
116 |
However: they are only built, not forced to be loaded when a package is loaded; |
|
117 |
for those, redefine #referencedPrerequisites or #mandatoryPreRequisites." |
|
118 |
||
119 |
^ #( |
|
120 |
) |
|
329 | 121 |
! ! |
122 |
||
226 | 123 |
!stx_libjavascript class methodsFor:'description - compilation'! |
124 |
||
125 |
additionalDefinitions_nt_dot_mak |
|
126 |
^ ' |
|
127 |
# see stdHeader_nt for LIBJAVASCRIPT_BASE |
|
128 |
LIB_BASE_LD_ARG=-b:$(LIBJAVASCRIPT_BASE) |
|
129 |
' |
|
130 |
! ! |
|
131 |
||
217 | 132 |
!stx_libjavascript class methodsFor:'description - contents'! |
133 |
||
134 |
classNamesAndAttributes |
|
432 | 135 |
"lists the classes which are to be included in the project. |
136 |
Each entry in the list may be: a single class-name (symbol), |
|
137 |
or an array-literal consisting of class name and attributes. |
|
138 |
Attributes are: #autoload or #<os> where os is one of win32, unix,..." |
|
139 |
||
217 | 140 |
^ #( |
259 | 141 |
"<className> or (<className> attributes...) in load order" |
142 |
HTMLDocGeneratorForJavaScript |
|
329 | 143 |
JavaScriptClass |
144 |
JavaScriptClassNode |
|
993 | 145 |
JavaScriptCodeGeneratorTool |
767 | 146 |
JavaScriptCompletionEngine |
147 |
JavaScriptConstantNode |
|
329 | 148 |
JavaScriptEnvironment |
149 |
JavaScriptFunction |
|
150 |
JavaScriptFunctionNode |
|
151 |
JavaScriptMetaclass |
|
487 | 152 |
JavaScriptObject |
993 | 153 |
JavaScriptParseNodeVisitor |
329 | 154 |
JavaScriptScanner |
802
2ff589c676c5
class: JavaScriptCompilerWithBreakpointSupport
Claus Gittinger <cg@exept.de>
parents:
790
diff
changeset
|
155 |
JavaScriptSimulatedBrowserEnvironment |
329 | 156 |
JavaScriptSourceFileWriter |
157 |
JavaScriptSourceReader |
|
158 |
JavaScriptVariable |
|
159 |
JavaScriptVariableNode |
|
304 | 160 |
Math |
487 | 161 |
STXJavaScriptLanguage |
329 | 162 |
#'stx_libjavascript' |
767 | 163 |
JavaScriptFunctionWithBreakpoints |
329 | 164 |
JavaScriptInnerFunctionNode |
993 | 165 |
JavaScriptParseNodeValidator |
329 | 166 |
JavaScriptParser |
167 |
JavaScriptCompiler |
|
767 | 168 |
JavaScriptCompletionParser |
329 | 169 |
JavaScriptSyntaxHighlighter |
619 | 170 |
JavaScriptCompilerWithBreakpointSupport |
217 | 171 |
) |
172 |
! |
|
173 |
||
174 |
extensionMethodNames |
|
885 | 175 |
"lists the extension methods which are to be included in the project. |
1168 | 176 |
Entries are 2-element array literals, consisting of class-name and selector. |
177 |
A correponding method with real names must be present in my concrete subclasses |
|
178 |
if it has extensions." |
|
432 | 179 |
|
217 | 180 |
^ #( |
561 | 181 |
AbstractTime #'js_add:' |
182 |
AbstractTime #'js_addFromTime:' |
|
1160 | 183 |
AbstractTime #'js_getHours' |
329 | 184 |
AbstractTime #'js_getMilliseconds' |
1160 | 185 |
AbstractTime #'js_getMinutes' |
329 | 186 |
AbstractTime #'js_getSeconds' |
187 |
ArithmeticValue #'js_add:' |
|
561 | 188 |
ArithmeticValue #'js_addFromNumber:' |
189 |
ArithmeticValue #'js_addFromTime:' |
|
329 | 190 |
Behavior #'js_new' |
191 |
Behavior #'js_new:' |
|
1174 | 192 |
Behavior #'js_new:new:' |
193 |
Behavior #'js_new:new:new:' |
|
1165 | 194 |
Block #'js_typeof' |
934 | 195 |
Boolean #'js_asBoolean' |
1165 | 196 |
Boolean #'js_typeof' |
329 | 197 |
CharacterArray charAt0: |
198 |
CharacterArray charAt1: |
|
199 |
CharacterArray charCodeAt0: |
|
200 |
CharacterArray charCodeAt1: |
|
201 |
CharacterArray indexOf0: |
|
202 |
CharacterArray indexOf1: |
|
561 | 203 |
CharacterArray #'js_add:' |
204 |
CharacterArray #'js_addFromNumber:' |
|
205 |
CharacterArray #'js_addFromString:' |
|
206 |
CharacterArray #'js_addFromTime:' |
|
934 | 207 |
CharacterArray #'js_indexOf:' |
208 |
CharacterArray #'js_indexOf:_:' |
|
209 |
CharacterArray #'js_lastIndexOf:' |
|
210 |
CharacterArray #'js_lastIndexOf:_:' |
|
993 | 211 |
CharacterArray #'js_split:' |
1165 | 212 |
CharacterArray #'js_typeof' |
329 | 213 |
CharacterArray lastIndexOf0: |
214 |
CharacterArray lastIndexOf1: |
|
215 |
CharacterArray quote |
|
934 | 216 |
CharacterArray substr0: |
329 | 217 |
CharacterArray #'substr0:_:' |
934 | 218 |
CharacterArray substr1: |
329 | 219 |
CharacterArray #'substr1:_:' |
220 |
CharacterArray substring0: |
|
221 |
CharacterArray #'substring0:_:' |
|
222 |
CharacterArray substring1: |
|
223 |
CharacterArray #'substring1:_:' |
|
224 |
CharacterArray toLowerCase |
|
225 |
CharacterArray toUpperCase |
|
226 |
CharacterArray trim |
|
227 |
CharacterArray trimLeft |
|
228 |
CharacterArray trimRight |
|
934 | 229 |
Collection forEach: |
329 | 230 |
Collection length |
934 | 231 |
False #'js_not' |
232 |
Integer #'js_asBoolean' |
|
233 |
Integer #'js_not' |
|
1165 | 234 |
Number #'js_typeof' |
1144 | 235 |
Number toExponential |
329 | 236 |
Number toExponential: |
237 |
Number #'toExponential:_:' |
|
1146 | 238 |
Number toFixed |
329 | 239 |
Number toFixed: |
561 | 240 |
Object #'js_addFromString:' |
934 | 241 |
Object #'js_asBoolean' |
242 |
Object #'js_at:' |
|
1121 | 243 |
Object #'js_at:at:' |
244 |
Object #'js_at:at:at:' |
|
245 |
Object #'js_at:at:at:put:' |
|
246 |
Object #'js_at:at:put:' |
|
934 | 247 |
Object #'js_at:put:' |
1190 | 248 |
Object #'js_await' |
934 | 249 |
Object #'js_length' |
250 |
Object #'js_new' |
|
251 |
Object #'js_new:' |
|
1165 | 252 |
Object #'js_typeof' |
1168 | 253 |
Object #'js_valueOf' |
934 | 254 |
ParseNode isBreakStatement |
329 | 255 |
SequenceableCollection concat: |
934 | 256 |
SequenceableCollection doesNotUnderstand: |
329 | 257 |
SequenceableCollection every: |
258 |
SequenceableCollection filter: |
|
259 |
SequenceableCollection indexOf0: |
|
260 |
SequenceableCollection indexOf1: |
|
261 |
SequenceableCollection join: |
|
427 | 262 |
SequenceableCollection #'js_add:' |
934 | 263 |
SequenceableCollection #'js_concat' |
264 |
SequenceableCollection #'js_concat:' |
|
265 |
SequenceableCollection #'js_concat:_:' |
|
266 |
SequenceableCollection #'js_concat:_:_:' |
|
267 |
SequenceableCollection #'js_concat:_:_:_:' |
|
268 |
SequenceableCollection #'js_concat:_:_:_:_:' |
|
269 |
SequenceableCollection #'js_concat:_:_:_:_:_:' |
|
270 |
SequenceableCollection #'js_indexOf:' |
|
271 |
SequenceableCollection #'js_indexOf:_:' |
|
272 |
SequenceableCollection #'js_lastIndexOf:' |
|
273 |
SequenceableCollection #'js_lastIndexOf:_:' |
|
329 | 274 |
SequenceableCollection #'js_map:' |
275 |
SequenceableCollection lastIndexOf0: |
|
276 |
SequenceableCollection lastIndexOf1: |
|
277 |
SequenceableCollection pop |
|
278 |
SequenceableCollection push: |
|
279 |
SequenceableCollection reduce0: |
|
280 |
SequenceableCollection #'reduce0:_:' |
|
281 |
SequenceableCollection reduce1: |
|
282 |
SequenceableCollection #'reduce1:_:' |
|
283 |
SequenceableCollection shift |
|
284 |
SequenceableCollection #'slice0:_:' |
|
285 |
SequenceableCollection #'slice1:_:' |
|
286 |
SequenceableCollection some: |
|
287 |
SequenceableCollection unshift: |
|
1025 | 288 |
Signal #'js_add:' |
289 |
SignalSet #'js_add:' |
|
1172 | 290 |
Stream #'_convertPrintArgs:' |
1023 | 291 |
Stream log: |
1135 | 292 |
Stream #'log:_:' |
293 |
Stream #'log:_:_:' |
|
294 |
Stream #'log:_:_:_:' |
|
295 |
Stream #'log:_:_:_:_:' |
|
296 |
Stream #'log:_:_:_:_:_:' |
|
297 |
Stream #'log:_:_:_:_:_:_:' |
|
1172 | 298 |
Stream #'log:_:_:_:_:_:_:_:' |
299 |
Stream #'log:_:_:_:_:_:_:_:_:' |
|
329 | 300 |
Stream #'show:_:' |
301 |
Stream #'show:_:_:' |
|
302 |
Stream #'show:_:_:_:' |
|
303 |
Stream #'show:_:_:_:_:' |
|
304 |
Stream #'show:_:_:_:_:_:' |
|
561 | 305 |
Stream #'show:_:_:_:_:_:_:' |
1135 | 306 |
Stream #'show:_:_:_:_:_:_:_:' |
307 |
Stream #'show:_:_:_:_:_:_:_:_:' |
|
329 | 308 |
Stream #'showCR:_:' |
309 |
Stream #'showCR:_:_:' |
|
310 |
Stream #'showCR:_:_:_:' |
|
311 |
Stream #'showCR:_:_:_:_:' |
|
312 |
Stream #'showCR:_:_:_:_:_:' |
|
561 | 313 |
Stream #'showCR:_:_:_:_:_:_:' |
1135 | 314 |
Stream #'showCR:_:_:_:_:_:_:_:' |
315 |
Stream #'showCR:_:_:_:_:_:_:_:_:' |
|
1160 | 316 |
Timestamp #'js_getDate' |
317 |
Timestamp #'js_getDay' |
|
318 |
Timestamp #'js_getFullYear' |
|
319 |
Timestamp #'js_getMonth' |
|
320 |
Timestamp #'js_getYear' |
|
934 | 321 |
True #'js_not' |
1165 | 322 |
UndefinedObject #'js_typeof' |
1132 | 323 |
'Boolean class' #'js_new:' |
329 | 324 |
'Collection class' #'with:_:' |
325 |
'Collection class' #'with:_:_:' |
|
326 |
'Collection class' #'with:_:_:_:' |
|
327 |
'Collection class' #'with:_:_:_:_:' |
|
328 |
'Collection class' #'with:_:_:_:_:_:' |
|
329 |
'Collection class' #'with:_:_:_:_:_:_:' |
|
330 |
'Collection class' #'with:_:_:_:_:_:_:_:' |
|
1040 | 331 |
'Date class' #'js_new' |
329 | 332 |
'Date class' #'js_new:' |
1045 | 333 |
'Date class' #'js_new:new:' |
1040 | 334 |
'Date class' #'js_new:new:new:' |
1045 | 335 |
'Date class' #'js_new:new:new:new:' |
336 |
'Date class' #'js_new:new:new:new:new:' |
|
1040 | 337 |
'Date class' #'js_new:new:new:new:new:new:' |
338 |
'Date class' #'js_new:new:new:new:new:new:new:' |
|
329 | 339 |
'Date class' now |
1025 | 340 |
'GenericException class' #'js_add:' |
561 | 341 |
'GenericException class' #'js_new:' |
1174 | 342 |
'Matrix class' #'js_new:new:' |
329 | 343 |
'Number class' #'MAX_VALUE' |
344 |
'Number class' #'MIN_VALUE' |
|
345 |
'Number class' #'NEGATIVE_INFINITY' |
|
346 |
'Number class' NaN |
|
347 |
'Number class' #'POSITIVE_INFINITY' |
|
1143 | 348 |
'Number class' isFinite: |
1127 | 349 |
'Number class' isInteger: |
1143 | 350 |
'Number class' isNaN: |
329 | 351 |
'Number class' #'js_new:' |
1143 | 352 |
'Number class' parseFloat: |
353 |
'Number class' parseInt: |
|
329 | 354 |
'String class' fromCharCode: |
1038 | 355 |
'String class' #'js_new:' |
217 | 356 |
) |
357 |
! ! |
|
358 |
||
359 |
!stx_libjavascript class methodsFor:'description - project information'! |
|
360 |
||
361 |
companyName |
|
362 |
"Return a companyname which will appear in <lib>.rc" |
|
363 |
||
910 | 364 |
^ 'Claus Gittinger / eXept Software AG' |
365 |
||
366 |
"Modified: / 18-11-2016 / 11:48:09 / cg" |
|
217 | 367 |
! |
368 |
||
369 |
description |
|
370 |
"Return a description string which will appear in nt.def / bc.def" |
|
371 |
||
899 | 372 |
^ 'Smalltalk/X JavaScript Bytecode Compiler' |
217 | 373 |
! |
374 |
||
375 |
legalCopyright |
|
376 |
"Return a copyright string which will appear in <lib>.rc" |
|
377 |
||
912 | 378 |
^ 'Copyright Claus Gittinger 2012\nCopyright eXept Software AG 2012' |
262 | 379 |
|
912 | 380 |
"Modified: / 18-11-2016 / 12:18:42 / cg" |
577 | 381 |
! |
382 |
||
383 |
productName |
|
384 |
"Return a product name which will appear in <lib>.rc" |
|
385 |
||
386 |
^ 'Smalltalk/X' |
|
217 | 387 |
! ! |
388 |
||
389 |
!stx_libjavascript class methodsFor:'documentation'! |
|
390 |
||
391 |
version |
|
392 |
^ '$Header$' |
|
378 | 393 |
! |
394 |
||
395 |
version_CVS |
|
396 |
^ '$Header$' |
|
217 | 397 |
! ! |
577 | 398 |