Tag: 发誓

V8懒惰的堆栈跟踪生成似乎会导致誓言库中的无限循环

我花了一些时间在NodeJStesting套件中debugging一个奇怪的无限循环问题。 它只发生在罕见的情况下,但我可以重现它,当我连接到铬debugging器。 我认为它必须处理V8处理exception中的堆栈跟踪,以及发誓库对AssertionError对象做出的扩展(发誓添加了toString方法)。 我也可能弄错了,所以我想问一下,我对V8的实现的理解是否正确。 这是一个重现错误的最简单的例子: $ git clone https://github.com/flatiron/vows.git $ cd vows && npm install && npm install should $ cat > example.js var should = require('should'); var error = require('./lib/assert/error.js'); try { 'x'.should.be.json; } catch (e) { console.log(e.toString()); } // without debug, it should fail as expected $ node example.js expected 'x' to have […]