浏览代码

Fixes #1026.

Does  not report for subclasses of nil created purposely, as they use
JS null to denote superclass.

The warning appears only for undefined (fixes loading .js)
and/or nil (fixes importing with missing global).
Herbert Vojčík 10 年之前
父节点
当前提交
b35857c421
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      support/boot.js

+ 1 - 1
support/boot.js

@@ -448,7 +448,7 @@ define("amber/boot", [ 'require', './browser-compatibility' ], function (require
 		st.addClass = function(className, superclass, iVarNames, pkgName) {
 			// While subclassing nil is allowed, it might be an error, so
 			// warn about it.
-			if (!superclass || superclass == nil) {
+			if (typeof superclass == 'undefined' || superclass == nil) {
 				console.warn('Compiling ' + className + ' as a subclass of `nil`. A dependency might be missing.');
 			}
 			rawAddClass(pkgName, className, superclass, iVarNames, false, null);