Browse Source

test: fix misleading comment

The comment is outdated, function declarations have
nothing to do with defineProperties.

PR-URL: https://github.com/nodejs/node/pull/12048
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
v6
Franziska Hinkelmann 8 years ago
parent
commit
fd18243a50
  1. 6
      test/parallel/test-vm-function-declaration.js

6
test/parallel/test-vm-function-declaration.js

@ -26,11 +26,9 @@ const assert = require('assert');
const vm = require('vm'); const vm = require('vm');
const o = vm.createContext({ console: console }); const o = vm.createContext({ console: console });
// This triggers the setter callback in node_contextify.cc // Function declaration and expression should both be copied to the
// sandboxed context.
let code = 'var a = function() {};\n'; let code = 'var a = function() {};\n';
// but this does not, since function decls are defineProperties,
// not simple sets.
code += 'function b(){}\n'; code += 'function b(){}\n';
// Grab the global b function as the completion value, to ensure that // Grab the global b function as the completion value, to ensure that

Loading…
Cancel
Save