-(defun context-coloring-benchmark-js-mode-run (callback)
- "Benchmark `js-mode', then call CALLBACK."
- (context-coloring-benchmark
- "js-mode"
- (lambda ()
- "Preparation logic for `js-mode'."
- (add-hook 'js-mode-hook #'context-coloring-mode))
- (lambda ()
- "Cleanup logic for `js-mode'."
- (remove-hook 'js-mode-hook #'context-coloring-mode))
- context-coloring-benchmark-js-fixtures
- callback))
-
-(defun context-coloring-benchmark-js2-mode-run (callback)
- "Benchmark `js2-mode', then call CALLBACK."
- (context-coloring-benchmark
- "js2-mode"
- (lambda ()
- "Preparation logic for `js2-mode'."
- (setq js2-mode-show-parse-errors nil)
- (setq js2-mode-show-strict-warnings nil)
- (add-to-list 'auto-mode-alist '("\\.js\\'" . js2-mode))
- (add-hook 'js2-mode-hook #'context-coloring-mode))
- (lambda ()
- "Cleanup logic for `js2-mode'."
- (remove-hook 'js2-mode-hook #'context-coloring-mode)
- (setq auto-mode-alist (delete '("\\.js\\'" . js2-mode)
- auto-mode-alist))
- (setq js2-mode-show-strict-warnings t)
- (setq js2-mode-show-parse-errors t))
- context-coloring-benchmark-js-fixtures
- callback))
+(defun context-coloring-benchmark-js2-mode-run ()
+ "Benchmark `js2-mode'."
+ (add-to-list 'auto-mode-alist '("\\.js\\'" . js2-mode))
+ (add-hook 'js2-mode-hook #'context-coloring-mode)
+ (let ((js2-mode-show-parse-errors nil)
+ (js2-mode-show-strict-warnings nil))
+ (context-coloring-benchmark
+ "js2-mode"
+ context-coloring-benchmark-javascript-fixtures))
+ (setq auto-mode-alist (delete '("\\.js\\'" . js2-mode)
+ auto-mode-alist))
+ (remove-hook 'js2-mode-hook #'context-coloring-mode))