Giter Site home page Giter Site logo

Running Dart Sass in QuickJS? about dart-sass HOT 4 CLOSED

wch avatar wch commented on July 20, 2024
Running Dart Sass in QuickJS?

from dart-sass.

Comments (4)

wch avatar wch commented on July 20, 2024

One more thing I forgot to mention: this is a gist where I had put my attempt to run Dart Sass in QuickJS. If you just clone the gist and run the command in the README, it should reproduce the issue:
https://gist.github.com/wch/eb453b73981a7f5715903992accca35e

from dart-sass.

nex3 avatar nex3 commented on July 20, 2024

I'm sorry, I'm not sure what's going on here. It's possible that some of the environment sniffing Sass does to try to determine if it's running in a browser environment is returning inaccurate results here, but it's hard to know for sure without more information. If you can debug into the compiled JS code and figure out where it's stalling out, that would help in figuring out what's going on in more detail.

from dart-sass.

wch avatar wch commented on July 20, 2024

Thanks for the suggestion. I dug into it and found a bug in QuickJS! bellard/quickjs#275

The issue is that when a for loop has a label for the body, a break is supposed to exit the loop, but in QuickJS, it does not. For example, this is supposed to just print 1 and then break out of the loop, but with QuickJS, it prints 1, 2, 3, 4.

for (var i=0; i<4; i++)
label: {
  console.log(i);
  break;
}

This code pattern in question occurs in the sass.dart.js file in A.StylesheetParser0.almostAnyValue$1$omitComments(), and because of the bug in QuickJS, it gets stuck in an infinite loop.

from dart-sass.

nex3 avatar nex3 commented on July 20, 2024

Thanks for digging that up! I'm going to close this out since it's a bug in quickjs.

from dart-sass.

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.