(Also see the discussion page for this proposal)
For builtin classes/which prototype, catchalls, hashcodes, operators, and probably other places, we would like an intrinsic namespace that can be used to access a built-in or default function or operator, no matter the user-defined override. The intrinsic properties should in general be immutable ({DontDelete, ReadOnly}) for early binding. For example,
this.intrinsic::get(ident)
would always return the value of ident in the scoped this.
Or for a Complex number class, the + operator static method might look like this:
class Complex { . . . public static function +(a:*, b:*):* { if (b === null) { // Handle unary + here return a } if (a is Complex && b is Complex) { // Perform complex addition on a and b and return the result return result } return intrinsic::+(a, b) } }
This namespace constant should be the one globally polluting identifier added for ES4, if we can help it. We need to test that no or few web pages assign to intrinsic.
— Brendan Eich 2006/05/04 16:32
List of intrinsic names and their meanings:
+, -, ~use <number type> pragma; these always operate as if no pragma is in effect. See operators.+, -, *, /, %, <<, >>, >>>, &, |, ^, <, <=, >, >=, ==, !=, ===, !==use <number type> pragma; these always operate as if no pragma is in effect. See operators.get, set, callNull, Undefined, int, double, uint, decimal, Number, Date, RegExp, Boolean, String, Function, Array, Objecthashcodeglobalwrap— Lars T Hansen 2006/09/21 09:07