Compiling a method on GS

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Compiling a method on GS

GLASS mailing list
Hi,

GS version: 3.4.1
Behavior>>compile:classified:
   "Returns nil, or a selector Symbol, or signals a CompileError"

But it compile source with compilation errors and does no signal any
CompileError.
Example:
[Object
compileMethod:
'compilationError
  ^ self2 add: self3'
category: 'other'
using: GsSession currentSession symbolList]
on: CompileError do: [:ex | ex halt].

This create the method that is not compilable and does not signal anything.

Or the method has a bug or the comments is wrong ?

I'm polishing (https://github.com/jgfoster/Jade/issues/243) to avoid non
compilable source to be introduced in the Rewrite Tool.

Jade Rewrite tool screenshoot here
<https://user-images.githubusercontent.com/4719282/73143716-4f5f7600-407c-11ea-9cbb-05e71949a401.png>  

regards,
bruno



--
Sent from: http://forum.world.st/GLASS-f1460844.html
_______________________________________________
Glass mailing list
[hidden email]
https://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: Compiling a method on GS

GLASS mailing list
Hi,
Tested on GS 3.5.1

It seems that are 3 groups of methods to compile expressions:
1) Answer an exception if the compilation fail
[Object
compileMethod:
'compilationError
  ^ self2 add: self3'
dictionaries: GsSession currentSession symbolList
category: 'other'
environmentId: 0]
on: CompileError do: [:ex | ex halt].

2) Does not answer an exception but it does NOT compile the source
[Object
compileMethod:
'compilationError
  ^self2 add: self3'
dictionaries: GsSession currentSession symbolList
category: 'other' ]
on: CompileError do: [:ex | ex halt].

3) Does not answer an exception (if the source is well formatted) and it
does compile the source:
[Object
compileMethod:
'compilationError
  ^ self2 add: self9 '
category: 'other'
using: GsSession currentSession symbolList]
on: CompileError do: [:ex | ex halt].

But if evaluate the following it does answer an exception (with an invalid
formatted source):
[Object
compileMethod:
'compilationError
  ^ self2 add: self9 ; adf() '
category: 'other'
using: GsSession currentSession symbolList]
on: CompileError do: [:ex | ex halt].



--
Sent from: http://forum.world.st/GLASS-f1460844.html
_______________________________________________
Glass mailing list
[hidden email]
https://lists.gemtalksystems.com/mailman/listinfo/glass