Files
less.js/test/less/plugin/plugin-set-options.js
Matthew Dean 29468bffcd Bugfix - namespace values (#3251)
* Added more CSS Grid tests
* Added media query example to tests
* Fixed bug where namespace values didn't work in guards and operations
* Fix failing setOptions test
* Update phantomJS, demo more permissive DR tests
* v3.5.0-beta.5
2018-07-01 19:43:24 -07:00

33 lines
690 B
JavaScript

var optionsStack = [
'option1',
undefined,
'option2',
undefined,
'option3'
];
var optionsWereSet = false;
var options, error;
registerPlugin({
install: function(less, pluginManager, functions) {
if (!optionsWereSet) {
error = 'setOptions() not called before install';
}
},
use: function() {
var pos = optionsStack.indexOf(options);
if (pos === -1) {
error = 'setOptions() not setting option "' + opt + '" correctly';
}
if (error) {
throw new Error(error);
}
},
setOptions: function(opts) {
optionsWereSet = true;
options = opts;
}
});