src: disable fast math on arm
[platform/upstream/nodejs.git] / test / parallel / test-vm-function-declaration.js
1 var common = require('../common');
2 var assert = require('assert');
3
4 var vm = require('vm');
5 var o = vm.createContext({ console: console });
6
7 // This triggers the setter callback in node_contextify.cc
8 var code = 'var a = function() {};\n';
9
10 // but this does not, since function decls are defineProperties,
11 // not simple sets.
12 code += 'function b(){}\n';
13
14 // Grab the global b function as the completion value, to ensure that
15 // we are getting the global function, and not some other thing
16 code += '(function(){return this})().b;\n'
17
18 var res = vm.runInContext(code, o, 'test');
19
20 assert.equal(typeof res, 'function', 'result should be function');
21 assert.equal(res.name, 'b', 'res should be named b');
22 assert.equal(typeof o.a, 'function', 'a should be function');
23 assert.equal(typeof o.b, 'function', 'b should be function');
24 assert.equal(res, o.b, 'result should be global b function');
25
26 console.log('ok');