Javascript requirejs导出不';我不能在Firefox15中工作

Javascript requirejs导出不';我不能在Firefox15中工作,javascript,requirejs,adobe-brackets,Javascript,Requirejs,Adobe Brackets,我使用的外部库使用的是我不知道的requirejs 它是如何工作的,但FileError在其他浏览器的全局范围内 或在FF8中,但在FF14/15中表示未定义FileError。 define(function (require, exports, module) { "use strict"; var Async = require("utils/Async"); var NativeFileSystem = { /** * LOT OF CODE

我使用的外部库使用的是我不知道的requirejs 它是如何工作的,但FileError在其他浏览器的全局范围内 或在FF8中,但在FF14/15中表示未定义
FileError。

define(function (require, exports, module) {   
   "use strict";
    var Async = require("utils/Async");
    var NativeFileSystem = {
    /**
     * LOT OF CODE HERE
     * ...
     * ...
     * ...
    */       
    /** class: FileError
     *
     * Implementation of HTML file API error code return class. Note that we don't
     * actually define the error codes here--we rely on the browser's built-in FileError
     * class's constants. In other words, external clients of this API should always
     * use FileError.<constant-name>, not NativeFileSystem.FileError.<constant-name>.
     *
     * @constructor
     * @param {number} code The error code to return with this FileError. Must be
     * one of the codes defined in the FileError class.
     */
    NativeFileSystem.FileError = function (code) {
        this.code = code || 0;
    };
    /**
     *THIS FIX THE PROBLEM BUT IT A HACK
     *window.FileError = NativeFileSystem.FileError;
     */
    // Define public API
    exports.NativeFileSystem    = NativeFileSystem;
});
define(函数(需要、导出、模块){
“严格使用”;
var Async=require(“utils/Async”);
var NativeFileSystem={
/**
*这里有很多代码
* ...
* ...
* ...
*/       
/**类别:FileError
*
*HTML文件API错误代码返回类的实现
*实际上,在这里定义错误代码——我们依赖于浏览器的内置FileError
*换句话说,这个API的外部客户端应该总是
*使用FileError.,而不是NativeFileSystem.FileError。。
*
*@constructor
*@param{number}code要随此文件返回的错误代码error。必须为
*FileError类中定义的代码之一。
*/
NativeFileSystem.FileError=函数(代码){
this.code=code | | 0;
};
/**
*这解决了问题,但它是一个黑客
*window.FileError=NativeFileSystem.FileError;
*/
//定义公共API
exports.NativeFileSystem=NativeFileSystem;
});
当然,如果我在 函数定义很好,但我不想破坏库

方括号仅对错误代码常量依赖FileError类


FileAPI仍然是一个草案规范,自我们最初编写NativeFileSystem以来,他们似乎已将FileError更改为DoError。我们可以删除此依赖项,并定义自己的等效FileError常量来删除此依赖项。我们试图按照FileAPI建模API,但这是一个移动的目标。

I f如果这说明添加到
导出
对象的属性将位于模块的公共界面上,无需返回任何值。我不太清楚您是如何尝试访问
FileError
对象的,也许您可以发布一个实际抛出错误的代码示例。问题不是
FileErr或者
implementation代码更大,是必须在全局范围内定义,而不是在所有浏览器中都这样做。这是一个为chrome嵌入的库,来自adobe bracket项目,但requirejs适用于所有浏览器