sass 3.3.0.alpha.132 → 3.3.0.alpha.133

Sign up to get free protection for your applications and to get access to all the features.
data/REVISION CHANGED
@@ -1 +1 @@
1
- f9bcfe554e74c03d2f0846f8cdfb9b3ec8cebbb7
1
+ a60a9187f9b56775f340e920390083771f3e5cc7
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.3.0.alpha.132
1
+ 3.3.0.alpha.133
data/VERSION_DATE CHANGED
@@ -1 +1 @@
1
- 18 April 2013 00:22:46 GMT
1
+ 22 April 2013 20:03:03 GMT
@@ -165,6 +165,12 @@ module Sass::Script
165
165
  # \{#append append($list1, $val, \[$separator\])}
166
166
  # : Appends a single value onto the end of a list.
167
167
  #
168
+ # \{#zip zip($list1, $list2, ...)}
169
+ # : Combines several lists into a single multidimensional list.
170
+ #
171
+ # \{#index index($list, $value)}
172
+ # : Returns the position of a value within a list, or false.
173
+ #
168
174
  # \{#list-separator list-separator(#list)}
169
175
  # : Returns the separator of a list.
170
176
  #
@@ -1558,8 +1564,8 @@ module Sass::Script
1558
1564
  declare :append, [:list, :val]
1559
1565
  declare :append, [:list, :val, :separator]
1560
1566
 
1561
- # Combines several lists into a single comma separated list
1562
- # space separated lists.
1567
+ # Combines several lists into a single comma separated list, where the nth
1568
+ # value is a space separated list of the source lists' nth values.
1563
1569
  #
1564
1570
  # The length of the resulting list is the length of the
1565
1571
  # shortest list.
@@ -1584,8 +1590,8 @@ module Sass::Script
1584
1590
  declare :zip, [], :var_args => true
1585
1591
 
1586
1592
 
1587
- # Returns the position of the given value within the given
1588
- # list. If not found, returns false.
1593
+ # Returns the position of a value within a list. If not found, returns
1594
+ # false.
1589
1595
  #
1590
1596
  # @example
1591
1597
  # index(1px solid red, solid) => 2
@@ -20,7 +20,10 @@ module Sass::Script
20
20
  def to_s(opts = {})
21
21
  ''
22
22
  end
23
- alias_method :to_sass, :to_s
23
+
24
+ def to_sass(opts = {})
25
+ 'null'
26
+ end
24
27
 
25
28
  # Returns a string representing a null value.
26
29
  #
@@ -433,7 +433,7 @@ class Sass::Tree::Visitors::Perform < Sass::Tree::Visitors::Base
433
433
  end
434
434
  end
435
435
 
436
- return if mixins.empty?
436
+ return unless mixins.include?(node.name)
437
437
  raise Sass::SyntaxError.new("#{msg} #{node.name} includes itself") if mixins.size == 1
438
438
 
439
439
  msg << "\n" << Sass::Util.enum_cons(mixins.reverse + [node.name], 2).map do |m1, m2|
@@ -1620,20 +1620,12 @@ SCSS
1620
1620
 
1621
1621
  def test_list_in_args
1622
1622
  assert_renders(<<SASS, <<SCSS)
1623
- $foo: foo((a, b, c))
1624
- $foo: foo($arg: (a, b, c))
1625
- $foo: foo(a, b, (c, d, e)...)
1626
-
1627
1623
  +mixin((a, b, c))
1628
1624
 
1629
1625
  +mixin($arg: (a, b, c))
1630
1626
 
1631
1627
  +mixin(a, b, (c, d, e)...)
1632
1628
  SASS
1633
- $foo: foo((a, b, c));
1634
- $foo: foo($arg: (a, b, c));
1635
- $foo: foo(a, b, (c, d, e)...);
1636
-
1637
1629
  @include mixin((a, b, c));
1638
1630
 
1639
1631
  @include mixin($arg: (a, b, c));
@@ -1652,14 +1644,6 @@ SASS
1652
1644
  SCSS
1653
1645
  end
1654
1646
 
1655
- def test_empty_lists
1656
- assert_renders(<<SASS, <<SCSS)
1657
- $foo: ()
1658
- SASS
1659
- $foo: ();
1660
- SCSS
1661
- end
1662
-
1663
1647
  def test_nested_if_statements
1664
1648
  assert_renders(<<SASS, <<SCSS)
1665
1649
  @if $foo
@@ -22,6 +22,10 @@ module Sass::Script::Functions::UserFunctions
22
22
  end
23
23
  end
24
24
 
25
+ module Sass::Script::Functions
26
+ include Sass::Script::Functions::UserFunctions
27
+ end
28
+
25
29
  class SassEngineTest < Test::Unit::TestCase
26
30
  FAKE_FILE_NAME = __FILE__.gsub(/rb$/,"sass")
27
31
  # A map of erroneous Sass documents to the error messages they should produce.
@@ -520,6 +524,21 @@ MESSAGE
520
524
  assert_hash_has(err.sass_backtrace[2], :mixin => "foo", :line => 2)
521
525
  end
522
526
 
527
+ def test_mixin_loop_with_content
528
+ render <<SASS
529
+ =foo
530
+ @content
531
+ =bar
532
+ +foo
533
+ +bar
534
+ +bar
535
+ SASS
536
+ assert(false, "Exception not raised")
537
+ rescue Sass::SyntaxError => err
538
+ assert_equal("An @include loop has been found: bar includes itself", err.message)
539
+ assert_hash_has(err.sass_backtrace[0], :mixin => "@content", :line => 5)
540
+ end
541
+
523
542
  def test_basic_import_loop_exception
524
543
  import = filename_for_test
525
544
  importer = MockImporter.new
@@ -2416,6 +2435,24 @@ SASS
2416
2435
 
2417
2436
  # Regression tests
2418
2437
 
2438
+ def test_parent_mixin_in_content_nested
2439
+ assert_equal(<<CSS, render(<<SASS))
2440
+ a {
2441
+ b: c; }
2442
+ CSS
2443
+ =foo
2444
+ @content
2445
+
2446
+ =bar
2447
+ +foo
2448
+ +foo
2449
+ a
2450
+ b: c
2451
+
2452
+ +bar
2453
+ SASS
2454
+ end
2455
+
2419
2456
  def test_supports_bubbles
2420
2457
  assert_equal <<CSS, render(<<SASS)
2421
2458
  parent {
@@ -69,6 +69,20 @@ class SassScriptConversionTest < Test::Unit::TestCase
69
69
  assert_renders "$flaznicate"
70
70
  end
71
71
 
72
+ def test_null
73
+ assert_renders "null"
74
+ end
75
+
76
+ def test_empty_list
77
+ assert_renders "()"
78
+ end
79
+
80
+ def test_list_in_args
81
+ assert_renders "foo((a, b, c))"
82
+ assert_renders "foo($arg: (a, b, c))"
83
+ assert_renders "foo(a, b, (a, b, c)...)"
84
+ end
85
+
72
86
  def self.test_precedence(outer, inner)
73
87
  op_outer = Sass::Script::Lexer::OPERATORS_REVERSE[outer]
74
88
  op_inner = Sass::Script::Lexer::OPERATORS_REVERSE[inner]
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sass
3
3
  version: !ruby/object:Gem::Version
4
- hash: 592302597
4
+ hash: 592302599
5
5
  prerelease: 6
6
6
  segments:
7
7
  - 3
8
8
  - 3
9
9
  - 0
10
10
  - alpha
11
- - 132
12
- version: 3.3.0.alpha.132
11
+ - 133
12
+ version: 3.3.0.alpha.133
13
13
  platform: ruby
14
14
  authors:
15
15
  - Nathan Weizenbaum
@@ -19,7 +19,7 @@ autorequire:
19
19
  bindir: bin
20
20
  cert_chain: []
21
21
 
22
- date: 2013-04-17 00:00:00 -04:00
22
+ date: 2013-04-22 00:00:00 -04:00
23
23
  default_executable:
24
24
  dependencies:
25
25
  - !ruby/object:Gem::Dependency