Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 857 lines (825 sloc) 17.625 kb

IronJS

IronJS is a ECMAScript 3.0 implementation built on top of the Dynamic Language Runtime from Microsoft which allows you to embed a javascript runtime into yor .NET applications. The current state of the code is at best alpha quality. Use at your own risk.

License

IronJS is released under the GNU General Public License v3.

Requirements

What you need to use IronJS

  • An understanding that this is alpha quality software, it will crash on you.
  • .NET 4.0 Beta 2, it should compile on .NET 3.5 with some minor modifications.
  • The Dynamic Language Runtime from Microsoft.

ECMAScript 3.0 Compliance

Types

Section 8 of the ECMA Script 3.0 specification

Section Name Status Note
8.1 Undefined Done Singleton instance in property IronJS.Runtime.Js.Undefined.Instance
8.2 Null Done Uses built in null in .NET
8.3 Boolean Done Uses built in boolean in .NET
8.4 String Done Uses built in string in .NET
8.5 Number Done Uses built in double in .NET
8.6 Object Done Interface in IronJS.Runtime.Js.IObj, base impl. in IronJS.Runtime.Js.Obj

Type Conversions

Section 9 of the ECMA 3.0 specification

Section Name Status Note
9.1 ToPrimitive Done
9.2 ToBoolean Done
9.3 ToNumber Done Uses the Convert.ToDouble from the BCL for strings
9.4 ToInteger Done Uses the Convert.ToInt32 from the BCL for strings
9.5 ToInt32 Done Uses the Convert.ToInt32 from the BCL for strings
9.6 ToUInt32 Done Uses the Convert.ToUInt32 from the BCL for strings
9.7 ToUint16 Done Uses the Convert.ToUint16 from the BCL for strings
9.8 ToString Done
9.10 ToObject Done

Expressions

Section 11 of the ECMA 3.0 specification.

Section Name Status Note
11.1.1 this keyword Done this
11.1.2 Identifier reference Done x
11.1.3 Literal reference Done 'x'
11.1.4 Array initialiser Done [ ]
11.1.5 Object initializer Done { }
11.1.6 Grouping operator Done ( )
11.2.1 Property accessors Done x.y
11.2.2 New operator Done new x()
11.2.3 Function calls Done x()
11.2.4 Arguments list Done x(1, 2, 3)
11.2.5 Function expression Done function() { }
11.3.1 Postfix increment operator Done x++
11.3.2 Postfix decrement operator Done x--
11.4.1 delete operator 90% delete x (returns null instead of true/false)
11.4.2 void operator Done void x
11.4.3 typeof operator Done typeof x
11.4.4 Prefix increment operator Done ++x
11.4.5 Prefix decrement operator Done --x
11.4.6 Unary + operator Done +x
11.4.7 Unary - operator Done -x
11.4.8 Bitwise NOT operator Done ~x
11.4.9 Logical NOT operator Done !x
11.5.1 * operator Done x*y
11.5.2 / operator Done x/y
11.5.3 % operator Done x%y
11.6.1 + operator Done x+y
11.6.2 - operator Done x-y
11.7.1 << operator Done x<<y
11.7.2 >> operator Done x>>y
11.7.3 >>> operator Done x>>>y
11.8.1 < operator Done x<y
11.8.2 > operator Done x>y
11.8.3 <= operator Done x<=y
11.8.4 >= operator Done x>=y
11.8.6 instanceof operator Done x instanceof y
11.8.7 in operator Done 'x' in y
11.9.1 == operator Done x == y
11.9.2 != operator Done x != y
11.9.4 === operator Done x === y
11.9.5 !== operator Done x !== y
11.10 Binary bitwise operators Done x&y x|y x^y
11.11 Logical bitwise operators Done x&&y x||y
11.12 Conditional operator Done x?y:z
11.13.1 Simple assignment Done x=y
11.13.2 Compound assignment Done x@=y
11.14 Comma operator Done x,y

Statements

Section 12 of the ECMA 3.0 specification.

Section Name Status Note
12.1 Block Done
12.2 Variable Done
12.3 Empty Done
12.4 Expression Done
12.5 if Done
12.6.1 do-while Done
12.6.2 while Done
12.6.3 for Done
12.6.4 for-in Done
12.7 continue Done
12.8 break 90% Labelled break only works for a few statements
12.9 return Done
12.10 with Done
12.11 switch Done
12.12 Labelled 90% Only a few statements are labelable
12.13 throw Done
12.14 try Done

Native ECMAScript Objects

Section 15 of the ECMA 3.0 specification

This list is not complete at the moment

15.1 The Global object

Section Name Status Note
15.1.1.1 NaN Done Uses value from double.NaN
15.1.1.2 Infinity Done Uses value from double.PositiveInfinity
15.1.1.3 undefined Done Has IronJS.Runtime.Js.Undefined.Instance as value
15.1.2.1 eval 0% eval(x)
15.1.2.2 parseInt Done parseInt(string, radix)
15.1.2.3 parseFloat Done parseFloat(string)
15.1.2.4 isNaN Done isNaN(number)
15.1.2.5 isFinite Done isFinite(number)
15.1.3.1 decodeURI Done decodeURI(encodedURI)
15.1.3.2 decodeURIComponent Done decodeURIComponent(encodedURI)
15.1.3.3 encodeURI Done encodeURI(uri)
15.1.3.4 encodeURIComponent Done encodeURIComponent(uriComponent)

15.2 The Object objects

Section Name Status Note
15.2.1.1 Object function Done Object([value])
15.2.2.1 Object constructor Done new Object([value])
15.2.3.1 Object.prototype Done This is the Object prototype object
15.2.4.2 Object.prototype.toString Done toString()
15.2.4.3 Object.prototype.toLocaleString Done toLocaleString()
15.2.4.4 Object.prototype.valueOf Done valueOf()
15.2.4.5 Object.prototype.hasOwnProperty Done isOwnProperty(V)
15.2.4.6 Object.prototype.isPrototypeOf Done isPrototypeOf(V)
15.2.4.2 Object.prototype.propertyIsEnumerable 0% propertyIsEnumerable(V), Related to issue #7

15.3 The Function objects

Section Name Status Note
15.3.1.1 Function function 0%
15.3.2.1 Function constructor 0%
15.3.3.1 Function.prototype Done The function prototype object
15.3.4.2 Function.toString 25% Returns a string but not the correct one
15.3.4.3 Function.apply 0% Waiting to be implemented
15.3.4.4 Function.call Done x.call(thisArg [ , arg1 [ , arg2, ... ] ])

15.x Overview of other Native objects

Section Name Status Note
15.4 Array constructor Done
15.4.4 Array prototype 90% splice() and unshift() are not implemented
15.5 String constructor 95% fromCharCode() not implemented
15.5.4 String prototype 90% replace() function not implemented
15.6 Boolean constructor Done
15.6.4 Boolean prototype Done
15.7 Number constructor Done
15.7.4 Number prototype Done
15.8 Math object Done
15.9 Date constructor 0%
15.9.5 Date prototype 0%
15.10 RegExp constructor Done
15.10.5 RegExp prototype Done
15.11 Error Objects 0%
Something went wrong with that request. Please try again.