Webpack build for branch custom-structures: 522854af7660104250ac940049337444b4e23bba

This commit is contained in:
Travis CI 2017-11-20 03:47:29 +00:00
parent 4b5973210f
commit 0156cda8e1
2 changed files with 4 additions and 4 deletions

View file

@ -9629,16 +9629,16 @@ class Structures {
extend(name, extender) { extend(name, extender) {
if (!structures[name]) throw new RangeError(`"${name}" is not a valid extensible structure.`); if (!structures[name]) throw new RangeError(`"${name}" is not a valid extensible structure.`);
if (typeof extender !== 'function') { if (typeof extender !== 'function') {
throw new TypeError('The extender must be a function that returns the extended class.'); throw new TypeError('The extender must be a function that returns the extended structure class/prototype.');
} }
const custom = extender(structures[name]); const custom = extender(structures[name]);
if (typeof custom !== 'function') { if (typeof custom !== 'function') {
throw new TypeError('The extender function should return the extended class/prototype.'); throw new TypeError('The extender function must return the extended structure class/prototype.');
} }
if (Object.getPrototypeOf(custom) !== structures[name]) { if (Object.getPrototypeOf(custom) !== structures[name]) {
throw new Error( throw new Error(
'The class/prototype returned from the extender function must extend the existing structure class/prototype.' "The class/prototype returned from the extender function doesn't extend the existing structure class/prototype."
); );
} }

File diff suppressed because one or more lines are too long