Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Rename StructuredAssignmentTracker -> ObjectShapeTracker
* Rename ReplaceableInitVariable -> ReplaceableInitializationVariable and simplify it as most of its logic (including the awkwardly named ReplaceableInitStructuredAssignmentTracker) are no longer needed now we assume all parameters to have unknown initial values
- Loading branch information
1 parent
ba7f8b2
commit 00a5b9c
Showing
9 changed files
with
47 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 0 additions & 40 deletions
40
src/ast/variables/ReplaceableInitStructuredAssignmentTracker.js
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import LocalVariable from './LocalVariable'; | ||
import { UNKNOWN_ASSIGNMENT } from '../values'; | ||
|
||
export default class ReplaceableInitializationVariable extends LocalVariable { | ||
constructor ( name, declarator ) { | ||
super( name, declarator, null ); | ||
} | ||
|
||
getName () { | ||
return this.name; | ||
} | ||
|
||
hasEffectsWhenAccessedAtPath ( path, options ) { | ||
return this._getInit( options ).hasEffectsWhenAccessedAtPath( path, options ) | ||
|| super.hasEffectsWhenAccessedAtPath( path, options ); | ||
} | ||
|
||
hasEffectsWhenAssignedAtPath ( path, options ) { | ||
return this._getInit( options ).hasEffectsWhenAssignedAtPath( path, options ) | ||
|| super.hasEffectsWhenAssignedAtPath( path, options ); | ||
} | ||
|
||
hasEffectsWhenCalledAtPath ( path, callOptions, options ) { | ||
return this._getInit( options ).hasEffectsWhenCalledAtPath( path, callOptions, options ) | ||
|| super.hasEffectsWhenCalledAtPath( path, callOptions, options ); | ||
} | ||
|
||
someReturnExpressionWhenCalledAtPath ( path, callOptions, predicateFunction, options ) { | ||
return this._getInit( options ).someReturnExpressionWhenCalledAtPath( path, callOptions, predicateFunction, options ) | ||
|| super.someReturnExpressionWhenCalledAtPath( path, callOptions, predicateFunction, options ); | ||
} | ||
|
||
_getInit ( options ) { | ||
return options.getReplacedVariableInit( this ) || UNKNOWN_ASSIGNMENT; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters