Skip to content

Commit 352d78e

Browse files
committed
Merge pull request #636 from sethkinast/ie8
Fix failing tests in IE8
2 parents d86cbeb + 77d74e0 commit 352d78e

File tree

1 file changed

+2
-38
lines changed

1 file changed

+2
-38
lines changed

test/jasmine-test/spec/coreTests.js

Lines changed: 2 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ var coreTests = [
7777
message: "should test basic text rendering"
7878
},
7979
{
80-
name: "confusing \" \n \' \u0000 \u2028 \u2029 template name\\",
80+
name: "confusing \" \n \' \u2028 \u2029 template name\\",
8181
source: "Hello World!",
8282
context: {},
8383
expected: "Hello World!",
@@ -1051,78 +1051,50 @@ var coreTests = [
10511051
"age": "8 hours",
10521052
"people": [
10531053
{ "name": "Alice" },
1054-
{ "name": "Bob", "age": 42 },
1054+
{ "name": "Bob", "age": 42 }
10551055
]
10561056
},
10571057
expected: "Alice is not telling us their age.Bob is 42 years old.",
10581058
message: "should test the leading dot behavior in local mode"
10591059
},
1060-
{
1061-
name: "check nested ref in global does not work in local mode",
1062-
source: "{glob.globChild}",
1063-
context: { },
1064-
expected: "",
1065-
message: "Should not find glob.globChild which is in context.global"
1066-
},
1067-
{
1068-
name: "Verify leading dot path not affected in global mode",
1069-
source: "{#people}{.name} is {?.age}{.age} years old.{:else}not telling us their age.{/age}{/people}",
1070-
options: {pathScope: "global"},
1071-
context: {
1072-
"name": "List of people",
1073-
"age": "8 hours",
1074-
"people": [
1075-
{ "name": "Alice" },
1076-
{ "name": "Bob", "age": 42 },
1077-
]
1078-
},
1079-
expected: "Alice is not telling us their age.Bob is 42 years old.",
1080-
message: "should test the leading dot behavior preserved"
1081-
},
10821060
{
10831061
name: "Standard dotted path with falsey value. Issue 317",
10841062
source: "{foo.bar}",
1085-
options: {pathScope: "global"},
10861063
context: { foo: {bar: 0} },
10871064
expected: "0",
10881065
message: "should work when value at end of path is falsey"
10891066
},
10901067
{
10911068
name: "dotted path resolution up context",
10921069
source: "{#data.A.list}Aname{data.A.name}{/data.A.list}",
1093-
options: {pathScope: "global"},
10941070
context: { "data":{"A":{"name":"Al","list":[{"name": "Joe"},{"name": "Mary"}],"B":{"name":"Bob","Blist":["BB1","BB2"]}}} },
10951071
expected: "AnameAlAnameAl",
10961072
message: "should test usage of dotted path resolution up context"
10971073
},
10981074
{
10991075
name: "dotted path resolution up context 2",
11001076
source: "{#data.A.B.Blist}Aname{data.A.name}{/data.A.B.Blist}",
1101-
options: {pathScope: "global"},
11021077
context: { "data":{"A":{"name":"Al","list":[{"name": "Joe"},{"name": "Mary"}],"B":{"name":"Bob","Blist":["BB1","BB2"]}}} },
11031078
expected: "AnameAlAnameAl",
11041079
message: "should test usage of dotted path resolution up context"
11051080
},
11061081
{
11071082
name: "dotted path resolution without explicit context",
11081083
source: "{#data.A}Aname{name}{data.C.name}{/data.A}",
1109-
options: {pathScope: "global"},
11101084
context: { "data":{"A":{"name":"Al","list":[{"name": "Joe"},{"name": "Mary"}],"B":{"name":"Bob","Blist":["BB1","BB2"]}},C:{name:"cname"}} },
11111085
expected: "AnameAlcname",
11121086
message: "should test usage of dotted path resolution up context"
11131087
},
11141088
{
11151089
name: "same as previous test but with explicit context",
11161090
source: "{#data.A:B}Aname{name}{data.C.name}{/data.A}",
1117-
options: {pathScope: "global"},
11181091
context: { "data":{"A":{"name":"Al","list":[{"name": "Joe"},{"name": "Mary"}],"B":{"name":"Bob","Blist":["BB1","BB2"]}},C:{name:"cname"}} },
11191092
expected: "AnameAl",
11201093
message: "should test explicit context blocks looking further up stack"
11211094
},
11221095
{
11231096
name: "explicit context but gets value from global",
11241097
source: "{#data.A:B}Aname{name}{glob.globChild}{/data.A}",
1125-
options: {pathScope: "global"},
11261098
base: { glob: { globChild: "testGlobal"} },
11271099
context: { "data":{"A":{"name":"Al","list":[{"name": "Joe"},{"name": "Mary"}],"B":{"name":"Bob","Blist":["BB1","BB2"]}},C:{name:"cname"}} },
11281100
expected: "AnameAltestGlobal",
@@ -1131,15 +1103,13 @@ var coreTests = [
11311103
{
11321104
name: "nested dotted path resolution",
11331105
source: "{#data.A.list}{#data.A.B.Blist}{.}Aname{data.A.name}{/data.A.B.Blist}{/data.A.list}",
1134-
options: {pathScope: "global"},
11351106
context: { "data":{"A":{"name":"Al","list":[{"name": "Joe"},{"name": "Mary"}],"B":{"name":"Bob","Blist":["BB1"]}}} },
11361107
expected: "BB1AnameAlBB1AnameAl",
11371108
message: "should test nested usage of dotted path resolution"
11381109
},
11391110
{
11401111
name: "check nested ref in global works in global mode",
11411112
source: "{glob.globChild}",
1142-
options: {pathScope: "global"},
11431113
base: { glob: { globChild: "testGlobal"} },
11441114
context: { },
11451115
expected: "testGlobal",
@@ -1148,15 +1118,13 @@ var coreTests = [
11481118
{
11491119
name: "dotted path resolution up context with partial match in current context",
11501120
source: "{#data}{#A}{C.name}{/A}{/data}",
1151-
options: {pathScope: "global"},
11521121
context: { "data":{ "A":{ "name":"Al", "B": "Ben", "C": { namex: "Charlie"} }, C: {name: "Charlie Sr."} } },
11531122
expected: "",
11541123
message: "should test usage of dotted path resolution up context"
11551124
},
11561125
{
11571126
name: "check nested ref not found in global if partial match",
11581127
source: "{#data}{#A}{C.name}{/A}{/data}",
1159-
options: {pathScope: "global"},
11601128
base: { C: {name: "Big Charlie"} },
11611129
context: { "data":{ "A":{ "name":"Al", "B": "Ben", "C": { namex: "Charlie"} }, C: {namey: "Charlie Sr."} } },
11621130
expected: "",
@@ -1165,7 +1133,6 @@ var coreTests = [
11651133
{
11661134
name: "method invocation",
11671135
source: "Hello {person.fullName}",
1168-
options: {pathScope: "global"},
11691136
context: {
11701137
person: {
11711138
firstName: "Peter",
@@ -1181,23 +1148,20 @@ var coreTests = [
11811148
{
11821149
name: "check null values in section iteration don't break path resolution",
11831150
source: "{#nulls}{names[0].name}{/nulls}",
1184-
options: {pathScope: "global"},
11851151
context: { "nulls": [1, null, null, 2],"names": [{"name": "Moe"}, {"name": "Curly"}] },
11861152
expected: "MoeMoeMoeMoe",
11871153
message: "Should resolve path correctly"
11881154
},
11891155
{
11901156
name: "check falsey value in section iteration don't break path resolution",
11911157
source: "{#list}{a.b}{/list}",
1192-
options: {pathScope: "global"},
11931158
context: { "list": ['', 2, ''],"a": {"b": "B"} },
11941159
expected: "BBB",
11951160
message: "Should resolve path correctly"
11961161
},
11971162
{
11981163
name: "check true value in section iteration are also OK",
11991164
source: "{#list}{a.b}{/list}",
1200-
options: {pathScope: "global"},
12011165
context: { "list": [true, 2, true],"a": {"b": "B"} },
12021166
expected: "BBB",
12031167
message: "Should resolve path correctly"

0 commit comments

Comments
 (0)