Tag: 居住脚本

Livescript的克隆操作符^^在服务器端不工作(node.js)

在livescript ,我们可以使用^^克隆一个对象。 例如, consloe.log (^^{a:1}) 将编译到 // Generated by LiveScript 1.2.0 (function(){ console.log(clone$({ a: 1 })); function clone$(it){ function fun(){} fun.prototype = it; return new fun; } }).call(this); 但是,这些代码在浏览器中成功运行,但不能在node.js中运行。 在浏览器中,它在控制台中打印fun {a: 1} 。 在node.js中,它什么都没有显示。 什么原因?