jashkenas/coffee-script — Issue #1840: Referencing the prototype of a function call results in a TypeError
Author: hornairs
Created: 2011-11-09 04:04:08+00:00
State: open

Directly referencing the prototype (via `::`) of the return value of a function no longer compiles.

```bash
hornairs@winslow:~/Code/batman (master *)$ node -v
v0.4.12
hornairs@winslow:~/Code/batman (master *)$ coffee -v
CoffeeScript version 1.1.3
hornairs@winslow:~/Code/batman (master *)$ coffee -bpe "func()::foo"
TypeError: Object
Access "prototype",
Access "foo" has no method 'compile'
at Value.compileNode (/Users/hornairs/Code/nvm/v0.4.12/lib/node_modules/coffee-script/lib/coffee-script/nodes.js:556:22)
at Value.compile (/Users/hornairs/Code/nvm/v0.4.12/lib/node_modules/coffee-script/lib/coffee-script/nodes.js:41:21)
at Block.compileNode (/Users/hornairs/Code/nvm/v0.4.12/lib/node_modules/coffee-script/lib/coffee-script/nodes.js:282:23)
at Block.compileWithDeclarations (/Users/hornairs/Code/nvm/v0.4.12/lib/node_modules/coffee-script/lib/coffee-script/nodes.js:331:19)
at Block.compileRoot (/Users/hornairs/Code/nvm/v0.4.12/lib/node_modules/coffee-script/lib/coffee-script/nodes.js:309:19)
at Block.compile (/Users/hornairs/Code/nvm/v0.4.12/lib/node_modules/coffee-script/lib/coffee-script/nodes.js:264:21)
at Object.compile (/Users/hornairs/Code/nvm/v0.4.12/lib/node_modules/coffee-script/lib/coffee-script/coffee-script.js:38:51)
at /Users/hornairs/Code/nvm/v0.4.12/lib/node_modules/coffee-script/lib/coffee-script/command.js:149:33
at Object.run (/Users/hornairs/Code/nvm/v0.4.12/lib/node_modules/coffee-script/lib/coffee-script/command.js:48:27)
at Object. (/Users/hornairs/Code/nvm/v0.4.12/lib/node_modules/coffee-script/bin/coffee:7:41)
hornairs@winslow:~/Code/batman (master *)$ ./node_modules/.bin/coffee -v
CoffeeScript version 1.1.2
hornairs@winslow:~/Code/batman (master *)$ ./node_modules/.bin/coffee -bpe "func()::foo"
func().prototype.foo;
```