added the typeof operater as an OpNode

This commit is contained in:
Jeremy Ashkenas
2009-12-24 11:50:44 -08:00
parent 5d1ec9d2a9
commit 7f502543d2
5 changed files with 12 additions and 10 deletions

View File

@@ -1,10 +1,10 @@
a: 5
atype: typeof(a)
atype: typeof a
b: "hello"
btype: typeof(b)
btype: typeof b
Klass: => .
k: new Klass()
print(atype is 'number' and btype is 'string' and k instanceof(Klass))
print(atype is 'number' and btype is 'string' and k instanceof Klass)

View File

@@ -1,8 +1,8 @@
(function(){
var a = 5;
var atype = typeof(a);
var atype = typeof a;
var b = "hello";
var btype = typeof(b);
var btype = typeof b;
var Klass = function() {
};
var k = new Klass();