rename path verification methods to introspection and add NodePath#getSource method

This commit is contained in:
Sebastian McKenzie 2015-06-07 23:36:12 +01:00
parent ede6237b6f
commit eb72ea3e5a
2 changed files with 14 additions and 1 deletions

View File

@ -7,4 +7,4 @@
- `replacement` - Methods responsible for replacing a node with another.
- `removal` - Methods responsible for removing a node.
- `family` - Methods responsible for dealing with/retrieving children or siblings.
- `verification` - Methodsresponsible for introspecting the current path for certain values.
- `introspection` - Methods responsible for introspecting the current path for certain values.

View File

@ -210,3 +210,16 @@ export function referencesImport(moduleSource, importName) {
return false;
}
/**
* Description
*/
export function getSource() {
var node = this.node;
if (node.end) {
return this.hub.file.code.slice(node.start, node.end);
} else {
return "";
}
}