Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Nested map regression #3383

Open
jgranstrom opened this issue Oct 25, 2023 · 0 comments
Open

Nested map regression #3383

jgranstrom opened this issue Oct 25, 2023 · 0 comments

Comments

@jgranstrom
Copy link

jgranstrom commented Oct 25, 2023

  • NPM version (npm -v): 9.5.1
  • Node version (node -v): v19.8.1
  • Node Process (node -p process.versions):
{
  node: '19.8.1',
  acorn: '8.8.2',
  ada: '1.0.4',
  ares: '1.19.0',
  brotli: '1.0.9',
  cldr: '42.0',
  icu: '72.1',
  llhttp: '8.1.0',
  modules: '111',
  napi: '8',
  nghttp2: '1.52.0',
  nghttp3: '0.7.0',
  ngtcp2: '0.8.1',
  openssl: '3.0.8+quic',
  simdutf: '3.2.2',
  tz: '2022g',
  undici: '5.21.0',
  unicode: '15.0',
  uv: '1.44.2',
  uvwasi: '0.0.16',
  v8: '10.8.168.25-node.12',
  zlib: '1.2.13'
}
  • Node Platform (node -p process.platform): darwin
  • Node architecture (node -p process.arch): arm64
  • node-sass version (node -p "require('node-sass').info"):
node-sass	9.0.0	(Wrapper)	[JavaScript]
libsass  	3.5.5	(Sass Compiler)	[C/C++] Please find below information about the packages and assist us.

Nested maps have regressed at some point since version ~4, the following test case used to pass, but does not compile properly anymore: https://github.com/jgranstrom/sass-extract/blob/21072b642eca5ef1fff9f1e365c5f65189e63931/test/map-keys.js#L75-L79.

The sass being compiled is

$map: (
  string: 1em,
  1px: 'number',
  white: 'color-string',
  #123456: 'color-hex',
  rgba(0, 1, 2, 0.5): 'color-rgba',
  rgb(0, 0, 0): 'color-black-rgba',
  true: 'boolean',
  null: 'null',
  (1, 2, 3): 'list',
  (1 2 3 4): 'list-spaces',
  (a: 'map'): 'map',
  ((b: 'nested'), (c: 'maps')): 'list-maps',
  (d: 'map'): (
    nested: (
      (1, 2, 3): 'list', // `node-sass` throws Error for the nested `(1, 2, 3)` key. The problem should be with node-sass itself, as it works OK with `sass`.
      (1 2 3 4): 'list-spaces'
    )
  ),
  darken(white, 1%): 'darkened-white',
  $keyvar: 'key-variable',
);

The nested key (d: 'map') does not compile with the expected output anymore.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant