From fba69f5651463abc3015827f9acae7afa0e203ea Mon Sep 17 00:00:00 2001 From: Gerald Lewis Date: Mon, 14 Nov 2011 11:37:16 -0500 Subject: [PATCH] tests for 1840 --- test/function_invocation.coffee | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/function_invocation.coffee b/test/function_invocation.coffee index d0e6e85c..75f85904 100644 --- a/test/function_invocation.coffee +++ b/test/function_invocation.coffee @@ -506,3 +506,15 @@ test "#1416: don't omit one 'new' when compiling 'new new fn()()'", -> eq obj.prop, nonce eq obj.a, argNonceA eq obj.b, argNonceB + +test "#1840: accessing the `prototype` after function invocation should compile", -> + doesNotThrow -> CoffeeScript.compile 'fn()::prop' + + nonce = {} + class Test then id: nonce + + dotAccess = -> Test:: + protoAccess = -> Test + + eq dotAccess().id, nonce + eq protoAccess()::id, nonce