【发布时间】:2016-04-06 18:15:27
【问题描述】:
首先,我将 javascript 示例转换为 dart 示例。
JS
Parse.Cloud.define('hello', function(request, response) {
response.success('Hello world');
});
飞镖
import 'dart:js' show allowInterop;
import 'package:js/js.dart' show JS;
@JS('Parse.Cloud.define')
external void define(String name, Function func);
void main() {
define('hello', allowInterop((req, res) {
res.success('Yeah!');
}));
}
然后我使用 dart2js 编译它(是否使用 csp)。
最后我运行parse deploy,我得到了
ReferenceError: self is not defined
at <error: TypeError: Object #<error> has no method '__lookupGetter__'>
at main.js:2539:9
at init.currentScript (main.js:2519:7)
at main.js:2534:5
at main.js:2542:3
现在,我来了……
我如何让它在 parse.com 上工作,我认为这是一个 nodejs 环境。
【问题讨论】: