Skip to content

Commit

Permalink
Correcting String.raw to follow ES6 spec step 14.h.
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Nov 20, 2014
1 parent bd781a5 commit 151113e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions es6-shim.js
Original file line number Diff line number Diff line change
Expand Up @@ -462,10 +462,7 @@
if (nextIndex + 1 >= literalsegments) {
break;
}
next = arguments[nextIndex + 1];
if (typeof next === 'undefined') {
break;
}
next = nextIndex + 1 < arguments.length ? arguments[nextIndex + 1] : '';
nextSub = String(next);
stringElements.push(nextSub);
nextIndex++;
Expand Down
2 changes: 1 addition & 1 deletion test/string.js
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ var runStringTests = function () {
var callSite = {
raw: { 0: 'The total is ', 1: ' ($', 2: ' with tax)', length: 3 }
};
var str = 'The total is 10 ($';
var str = 'The total is 10 ($ with tax)';
expect(String.raw(callSite, 10)).to.equal(str);
});
});
Expand Down

0 comments on commit 151113e

Please sign in to comment.