diff --git a/README.md b/README.md index 6cf1961..de42b75 100755 --- a/README.md +++ b/README.md @@ -1,15 +1,15 @@ # object.js object.js provides a set of tools for constructing and maintaining object -constrictors and for managing their inheritance relations. +constructors and for managing their inheritance relations. -This is an elternative to the ES6 `class` syntax in JavaScript and provides +This is an alternative to the ES6 `class` syntax in JavaScript and provides several advantages: - simple way to define normal and class methods, properties and attributes, - uniform and minimalistic definition syntax based on basic JavaScript object syntax no special cases or special syntax, -- _transparantly_ based on _JavaScript's_ prototypical inheritance model, +- _transparently_ based on _JavaScript's_ prototypical inheritance model, - more granular instance construction (a-la _Python's_ `.__new__(..)` and `.__init__(..)` methods) - less restrictive: @@ -17,7 +17,7 @@ several advantages: - all input components are reusable Disadvantages compared to the `class` syntax: -- no _sytactic sugar_ +- no _syntactic sugar_ - a slightly more complicated `super` call method @@ -196,4 +196,4 @@ Constructor(, , ) Copyright (c) 2019, Alex A. Naanou, All rights reserved. - \ No newline at end of file + diff --git a/object.js b/object.js index 0c0f5e7..94ad4c3 100755 --- a/object.js +++ b/object.js @@ -2,13 +2,11 @@ * * * +* XXX should this extend Object??? +* **********************************************************************/ ((typeof define)[0]=='u'?function(f){module.exports=f(require)}:define)( function(require){ var module={} // makes module AMD/node compatible... -/*********************************************************************/ - - - /*********************************************************************/ // Helpers... @@ -25,6 +23,8 @@ module.TAB_SIZE = 4 // for printing function code of functions that were defined at deep levels // of indent. // +// NOTE: this will trim out both leading and trailing whitespace. +// // XXX is this the right place for this??? // ...when moving take care that ImageGrid's core.doc uses this... var normalizeIndent = @@ -310,6 +310,7 @@ function Constructor(name, a, b){ // default object base... : {} + // XXX should this be done when .__new__(..) is called??? obj.__proto__ = _constructor.prototype Object.defineProperty(obj, 'constructor', { value: _constructor,