Skip to content

Commit 54b7b00

Browse files
committed
Package: Check for both jqueryUi and jQueryUiVersion for ThemeRoller
When constructing the ThemeRoller in the `jquery-ui.theme.css` generation from the `lib/package.js` file, there are a number of options: 1. We have the `jQueryUiVersion` property available in `this.runtime`. 2. We have the `jqueryUi` property available in `this.runtime`. The second happens in the jQuery UI release script. The first had to be introduced as if one calls the `files` method of `jqueryUi`, an instance of `JqueryUiFiles` is cached under `jqueryUi._files`, creating a circular reference, since `JqueryUiFiles` objects keep a reference to the `JqueryUi` ones that created them. Such a circular reference causes a crash since `node-packager` tries to stringify `jqueryUi`.
1 parent c700bd1 commit 54b7b00

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

lib/package.js

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -285,10 +285,21 @@ extend( Package.prototype, {
285285

286286
this.themeCssFileNames.push( "theme.css" );
287287

288-
this.themeroller = new ThemeRoller( {
289-
vars: this.runtime.themeVars,
290-
version: this.runtime.jQueryUiVersion
291-
} );
288+
if ( this.runtime.jqueryUi ) {
289+
this.themeroller = new ThemeRoller( {
290+
vars: this.runtime.themeVars,
291+
jqueryUi: this.runtime.jqueryUi
292+
} );
293+
} else if ( this.runtime.jQueryUiVersion ) {
294+
this.themeroller = new ThemeRoller( {
295+
vars: this.runtime.themeVars,
296+
version: this.runtime.jQueryUiVersion
297+
} );
298+
} else {
299+
this.themeroller = new ThemeRoller( {
300+
vars: this.runtime.themeVars
301+
} );
302+
}
292303
this.customThemeUrl = this.themeroller.url();
293304
css = this.themeroller.css();
294305

0 commit comments

Comments
 (0)