coffee-script 2.3.0 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/coffee_script.rb +20 -20
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 43ba59185044ff1afc8466c2012f4bbbf38aab73
4
- data.tar.gz: bb547638a521ffc99ff9447c58a0e9d9fe12715f
3
+ metadata.gz: 5803ba3183749a5b0b9bb0800fac6498756d1b6d
4
+ data.tar.gz: 78cc925742c0df4ccf729346cabaa634043afd71
5
5
  SHA512:
6
- metadata.gz: c90835887f3bc8f0efddf401ee00c25489b858a3bf9dc5297495477a56a7818bd7f8ca3ec36c12ee418fe18b50689daebe55311c66e33e806f7d18679eb4fe5b
7
- data.tar.gz: f31f12dec9a76a9d68d26e33506ed38e6b19b828cbaa7e68e92a70033136cfa837e978ae4762bf00922505b5f60eb6133ff9ffff9f00e5bc841abddd443253ba
6
+ metadata.gz: fe5b0dcd5ff4bed44561f56060611863abeb9fdf4d698d760f5bf3564100e5517b03b0699313e13795cf50a58810e9a856229acf2abfdba2da8989735853f6a7
7
+ data.tar.gz: c88bd2b52b254a6db00fa0688073ec4385c349b8282fa5dc46106ae6332467591916eaa0b01ddebab74916d2a9c9be6d8f0ac9b61227681a9ccb5f31740e796c
@@ -16,8 +16,26 @@ module CoffeeScript
16
16
  @path = path
17
17
  end
18
18
 
19
+ COMPILE_FUNCTION_SOURCE = <<-JS
20
+ ;function compile(script, options) {
21
+ try {
22
+ return CoffeeScript.compile(script, options);
23
+ } catch (err) {
24
+ if (err instanceof SyntaxError && err.location) {
25
+ throw new SyntaxError([
26
+ err.filename || "[stdin]",
27
+ err.location.first_line + 1,
28
+ err.location.first_column + 1
29
+ ].join(":") + ": " + err.message)
30
+ } else {
31
+ throw err;
32
+ }
33
+ }
34
+ }
35
+ JS
36
+
19
37
  def self.contents
20
- @contents ||= File.read(path)
38
+ @contents ||= File.read(path) + COMPILE_FUNCTION_SOURCE
21
39
  end
22
40
 
23
41
  def self.version
@@ -55,25 +73,7 @@ module CoffeeScript
55
73
  options[:bare] = false
56
74
  end
57
75
 
58
- wrapper = <<-WRAPPER
59
- (function(script, options) {
60
- try {
61
- return CoffeeScript.compile(script, options);
62
- } catch (err) {
63
- if (err instanceof SyntaxError && err.location) {
64
- throw new SyntaxError([
65
- err.filename || "[stdin]",
66
- err.location.first_line + 1,
67
- err.location.first_column + 1
68
- ].join(":") + ": " + err.message)
69
- } else {
70
- throw err;
71
- }
72
- }
73
- })
74
- WRAPPER
75
-
76
- Source.context.call(wrapper, script, options)
76
+ Source.context.call("compile", script, options)
77
77
  end
78
78
  end
79
79
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coffee-script
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0
4
+ version: 2.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Ashkenas
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-07-11 00:00:00.000000000 Z
13
+ date: 2015-04-06 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: coffee-script-source