function SetUpLockedPrototype(
    constructor, fields, methods) {
  %CheckIsBootstrapping();
  var prototype = constructor.prototype;
  // Install functions first, because this function is used to initialize
  // PropertyDescriptor itself.
  var property_count = (methods.length >> 1) + (fields ? fields.length : 0);
  if (property_count >= 4) {
    %OptimizeObjectForAddingMultipleProperties(prototype, property_count);
  }
  if (fields) {
    for (var i = 0; i < fields.length; i++) {
      %AddNamedProperty(prototype, fields[i],
                        UNDEFINED, DONT_ENUM | DONT_DELETE);
    }
  }
  for (var i = 0; i < methods.length; i += 2) {
    var key = methods[i];
    var f = methods[i + 1];
    %AddNamedProperty(prototype, key, f, DONT_ENUM | DONT_DELETE | READ_ONLY);
    %SetNativeFlag(f);
  }
  %InternalSetPrototype(prototype, null);
  %ToFastProperties(prototype);
}
function SetUpLockedPrototype(
    constructor, fields, methods) {
  %CheckIsBootstrapping();
  var prototype = constructor.prototype;
  
  
  var property_count = (methods.length >> 1) + (fields ? fields.length : 0);
  if (property_count >= 4) {
    %OptimizeObjectForAddingMultipleProperties(prototype, property_count);
  }
  if (fields) {
    for (var i = 0; i < fields.length; i++) {
      %AddNamedProperty(prototype, fields[i],
                        UNDEFINED, DONT_ENUM | DONT_DELETE);
    }
  }
  for (var i = 0; i < methods.length; i += 2) {
    var key = methods[i];
    var f = methods[i + 1];
    %AddNamedProperty(prototype, key, f, DONT_ENUM | DONT_DELETE | READ_ONLY);
    %SetNativeFlag(f);
  }
  %InternalSetPrototype(prototype, null);
  %ToFastProperties(prototype);
}
function SetUpLockedPrototype ( constructor , fields , methods ) { % CheckIsBootstrapping ( ) ; var prototype = constructor . prototype ; // Install functions first, because this function is used to initialize // PropertyDescriptor itself. var property_count = ( methods . length >> 1 ) + ( fields ? fields . length : 0 ) ; if ( property_count >= 4 ) { % OptimizeObjectForAddingMultipleProperties ( prototype , property_count ) ; } if ( fields ) { for ( var i = 0 ; i < fields . length ; i ++ ) { % AddNamedProperty ( prototype , fields [ i ] , UNDEFINED , DONT_ENUM | DONT_DELETE ) ; } } for ( var i = 0 ; i < methods . length ; i += 2 ) { var key = methods [ i ] ; var f = methods [ i + 1 ] ; % AddNamedProperty ( prototype , key , f , DONT_ENUM | DONT_DELETE | READ_ONLY ) ; % SetNativeFlag ( f ) ; } % InternalSetPrototype ( prototype , null ) ; % ToFastProperties ( prototype ) ; }
Prevents changes to the prototype of a built-in function. The "prototype" property of the function object is made non-configurable, and the prototype object is made non-extensible. The latter prevents changing the __proto__ property.
Prevents changes to the prototype of a built - in function . The prototype property of the function object is made non - configurable and the prototype object is made non - extensible . The latter prevents changing the __proto__ property .