0

i have coffee script class that defined a method named 'isOutdated', right it only output some text, i need to use this method in another method, but it always complained 'isOutdated is not defined', don't know why,

here is my code:

class A
  ...
  isOutdated: (last, curr) ->
    'hell..o'

  run: (callback) ->
    @store.findOne config, {name : 'a' }, {}, {}, (err, results) =>
      return callback err, null if err
      callback null, isOutdated 'last', 'curr'

and here is what it complaint: [ReferenceError: isOutdated is not defined]

1 Answer 1

1

If you want to reference the isOutdated method then you need to say

  callback null, @isOutdated 'last', 'curr'
  # -------------^

Just isOutdated is looking for a local variable, not the method.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.