Added ObjectExpressionCalleeDataExtractor: added tests

This commit is contained in:
sanex3339
2016-10-16 01:05:58 +03:00
parent 525f77fbb8
commit 1fc50304b5
3 changed files with 12 additions and 3 deletions
+2 -3
View File
@@ -88,7 +88,7 @@ module.exports =
/******/ __webpack_require__.p = "";
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 82);
/******/ return __webpack_require__(__webpack_require__.s = 81);
/******/ })
/************************************************************************/
/******/ ([
@@ -4052,8 +4052,7 @@ module.exports = require("fs");
module.exports = require("mkdirp");
/***/ },
/* 81 */,
/* 82 */
/* 81 */
/***/ function(module, exports, __webpack_require__) {
"use strict";
@@ -18,6 +18,10 @@ var object1 = {
foo: {
baz: function () {
},
func: function () {
}
},
@@ -32,6 +36,7 @@ var object1 = {
object1.foo.baz();
object1['foo'].baz();
object1['foo'].func();
object1.bar();
object.bar();
@@ -300,6 +300,11 @@ describe('StackTraceAnalyzer', () => {
callee: (<ESTree.FunctionExpression>getObjectFunctionExpressionByName(astTree, 'object1', 'baz')).body,
stackTrace: []
},
{
name: 'func',
callee: (<ESTree.FunctionExpression>getObjectFunctionExpressionByName(astTree, 'object1', 'func')).body,
stackTrace: []
},
{
name: 'bar',
callee: (<ESTree.FunctionExpression>getObjectFunctionExpressionByName(astTree, 'object1', 'bar')).body,