0

I am using JS-Ctypes in my Qooxdoo project. When I try to generate source, I am given the following error:

Scanning libraries -Unknown operator u'import

This error is risen when using the following function:

Components.utils.import("resource://gre/modules/ctypes.jsm");

Does any one know how to make qooxdoo recognize js-ctypes and this operator?

Adi
  • 5,089
  • 6
  • 33
  • 47
Dark Templar
  • 1,175
  • 13
  • 27

2 Answers2

1

It's the use of of the word import. It's a "future reserved word" per ECMA spec, and you should not use those (Identifiers are not allowed to match reserved words). This is why the generator exits. The solution is simply to chose another identifier for this method, e.g. import_ suffices.

But the error message is bad, to say the least. If you want to help, open a bug report for this.

ThomasH
  • 22,276
  • 13
  • 61
  • 62
  • Thank you for your reply Thomas, but I was getting the error TypeError: Components.utils.import_ is not a function. Using ["import"] solved my problem. – Dark Templar Aug 15 '12 at 08:48
0

The solution to this problem is :

Components.utils["import"];

For more information follow this link: http://qooxdoo.678.n2.nabble.com/Qooxdoo-and-JS-Ctypes-problem-while-generating-source-tc7580977.html

Dark Templar
  • 1,175
  • 13
  • 27