Advertisement
Guest User

Untitled

a guest
Oct 5th, 2018
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package
  2. {
  3.    use namespace AS3;
  4.    
  5.    [native(instance="int32_t",classgc="exact",methods="auto",cls="IntClass",construct="override")]
  6.    public final class int
  7.    {
  8.      
  9.       public static const MIN_VALUE:int = -2147483648;
  10.      
  11.       public static const MAX_VALUE:int = 2147483647;
  12.      
  13.       public static const length:int = 1;
  14.      
  15.       {
  16.          prototype.toLocaleString = prototype.toString = function toString(radix:* = 10):String
  17.          {
  18.             if(this === prototype)
  19.             {
  20.                return "0";
  21.             }
  22.             if(!(this is int))
  23.             {
  24.                Error.throwError(TypeError,1004,"int.prototype.toString");
  25.             }
  26.             return Number(this).toString(radix);
  27.          };
  28.          prototype.valueOf = function():*
  29.          {
  30.             if(this === prototype)
  31.             {
  32.                return 0;
  33.             }
  34.             if(!(this is int))
  35.             {
  36.                Error.throwError(TypeError,1004,"int.prototype.valueOf");
  37.             }
  38.             return this;
  39.          };
  40.          prototype.toExponential = function(p:* = 0):String
  41.          {
  42.             return Number(this).toExponential(p);
  43.          };
  44.          prototype.toPrecision = function(p:* = 0):String
  45.          {
  46.             return Number(this).toPrecision(p);
  47.          };
  48.          prototype.toFixed = function(p:* = 0):String
  49.          {
  50.             return Number(this).toFixed(p);
  51.          };
  52.          _dontEnumPrototype(prototype);
  53.       }
  54.      
  55.       public function int(value:* = 0)
  56.       {
  57.          super();
  58.       }
  59.      
  60.       AS3 function toString(radix:* = 10) : String
  61.       {
  62.          return Number(this).toString(radix);
  63.       }
  64.      
  65.       AS3 function valueOf() : int
  66.       {
  67.          return this;
  68.       }
  69.      
  70.       AS3 function toExponential(p:* = 0) : String
  71.       {
  72.          return Number(this).toExponential(p);
  73.       }
  74.      
  75.       AS3 function toPrecision(p:* = 0) : String
  76.       {
  77.          return Number(this).toPrecision(p);
  78.       }
  79.      
  80.       AS3 function toFixed(p:* = 0) : String
  81.       {
  82.          return Number(this).toFixed(p);
  83.       }
  84.    }
  85. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement