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

let context referencing an object's property causes browser crash #650

Closed
green3g opened this issue Dec 14, 2018 · 3 comments · Fixed by #651
Closed

let context referencing an object's property causes browser crash #650

green3g opened this issue Dec 14, 2018 · 3 comments · Fixed by #651

Comments

@green3g
Copy link
Contributor

green3g commented Dec 14, 2018

Synopsis:

After the first increment of ref, the property updates fine, but the second update causes the browser to crash.

Example: (paste this into code climate's example from canjs gitter)

import { Component } from "//unpkg.com/can@5/core.mjs";

Component.extend({
    tag: "my-counter",
    view: `
				{{let a = prop[ref]}}
				{{a}}
    `,
    ViewModel: {
			ref: {
				default: 0
			},
			prop: {
				default() {
					return {
					0: 1,
					1: 2,
					2: 3,
					4: 4
				}
				}
			},
			connectedCallback(){
				setInterval(() => {
					
				this.ref ++;
				}, 1000)
			}
    }
});

image

@chasenlehara
Copy link
Member

It looks like some sort of infinite recursion is happening. Chrome’s task manager shows the tab growing in memory usage and maxing out the CPU before the DevTools shows “Paused before potential out-of-memory crash.”

@green3g
Copy link
Contributor Author

green3g commented Dec 15, 2018

Yup, seeing this before and after the crash.

image

@justinbmeyer
Copy link
Contributor

I will fix this tomorrow

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

Successfully merging a pull request may close this issue.

3 participants