Giter Site home page Giter Site logo

Comments (4)

lionel-bijaoui avatar lionel-bijaoui commented on May 27, 2024 1

Thank you for your time and your help.

This is not a big problem, but tell me if I can help to fix it 😄

from jsx-ast-utils.

ljharb avatar ljharb commented on May 27, 2024

Thanks! Could you provide the code that's causing the crash?

from jsx-ast-utils.

lionel-bijaoui avatar lionel-bijaoui commented on May 27, 2024

It was fairly hard to get the origin.

Here is the AST fragment

 <ref *2> {
  type: 'PrivateIdentifier',
  name: 'route',
  range: [ 5391, 5420 ],
  loc: { start: { line: 159, column: 39 }, end: { line: 159, column: 68 } },
  parent: <ref *1> {
    type: 'MemberExpression',
    object: {
      type: 'ThisExpression',
      range: [Array],
      loc: [Object],
      parent: [Circular *1]
    },
    property: [Circular *2],
    computed: false,
    optional: false,
    range: [ 5386, 5420 ],
    loc: { start: [Object], end: [Object] },
    parent: {
      type: 'BinaryExpression',
      operator: '+',
      left: [Circular *1],
      right: [Object],
      range: [Array],
      loc: [Object],
      parent: [Object]
    }
  }
}

And the code is using a private member of a class. Here is an extract of the class

export class example {
	#route = null;

	template(args) {
		this.#route = args.route || null;
		if (this.#route != null) {
			this.#route += "/";
		}
		return ``;
	}

	onRender() {
		let footer = "";

		footer = (
			<footer class="text-center padding-10">
				<a class="button" fk-href={this.#route + "container-preparation/list/upcoming"}>
					<svg>
						<use xlink:href="#eye" />
					</svg>{" "}
					See more
				</a>
			</footer>
		);

		return footer;
	}
}

from jsx-ast-utils.

ljharb avatar ljharb commented on May 27, 2024

Looks like this has the same testing problem as #112.

We'll have to upgrade the test suite to be able to parse private fields before fixing this.

A workaround in the meantime would be making the href value in a variable, and only putting the variable name inside the prop.

from jsx-ast-utils.

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.