Giter Site home page Giter Site logo

Comments (2)

ericyhwang avatar ericyhwang commented on June 1, 2024 2

Based on the fact that {{each _page.greetingIds}} does work, I've debugged it down to a difference between PathExpression#dependencies (works fine) and AttributePathExpression#dependencies (doesn't work).

In the screenshot, the left side is the working PathExpression, and the right side is the not-working AttributePathExpression.

Screen Shot 2020-04-29 at 3 32 29 PM

Specifically, PathExpression's call to appendDependency results in a correct dep list, but AttributePathExpression's call to swapLastDependency does not.


As for a fix - Just to see what happens, since I suspected the early-return to be an issue, I tried changing the initial early-return check in swapLastDependency:

https://github.com/derbyjs/derby-templates/blob/6cf8f1ba344c9aec59e577945efe4d17416fcd10/lib/expressions.js#L748

Like so:

  function swapLastDependency(dependencies, expression, context) {
-   if (!expression.segments.length) {
+   if (!expression.segments.length && !expression.meta) {
      return dependencies;
    }

That did fix the issue, and all the other tests pass... but I have no idea what the intent behind swapLastDependency is, nor do I know what that early-return is intended to do. My "see what happens" change is almost certainly not the correct fix.

@nateps can you provide some context / advise?

from derby.

JerryI avatar JerryI commented on June 1, 2024

It was an old bug which made me kill myself at the previous job. Thank you a ton, @ericyhwang!

from derby.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.