58ef241d9e
- "constuctor" -> "constructor" - "dependendencies" -> "dependencies" - "develpers" -> "developers" - ["nonexistant"][1] -> ["nonexistent"][2] - "reponsible" -> "responsible" [1]: https://en.wiktionary.org/wiki/nonexistant [2]: https://en.wiktionary.org/wiki/nonexistent Change-Id: I8bb482d03c391bd0d37afd5d616229fa50a4ab77 Reviewed-on: https://chromium-review.googlesource.com/c/1390203 Commit-Queue: Yang Guo <yangguo@chromium.org> Reviewed-by: Yang Guo <yangguo@chromium.org> Reviewed-by: Toon Verwaest <verwaest@chromium.org> Reviewed-by: Camillo Bruni <cbruni@chromium.org> Reviewed-by: Michael Stanton <mvstanton@chromium.org> Cr-Commit-Position: refs/heads/master@{#58610}
31 lines
816 B
JavaScript
31 lines
816 B
JavaScript
// Copyright 2018 the V8 project authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
// Flags: --expose-async-hooks
|
|
|
|
try {
|
|
Object.prototype.__defineGetter__(0, function(){});
|
|
assertThrows("x");
|
|
} catch(e) { print("Caught: " + e); }
|
|
|
|
try {
|
|
(function() {
|
|
let asyncIds = [], triggerIds = [];
|
|
let ah = async_hooks.createHook({
|
|
init(asyncId, type, triggerAsyncId, resource) {
|
|
if (type !== 'PROMISE') { return; }
|
|
assertThrows("asyncIds.push(asyncId);");
|
|
assertThrows("triggerIds.push(triggerAsyncId)");
|
|
},
|
|
});
|
|
ah.enable();
|
|
async function foo() {}
|
|
foo();
|
|
})();
|
|
} catch(e) { print("Caught: " + e); }
|
|
try {
|
|
var obj = {prop: 7};
|
|
assertThrows("nonexistent(obj)");
|
|
} catch(e) { print("Caught: " + e); }
|