mirror of
https://github.com/less/less.js.git
synced 2026-01-13 09:18:03 -05:00
* Move test data to separate module - @todo--fix some browser tests * Fix all browser tests
33 lines
690 B
JavaScript
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;
|
|
}
|
|
});
|