0

当我在源代码上运行 qooxdoo 生成器时,出现错误:

TypeError:“int”对象不可下标

我的源代码是什么导致了这个:

/* ************************************************************************

   Copyright:

   License:

   Authors:

   ************************************************************************ */

/* ************************************************************************

   #asset(first/*)

   ************************************************************************ */

/**
 * This is the main application class of your custom application "first"
 */
qx.Class.define("first.Application", {

    extend : qx.application.Standalone,
    members : {

    main : function() {
        // Call super class
        this.base(arguments);

        // Enable logging in debug variant
        if (qx.core.Environment.get("qx.debug")) {
        // support native logging capabilities, e.g. Firebug for Firefox
        qx.log.appender.Native;
        // support additional cross-browser console. Press F7 to toggle visibility
        qx.log.appender.Console;
        }

        var layout = new qx.ui.layout.Grid(9, 5);

        var label_f = new qx.ui.basic.Label("fahrenheit");
        var label_c = new qx.ui.basic.Label("celsius");
        var tf_f = new qx.ui.form.TextField();
        var tf_c = new qx.ui.form.TextField();

        var button_f = new qx.ui.form.Button("F->C");
        var button_c = new qx.ui.form.Button("C->F");

        // Document is the application root
        var doc = this.getRoot();
        doc.setLayout(layout);

        // Add button to document at fixed coordinates
        doc.add(label_f, {row: 0, column: 0});

    }

    }
}
           );
4

1 回答 1

2

这是一个 Python 异常。你的 JavaScript 看起来不错,我让它运行没有问题。请您执行以下操作:

  • 说明您是如何运行生成器的(例如./generate.py source)?
  • 添加一个-s到您的生成器调用(例如./generate.py -s source- 这将打印一个 python 堆栈跟踪)并在此处打印输出
  • 在此处运行./generate.py info并打印输出
  • 通过jslint.com验证你config.json的 JSON 是否有效=> 你应该得到:JSON: good.
于 2013-01-30T20:00:56.747 回答