Skip to content

Commit 83d62bb

Browse files
Fix assignment
1 parent 0db8ae3 commit 83d62bb

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

packages/ember-css-modules/lib/htmlbars-plugin/utils.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function updateStringValue(node, updater) {
2121
node.chars = updater(node.chars);
2222
} else if (node.type === 'StringLiteral') {
2323
node.value = updater(node.value);
24-
getValue(node) = updater(getValue(node));
24+
setValue(node, updater(getValue(node)));
2525
} else {
2626
throw new Error('Unknown node type ' + node.type + ' (not a string?)');
2727
}
@@ -90,6 +90,20 @@ function getValue(path) {
9090
return path.original;
9191
}
9292

93+
function setValue(node, value) {
94+
if (!node) return;
95+
96+
if ('value' in node) {
97+
node.value = value;
98+
} else {
99+
/**
100+
* Deprecated in ember 5.9+
101+
* (so we use the above for newer embers)
102+
*/
103+
path.original = value;
104+
}
105+
}
106+
93107
module.exports = {
94108
pushAll: pushAll,
95109
getPair: getPair,

yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5873,7 +5873,7 @@ ember-compatibility-helpers@^1.1.2, ember-compatibility-helpers@^1.2.0, ember-co
58735873
semver "^5.4.1"
58745874

58755875
"ember-css-modules@link:packages/ember-css-modules":
5876-
version "2.0.1"
5876+
version "2.1.1"
58775877
dependencies:
58785878
broccoli-bridge "^1.0.0"
58795879
broccoli-concat "^4.2.5"

0 commit comments

Comments
 (0)