Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions Lara-JS/src-api/lara/pass/SimplePass.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,20 +60,21 @@ export default abstract class SimplePass extends Pass {
}

/**
* Apply tranformation to
* Apply tranformation to matching joinpoints
*
* @param $jp - Joinpoint on which the pass will be applied
* @param data - Optional data that may be needed to perform the transformation
* @returns Results of applying this pass to the given joinpoint
*/
_apply_impl($jp: LaraJoinPoint): AggregatePassResult {
_apply_impl($jp: LaraJoinPoint, data?: any): AggregatePassResult {
const matchingJps = this._selectedJps($jp).filter(($jp) =>
this.matchJoinpoint($jp)
);

const aggResult = new AggregatePassResult(this, $jp);
for (const $jp of matchingJps) {
try {
const result = this.transformJoinpoint($jp);
const result = this.transformJoinpoint($jp, data);
aggResult.pushResult(result);
} catch (e) {
if (e instanceof PassTransformationError) {
Expand All @@ -97,7 +98,8 @@ export default abstract class SimplePass extends Pass {
* Transformation to be applied to matching joinpoints
*
* @param $jp - Join point to transform
* @param data - Optional data that may be needed to perform the transformation
* @returns The result of the transformation
*/
abstract transformJoinpoint($jp: LaraJoinPoint): PassResult | never;
abstract transformJoinpoint($jp: LaraJoinPoint, data?: any): PassResult | never;
}