JavaScriptFunctionWithBreakpoints.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Tue, 24 Sep 2013 23:18:24 +0200
branchinitialV
changeset 1180 01c6be61f29c
parent 625 4c814c8123ed
child 749 1a1ce2bdc3d8
permissions -rw-r--r--
checkin from stx browser

"
 COPYRIGHT (c) 2013 by Claus Gittinger
              All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"
"{ Package: 'stx:libjavascript' }"

JavaScriptFunction variableSubclass:#JavaScriptFunctionWithBreakpoints
	instanceVariableNames:'originalMethod'
	classVariableNames:''
	poolDictionaries:''
	category:'Languages-JavaScript-Compiling & Parsing'
!

!JavaScriptFunctionWithBreakpoints class methodsFor:'documentation'!

copyright
"
 COPYRIGHT (c) 2013 by Claus Gittinger
              All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"
!

documentation
"
    support for line-Breakpoints

    instances of me are created when line-breakpoints are placed.
    The only function I serve is to provide the originalMethod information,
    and an easy way to check for having a breakpoint (is breakpointed).

    [author:]
        Claus Gittinger

    [see also:]
        Tools::BreakpointService
"
! !

!JavaScriptFunctionWithBreakpoints methodsFor:'accessing'!

originalMethod
    ^ originalMethod
!

originalMethod:something
    originalMethod := something.
! !

!JavaScriptFunctionWithBreakpoints methodsFor:'misc'!

restoreOriginalMethod
    "remove myself - i.e. replace by the original method 
     (i.e. the one without line breakpoints)"

    |cls selector|

    (cls := self mclass) notNil ifTrue:[
        (selector := self selector) notNil ifTrue:[
            self halt.
            cls basicAddSelector:selector withMethod:originalMethod    
        ]
    ]
! !

!JavaScriptFunctionWithBreakpoints methodsFor:'queries'!

isMethodWithBreakpoints
    ^ true

    "Created: / 01-08-2012 / 17:26:59 / cg"
! !

!JavaScriptFunctionWithBreakpoints class methodsFor:'documentation'!

version
    ^ '$Header$'
!

version_CVS
    ^ '$Header$'
! !