Command.m 528 B

12345678910111213141516171819202122232425262728
  1. //
  2. // Command.m
  3. // MacGap
  4. //
  5. // Created by Joe Hildebrand on 1/10/12.
  6. // Copyright (c) 2012 Twitter. All rights reserved.
  7. //
  8. #import "Command.h"
  9. #import <JavaScriptCore/JSContextRef.h>
  10. @implementation Command
  11. - (id) initWithContext:(JSContextRef)aContext {
  12. self = [super init];
  13. if (!self)
  14. return nil;
  15. context = aContext;
  16. JSGlobalContextRetain((JSGlobalContextRef)context);
  17. return self;
  18. }
  19. - (void)dealloc
  20. {
  21. if (context)
  22. JSGlobalContextRelease((JSGlobalContextRef)context);
  23. }
  24. @end