From 5a306785ba83a0f41664a4b401d71e9331ee8b34 Mon Sep 17 00:00:00 2001 From: Stan Angeloff Date: Sun, 23 May 2010 12:44:40 +0300 Subject: [PATCH] Tests to ensure reserver words and operators can be used as object keys --- test/test_compilation.coffee | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/test_compilation.coffee b/test/test_compilation.coffee index 7163c638..e4569592 100644 --- a/test/test_compilation.coffee +++ b/test/test_compilation.coffee @@ -7,6 +7,16 @@ js: CoffeeScript.compile("one\r\ntwo", {no_wrap: on}) ok js is "one;\ntwo;" +# Reserved words can be used as object properties + +obj: { + is: -> 1 + of: 'many' +} + +ok obj.is() is 1 +ok obj.of is 'many' + # Try out language extensions to CoffeeScript. # Create the Node were going to add -- a literal syntax for splitting