- Встроенная система классов навязывает использование new при создании экземпляров объектов.
- Оператор return не создает блока, поэтому нельзя написать
a = (b) -> return b + 1 - Отсутствие syntax shugar для yield. Хотя возможно что с приходом await/async yield отомрёт
- Comprehensions для функций (не для выражений). Вот это:
obj = prop: console.log "wtf!" if a then 1 else 2хорошо, а вот это:
fn = (a) -> for b in a b.increment()возвращающее массив - очень хуёво. Были проблемы из-за этого.
- Сука пиздец ёбаный ну это что вообще блядь сука пиздец, а
a = ["abc","ebc","undefined","defg"] a = a.filter (el) -> el.indexOf "undefined" is -1 console.dir a # ["abc","ebc","undefined","defg"]
работает как
a.filter (el) -> el.indexOf("undefined" is -1)Пиздец.
-
coffee> a = /Письменные консультации/ /Письменные консультации/ coffee> a = ///Письменные консультации/// /Письменныеконсультации/
Что? Блядь, ЧТО? ЧТО БЛЯДЬ!!!!!!!!!!!!!!!
Всё я дропаю это говно нахуй. Сударь, вы безумны. Вы безумны, сударь, блядь. Беды с башкой.
https://github.com/jashkenas/coffeescript/issues/1199 -
Твою мать блядь сука ёбаный ты в рот:
for collection_id \ in collections_list console.log 123
17:5: error: unexpected in
in collections_list
^^
N"OWw RIWWITNHK AAAAAARR DER PROTOROPYTEP PORPERTY>111..
Unfolded:
events = require "events"
instances_counter = 0
module.exports = (
->
__class = (->
__args = Array.prototype.slice.call(arguments)
if @ instanceof __class
@constructor?.apply(@,__args) if __class isnt @constructor;@
else
new (Function.prototype.bind.apply(__class,[null].concat(__args)))
);
__class.prototype = if @prototype? then Object.create(@prototype.prototype) else @;
__class.prototype[__prop] = @[__prop] for __prop of @ if @prototype?;
__class).apply
prototype: events.EventEmitter
constructor: (@param1,@param2) ->
@prototype.apply @
@id = ++instances_counter
render: ->
console.log @,instances_counter,@ instanceof module.exports
a = new module.exports()
a.render()
b = new module.exports()
b.render()
console.log a instanceof events.EventEmitter
console.log a instanceof module.exports
Folded:
events = require "events"
instances_counter = 0
module.exports = (-> __class = (-> __args = Array.prototype.slice.call(arguments); if @ instanceof __class then @constructor?.apply(@,__args) if __class isnt @constructor;@ else new (Function.prototype.bind.apply(__class,[null].concat(__args)))); __class.prototype = (if @prototype? then Object.create(@prototype.prototype) else @); (__class.prototype[__prop] = @[__prop] for __prop of @ if @prototype?); __class).apply
prototype: events.EventEmitter
constructor: (@param1,@param2) ->
@prototype.apply @
@id = ++instances_counter
render: ->
console.log @,instances_counter,@ instanceof module.exports
a = new module.exports()
a.render()
b = new module.exports()
b.render()
console.log a instanceof events.EventEmitter
console.log a instanceof module.exports
Кавычечки. Кавычечки. Вместо одинарных случайно поставил двойные, автозаменой. Кавычечки он не любит. Пиздец.
Было:
#!/bin/bash
###
NODE_VERSION=">=0.11.13"
if [ -z $(which node) ]; then echo "ERROR: NODE.JS NOT FOUND"; exit 1; fi
if [ -z $(which coffee) ]; then echo "ERROR: COFFEESCRIPT NOT FOUND"; exit 1; fi
if [ "$(node -p "require('semver').satisfies(process.version,'$NODE_VERSION')")" != "true" ]; then echo "ERROR: INCOMPATIBLE NODE VERSION"; exit 1; fi
echo "Starting Coffee"; node --harmony $(which coffee) "$0" -- "$@"
exit
###
console.log "pizdos..."
console.log process.argv
Стало:
#!/bin/bash ### NODE_VERSION=\>=0.11.13 if [ -z $(which node) ]; then echo ERROR: NODE.JS NOT FOUND; exit 1; fi if [ -z $(which coffee) ]; then echo ERROR: COFFEESCRIPT NOT FOUND; exit 1; fi if [ $(node -p require\(\'semver\'\).satisfies\(process.version,\'$NODE_VERSION\'\)) != true ]; then echo ERROR: INCOMPATIBLE NODE VERSION; exit 1; fi echo Starting Coffee; node --harmony $(which coffee) $0 -- $@ exit ### console.log "pizdos..." console.log process.argv
ТЕПЕРЬ БОЛЬШЕ НИКАКИХ вложенных КАВЫЧЕЧЕК БЛЯДЬ! КОКАЯ КРОСОТА! МОЖНО ТЕПЕРЬ И ПОРАБОТАТЬ, НО ЧТО-ТО НЕ ХОЧЕТСЯ.
А вот ну совсем-совсем без кавычечек:
#!/bin/bash ### NODE_VERSION=\>=0.11.13 if [ -z $(which node) ]; then echo ERROR: NODE.JS NOT FOUND; exit 1; fi if [ -z $(which coffee) ]; then echo ERROR: COFFEESCRIPT NOT FOUND; exit 1; fi if [ $(node -p require\(String\(/semver/\).substring\(1,7\)\).satisfies\(process.version,String\(/$NODE_VERSION/\).substring\(1\).slice\(0,-1\)\)) != true ]; then echo ERROR: INCOMPATIBLE NODE VERSION; exit 1; fi echo Starting Coffee; node --harmony $(which coffee) $0 -- $@ exit ### console.log "pizdos..." console.log process.argv
МЕНЬШЕ КАВЫЧЕК БОБУ НЕКАВЫЧКИНУ
root_directory_listing.sort (a,b) ->
a.substr(0,(~-a.lastIndexOf(".") >>> 0) + 1).length -
b.substr(0,(~-b.lastIndexOf(".") >>> 0) + 1).length
Есть нормальные люди, а есть ёбаные в жопу клоуны. И эти самые ёбаные в жопу клоуны сериализуют массивы в query string не так:
nserver[]=ns1.hosting.zone&nserver[]=ns2.hosting.zone
И даже не так:
nserver[0]=ns1.hosting.zone&nserver[1]=ns2.hosting.zone
А вот так:
nserver=ns1.hosting.zone&nserver=ns2.hosting.zone
И требуют того же от других. Объяснять этим на голову ёбнутым всю ущербность и однобокость такого подхода бесполезно, поэтому специально для них в марте 2015 года в пакете request появилась опция для qs (альтернатива querystring) qsStringifyOptions с под-опцией arrayFormat и з��ачением 'repeat'.
result = yield request(
url: apiurl
method: "POST"
qsStringifyOptions:
arrayFormat: 'repeat'
form:
action: "UPDATE"
login: login
passwd: password
domain: domain.domainname
state: "DELEGATED"
nserver: ["ns1.hosting.zone","ns2.hosting.zone"]
)
Ошибка:
TypeError: object is not a function at Object.(/home/jcheck/jcheck/app.start.coffee.sh:129:5) at Object. (/home/jcheck/jcheck/app.start.coffee.sh:131:4) at Module._compile (module.js:449:26) at Object.exports.run (/home/jcheck/.nvm/v0.11.13/lib/node_modules/coffee-script/lib/coffee-script/coffee-script.js:131:23) at compileScript (/home/jcheck/.nvm/v0.11.13/lib/node_modules/coffee-script/lib/coffee-script/command.js:208:29) at compilePath (/home/jcheck/.nvm/v0.11.13/lib/node_modules/coffee-script/lib/coffee-script/command.js:161:14) at Object.exports.run (/home/jcheck/.nvm/v0.11.13/lib/node_modules/coffee-script/lib/coffee-script/command.js:96:20) at Object. (/home/jcheck/.nvm/v0.11.13/lib/node_modules/coffee-script/bin/coffee:7:41) at Module._compile (module.js:449:26) at Object.Module._extensions..js (module.js:467:10) at Module.load (module.js:349:32) at Function.Module._load (module.js:305:12) at Function.Module.runMain (module.js:490:10) at startup (node.js:124:16) at node.js:807:3
Причина:
cron = require 'cron'
При этом пакет cron не установлен, что и является причиной ошибки. То же самое с другими недостающими либами.
Folded:
instances_counter = 0
module.exports = ( -> __class = (-> __args = Array.prototype.slice.call(arguments); if @ instanceof __class then @constructor?.apply(@,__args);@ else new (Function.prototype.bind.apply(__class,[null].concat(__args)))); __class.prototype = @; __class).apply
constructor_not_required_anymore: (@param1,@param2) ->
console.log "cnstar"
@id = ++instances_counter
render: ->
console.log @,instances_counter,@ instanceof module.exports
Unfolded:
instances_counter = 0
module.exports = (
->
__class = (->
__args = Array.prototype.slice.call(arguments)
if @ instanceof __class
@constructor?.apply(@,__args);@
else
new (Function.prototype.bind.apply(__class,[null].concat(__args)))
);
__class.prototype = @;
__class).apply
constructor_not_required_anymore: (@param1,@param2) ->
console.log "cnstar"
@id = ++instances_counter
render: ->
console.log @,instances_counter,@ instanceof module.exports
Folded:
instances_counter = 0
module.exports = (-> __constructor = (-> if @ instanceof __constructor then @constructor.apply(@,Array.prototype.slice.call(arguments)) else new (Function.prototype.bind.apply(__constructor,[null].concat(Array.prototype.slice.call(arguments))))); __constructor.prototype = @; __constructor).apply
constructor: (@param1,@param2) ->
console.log "cnstar"
@id = ++instances_counter
render: ->
console.log @,instances_counter,@ instanceof module.exports
Unfolded:
instances_counter = 0
module.exports = (
->
__constructor = (->
__args = Array.prototype.slice.call(arguments)
if @ instanceof __constructor
@constructor.apply(@,__args)
else
new (Function.prototype.bind.apply(__constructor,[null].concat(__args)))
);
__constructor.prototype = @;
__constructor).apply
constructor: (@param1,@param2) ->
console.log "cnstar"
@id = ++instances_counter
render: ->
console.log @,instances_counter,@ instanceof module.exports
Testing:
Class2 = require './class2'
a = Class2('a1','a2')
b = new Class2('b1','b2')
a.render()
b.render()
console.log a instanceof Class2
console.log b instanceof Class2
Output:
$ coffee class3.coffee
cnstar
cnstar
{ param1: 'a1', param2: 'a2', id: 1 } 2 true
{ param1: 'b1', param2: 'b2', id: 2 } 2 true
true
true
module.exports = do ->
self = {}
instances_counter = 0
self.constructor = ->
unless @ instanceof self.constructor
return new (Function.prototype.bind.apply(self.constructor, [null].concat(Array.prototype.slice.call(arguments))))
@id = ++ instances_counter
self.render = ->
console.log @id
self.constructor.prototype = self
return self.constructor
a = module.exports()
a.render()
b = module.exports()
b.render()
Ошибка:
@cookies.get(cookie_name) в koa возвращает [object Generator]
Причина:
Одна блядь записала в кукис cookie_name строку "[object Generator]", а другая блядь показала во вкладке Cookies пустую таблицу, хотя на самом деле эти кукисы в браузере были.