Skip to content

Commit f764e2d

Browse files
authored
Handle _setInProgress in a try-catch-finally
1 parent 4d9266c commit f764e2d

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

lib/CSSStyleDeclaration.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,8 @@ class CSSStyleDeclaration {
174174
if (this._parentRule || (this._ownerNode && this._setInProgress)) {
175175
return;
176176
}
177-
this._setInProgress = true;
178177
try {
178+
this._setInProgress = true;
179179
const valueObj = parseCSS(
180180
val,
181181
{
@@ -246,8 +246,9 @@ class CSSStyleDeclaration {
246246
}
247247
} catch {
248248
return;
249+
} finally {
250+
this._setInProgress = false;
249251
}
250-
this._setInProgress = false;
251252
if (typeof this._onChange === "function") {
252253
this._onChange(this.cssText);
253254
}

0 commit comments

Comments
 (0)