forked from endel/js2php
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcore.js
25 lines (19 loc) · 784 Bytes
/
core.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
var utils = require('./utils'),
_array = require('./core/array'),
_date = require('./core/date'),
_function = require('./core/function'),
_json = require('./core/json'),
_string = require('./core/string'),
_math = require('./core/math');
module.exports = {
evaluate: function(node) {
var method = node.property.name;
// if (method == "hasOwnProperty") {
// var args = utils.clone(node.parent.arguments);
// node.parent.arguments = false;
// return { type: 'CallExpression', callee: { type: 'Identifier', name: 'isset', }, arguments: args };
// }
var handler = _array[method] || _date[method] || _function[method] || _json[method] || _string[method] || _math[method];
return (handler) ? handler(node) : node;
}
}