opal/corelib/runtime.js in opal-1.7.2 vs opal/corelib/runtime.js in opal-1.7.3

- old
+ new

@@ -822,9 +822,12 @@ // the object at `$$meta` for future use, and then returned. // // @param object [Object] the ruby object // @return [Class] the singleton class for object Opal.get_singleton_class = function(object) { + if (object.$$is_number) { + $raise(Opal.TypeError, "can't define singleton"); + } if (object.$$meta) { return object.$$meta; } if (object.hasOwnProperty('$$is_class')) {