Throw error when insertAt parameter is not 'top' or 'bottom'.

master
Nick Elsbree 2015-07-27 10:21:53 -07:00
parent 99d8fe064c
commit 02e4fb5181
1 changed files with 2 additions and 0 deletions

View File

@ -106,6 +106,8 @@ function createStyleElement(options) {
head.insertBefore(styleElement, head.firstChild);
} else if (options.insertAt === "bottom") {
head.appendChild(styleElement);
} else {
throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");
}
return styleElement;
}