brototype icon indicating copy to clipboard operation
brototype copied to clipboard

Bro(app)... Have ReferenceError thrown: 'app' is not defined

Open tlkiong opened this issue 9 years ago • 5 comments
trafficstars

I tried:

Bro(app).doYouEven('xxx.yyy')

That produced:

Uncaught ReferenceError: app is not defined

tlkiong avatar Jul 08 '16 12:07 tlkiong

you'll need to show more of your code than that...Where do you define the app variable?

deltreey avatar Jul 08 '16 14:07 deltreey

I had the impression that Bro(app).doYouEven('...'); will also check that app is defined. Or is my assumption wrong here?

tlkiong avatar Jul 08 '16 15:07 tlkiong

As it currently functions, You wrap an object that you know exists. Then you check for properties of that object. Do you think that people would benefit from a null check in the wrap part of the equation? Is this a feature you'd like to see?

On Fri, Jul 8, 2016, 11:21 AM Kiong [email protected] wrote:

I had the impression that Bro(app).doYouEven('...'); will also check that app is defined. Or is my assumption wrong here?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/letsgetrandy/brototype/issues/55#issuecomment-231388686, or mute the thread https://github.com/notifications/unsubscribe/AAjwG8k5XKbWSCHfM5JG_0uhTGJIciKpks5qTmr9gaJpZM4JH-Hl .

deltreey avatar Jul 08 '16 15:07 deltreey

I see. I think that would actually be a great feature:

Bro(app).doYouEven('xxx.yyy');

Should perhaps check if the following are not undefined & null till the last property: app xxx yyy

tlkiong avatar Jul 08 '16 15:07 tlkiong

@letsgetrandy I can put together a pull request if you approve it. This discussion could use your opinion.

deltreey avatar Jul 08 '16 15:07 deltreey