Cleanup/Generalize ES5 Internal Nominal Object Typing

See Nominal Object Typing in ES5 Specification

Specific things to do to cleanup/generalize spec. level use of nominal typing

  1. Parameterized Objct.prototype.toString via actual object properties.
  2. Cleanup [[Class]] tests in JSON.stringify. Perhaps revert to more toJSON usage
  3. Funtion.prototype.bind should simply look for the “length” property rather than first doing a [[Class]]==”Function” test
  4. Array.isArray should test for presence of special [[DefineOwnProperty]] rather than testing [[Class]
  5. Array.prototype.concat shouldn’t test its arguments for [[Class]]==”Array” to determine whether or not to “exploded” the argument into its individual elements. Instead it should test a newly specified user settable property of the array to control the “explode” behavior. There are backwards compatibility issues that will need to be considered.
  6. In JSON.parse eliminate [[Class]]==”Array” test in Walk. Replace it with more abstract language that relates back to the JSON grammar.
  7. In JSON.stringify, make accept generic arrays (hence any object) as replacer value. This only needs isCallable test can eliminate [[Class]] test.
  8. In JSON.stringify, use a isJSONArray property to control output in array literal syntax and eliminate corresponding [[Class]] check.no
  9. Make String.prototype.match use RegExp constructor instead of [[Class]] test. Also call object’s exec method instead of directly using built-in exec. Add necessary coercions to expected value types.
  10. Do the same thing as item 9 for String prototype replace, search, and slice.
  11. More items to come...
 
strawman/es5_internal_nominal_typing.txt · Last modified: 2012/06/19 22:32 by allen
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki