fix: error when class inherits from null instead of defaulting to Object

Previously, inheriting from null would silently fall back to Object superclass. Now validates superclass and raises runtime error if null is provided. Refactored defineClass to remove implicit null-to-Object fallback, added loadCoreVariable helper for module-level core imports, and updated CLASS/FOREIGN_CLASS opcode comments to reflect that null is no longer a valid superclass. Added test case for inherit_from_null.
This commit is contained in:
Bob Nystrom
2015-09-12 17:14:04 +00:00
parent 9b002c6d67
commit eba4911485
4 changed files with 32 additions and 39 deletions
@@ -0,0 +1 @@
class Foo is null {} // expect runtime error: Class 'Foo' cannot inherit from a non-class object.