mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
429 B
23 lines
429 B
9 years ago
|
'use strict';
|
||
|
// copy console accessor because requiring ../common touches it
|
||
|
const consoleDescriptor = Object.getOwnPropertyDescriptor(global, 'console');
|
||
|
delete global.console;
|
||
|
global.console = {};
|
||
|
|
||
|
require('../common');
|
||
|
|
||
|
function a() {
|
||
|
try {
|
||
|
return a();
|
||
|
} catch (e) {
|
||
|
const console = consoleDescriptor.get();
|
||
|
if (console.log) {
|
||
|
console.log('Hello, World!');
|
||
|
} else {
|
||
|
throw e;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
a();
|