Skip to content

Commit

Permalink
Merge pull request #1616 from xodio/fix-checking-for-impl-while-flatt…
Browse files Browse the repository at this point in the history
…ening

When flattening, check that patch is leaf by presence of niix marker instead of attachment
  • Loading branch information
brusherru committed Dec 29, 2018
2 parents 721701c + 846064a commit 73ae280
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/xod-project/src/flatten.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const terminalOriginalDirectionLens = R.lensProp('originalDirection');
const isLeafPatchWithImplsOrTerminal = def(
'isLeafPatchWithImplsOrTerminal :: Patch -> Boolean',
R.anyPass([
Patch.hasImpl,
Patch.isPatchNotImplementedInXod,
Patch.isTerminalPatch,
R.pipe(Patch.getPatchPath, R.equals(CONST.NOT_IMPLEMENTED_IN_XOD_PATH)),
])
Expand Down Expand Up @@ -136,16 +136,16 @@ export const extractLeafPatches = def(
'extractLeafPatches :: Project -> PatchPath -> Patch -> [Either Error (Pair PatchPath Patch)]',
(project, path, patch) =>
R.cond([
[
R.either(isLeafPatchWithImplsOrTerminal, Patch.isAbstractPatch),
R.compose(R.of, Either.of, leafPatch => [path, leafPatch]),
],
[
isLeafPatchWithoutImpls,
R.compose(R.of, () =>
fail('IMPLEMENTATION_NOT_FOUND', { patchPath: path, trace: [path] })
),
],
[
R.either(isLeafPatchWithImplsOrTerminal, Patch.isAbstractPatch),
R.compose(R.of, Either.of, leafPatch => [path, leafPatch]),
],
[
R.T,
R.compose(
Expand Down Expand Up @@ -795,7 +795,7 @@ export const extractPatches = R.curry(
const convertPatch = def(
'convertPatch :: Project -> [Pair PatchPath Patch] -> Patch -> Patch',
(project, leafPatches, patch) =>
R.unless(Patch.hasImpl, originalPatch => {
R.unless(Patch.isPatchNotImplementedInXod, originalPatch => {
const leafPatchPaths = R.pluck(0, leafPatches);
const flattenEntities = extractPatches(
project,
Expand Down

0 comments on commit 73ae280

Please sign in to comment.