Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot read property 'length' of undefined #150

Open
RichardHoOoOo opened this issue Jun 11, 2019 · 1 comment
Open

TypeError: Cannot read property 'length' of undefined #150

RichardHoOoOo opened this issue Jun 11, 2019 · 1 comment

Comments

@RichardHoOoOo
Copy link

TypeError: Cannot read property 'length' of undefined
at generateFunctionParams (/Users/jiajunhu/Google_Drive/Research/ICSE2020/jalangi2/node_modules/esotope/esotope.js:651:34)
at generateFunctionBody (/Users/jiajunhu/Google_Drive/Research/ICSE2020/jalangi2/node_modules/esotope/esotope.js:705:9)
at Object.generateMethodDefinition [as MethodDefinition] (/Users/jiajunhu/Google_Drive/Research/ICSE2020/jalangi2/node_modules/esotope/esotope.js:1234:13)
at Object.generateClassBody [as ClassBody] (/Users/jiajunhu/Google_Drive/Research/ICSE2020/jalangi2/node_modules/esotope/esotope.js:1569:34)
at Object.generateClassDeclaration [as ClassDeclaration] (/Users/jiajunhu/Google_Drive/Research/ICSE2020/jalangi2/node_modules/esotope/esotope.js:1591:32)
at Object.generateBlockStatement [as BlockStatement] (/Users/jiajunhu/Google_Drive/Research/ICSE2020/jalangi2/node_modules/esotope/esotope.js:1526:36)
at stmtToJs (/Users/jiajunhu/Google_Drive/Research/ICSE2020/jalangi2/node_modules/esotope/esotope.js:2143:28)
at Object.generateTryStatement [as TryStatement] (/Users/jiajunhu/Google_Drive/Research/ICSE2020/jalangi2/node_modules/esotope/esotope.js:1858:26)
at Object.generateBlockStatement [as BlockStatement] (/Users/jiajunhu/Google_Drive/Research/ICSE2020/jalangi2/node_modules/esotope/esotope.js:1526:36)
at Object.generateWhileStatement [as WhileStatement] (/Users/jiajunhu/Google_Drive/Research/ICSE2020/jalangi2/node_modules/esotope/esotope.js:2103:32)

Test sample:

<script type="text/javascript">
	
	class myDate extends Date {
		
		constructor() {
			super();
		}

		
		getFormattedDate() {
			var months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];
			return this.getDate() + "-" + months[this.getMonth()] + "-" + this.getFullYear();
		}
	}

	

function foo(){
		return "foo ";
	}

	function bar(){
		return "bar ";
	}

	function test() {
		var d = new myDate();
  s = ""
		s = d.getFormattedDate();
		for (var i = 0; i < 10; i++){
			if (i%2 === 0){
				s += foo();
			} else {
				s += bar();
			}
		}
		return s;
	}	
</script>
@amiduai
Copy link

amiduai commented Aug 9, 2021

Same here, anyone has solved it ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants