dexie - TypeError : 'caller' , 'callee' 和 'arguments' 属性可能无法在严格模式 dexie.js 上访问

标签 dexie

谁能告诉我当我调用 dexie.js 的 count() 函数时会发生什么:

TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them
    at eval (eval at getErrorWithStack (http://127.0.0.1:8081/elements/js/dexie.js:394:5), <anonymous>:1:19)
    at getErrorWithStack (http://127.0.0.1:8081/elements/js/dexie.js:394:5)
    at new Promise (http://127.0.0.1:8081/elements/js/dexie.js:786:29)
    at new Transaction (http://127.0.0.1:8081/elements/js/dexie.js:2756:28)
    at Dexie._createTransaction (http://127.0.0.1:8081/elements/js/dexie.js:1809:16)
    at tempTransaction (http://127.0.0.1:8081/elements/js/dexie.js:1825:28)
    at WriteableTable.getIDBObjectStore (http://127.0.0.1:8081/elements/js/dexie.js:2266:99)
    at WriteableCollection._read (http://127.0.0.1:8081/elements/js/dexie.js:3454:42)
    at WriteableCollection.count (http://127.0.0.1:8081/elements/js/dexie.js:3510:33)
    at HTMLElement.checkLoadEnoughtOfflineData (http://127.0.0.1:8081/elements/base/app-localize-behavior.html:294:73)

上面的最后一行是从我的函数调用:
 checkLoadEnoughtOfflineData(idcheck) {
       return dbOffline.checkPageTable.where("idCheck").equals(idcheck).count();
    }

p/s:我正在使用 Google Chorm 62。

最佳答案

我假设你在这个位置调试器中断。这是一段故意打破“严格”模式规则以生成错误的代码,以便可以从产生的错误中挑选调用堆栈。如果您可以在调试器设置中忽略此错误类型,则 Chrome 调试器将不再让您烦恼。它只会在 Dexie.debug === true (这是从 localhost 提供的站点的默认值)时发生。您在控制台日志中获得的功能是未处理拒绝的异步堆栈跟踪。您可以通过设置 Dexie.debug = false 来明确地关闭它。

源看起来像这样:

export function getErrorWithStack() {
    "use strict";
    if (NEEDS_THROW_FOR_STACK) try {
        // Doing something naughty in strict mode here to trigger a specific error
        // that can be explicitely ignored in debugger's exception settings.
        // If we'd just throw new Error() here, IE's debugger's exception settings
        // will just consider it as "exception thrown by javascript code" which is
        // something you wouldn't want it to ignore.
        getErrorWithStack.arguments;
        throw new Error(); // Fallback if above line don't throw.
    } catch(e) {
        return e;
    }
    return new Error();
}

关于dexie - TypeError : 'caller' , 'callee' 和 'arguments' 属性可能无法在严格模式 dexie.js 上访问,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47615114/

相关文章:

javascript - Dexie:如何在开头添加标签?

javascript - 防止 IndexedDB 中出现重复的 Blob 对象

updates - 使用 Dexie,如何从表中所有对象的数组字段中删除值?

javascript - 如何过滤indexedDB中的100K记录?

javascript - DexieJS (indexedDB) 链接多个 .where 子句

javascript - Dexie/IndexedDB 移动隐私浏览错误 - 呃哦 : Missing API Error: IndexedDB API Not Available

javascript - 如何使用 dexie.js 添加新条目

javascript - DexiestartsWithIgnoreCase() 函数数组未定义