# HG changeset patch # User Claus Gittinger # Date 967387730 -7200 # Node ID 0f513f04c50f9997cd73741f326420dc81e2de64 # Parent e65efbf519000969d4b4b810b427793b684a1805 #readsFields: and #writesField: for st80 compatibility diff -r e65efbf51900 -r 0f513f04c50f Method.st --- a/Method.st Wed Aug 23 12:32:28 2000 +0200 +++ b/Method.st Sun Aug 27 16:48:50 2000 +0200 @@ -2241,6 +2241,17 @@ "Modified: 7.11.1996 / 19:06:22 / cg" ! +readsField:instVarIndex + "return true, if the instvar at instVarIndex is read by the receiver. + Uses parser (for now); could look at bytecode as well here..." + + |varName readInstVars| + + varName := (self mclass allInstVarNames) at:instVarIndex. + readInstVars := self parse:#'parseMethodSilent:' return:#readInstVars or:#(). + ^ readInstVars includes:varName. +! + resourceType "ST-80 compatibility: return the methods first resource specs key; either nil, @@ -2538,6 +2549,17 @@ m originalMethod == self ifTrue:[^ m]. ]. ^ nil +! + +writesField:instVarIndex + "return true, if the instvar at instVarIndex is written (modified) by the receiver. + Uses parser (for now); could look at bytecode as well here..." + + |varName modifiedInstVars| + + varName := (self mclass allInstVarNames) at:instVarIndex. + modifiedInstVars := self parse:#'parseMethodSilent:' return:#modifiedInstVars or:#(). + ^ modifiedInstVars includes:varName. ! ! !Method methodsFor:'trap methods'! @@ -2724,6 +2746,6 @@ !Method class methodsFor:'documentation'! version - ^ '$Header: /cvs/stx/stx/libbasic/Method.st,v 1.203 2000-08-22 22:16:33 cg Exp $' + ^ '$Header: /cvs/stx/stx/libbasic/Method.st,v 1.204 2000-08-27 14:48:50 cg Exp $' ! ! Method initialize!