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

debugger should work without () #153

Closed
phillipskevin opened this issue Mar 20, 2018 · 1 comment · Fixed by #154
Closed

debugger should work without () #153

phillipskevin opened this issue Mar 20, 2018 · 1 comment · Fixed by #154

Comments

@phillipskevin
Copy link
Contributor

@phillipskevin commented on Wed Feb 14 2018

This should work to all the debugger helper so that it works like every other built-in helper:

{{debugger}}

To make this work, we'll probably need to do the same thing that we do with {{default}}: https://github.com/canjs/can-stache/blob/bcb5b78623276d95c582cce83d14c51d84707114/helpers/core.js#L245-L256


@christopherjbaker commented on Thu Mar 01 2018

I added this to the debuggerHelper

canReflect.assignSymbols(debuggerHelper, {
	"can.isValueLike": true,
	"can.isFunctionLike": false,
	"can.getValue": function() {
		return this();
	}
});

however this is resulting it in being called with no arguments (since it has this() and the getValue function also has no arguments), so the get function will not work.

Also, in addition to the two logs that the debugger outputs (Use get() to debug this template and Forgotten {{debugger}} helper), it is also outputting can-stache/expressions/lookup.js: Unable to find key "debugger". I can fix this by returning a truthy value, but I think this will output to the page, which I think is undesirable.

@phillipskevin
Copy link
Contributor Author

phillipskevin commented Mar 20, 2018

Going to make debugger a reserved scope key so that {{debugger}} will call the stache debugger helper with the correct scope.

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.

1 participant