inherit string quotes - fixes #991

This commit is contained in:
Sebastian McKenzie
2015-03-31 02:09:56 +11:00
parent b8f2a27e90
commit 153e81261c
11 changed files with 63 additions and 9 deletions

View File

@@ -0,0 +1,4 @@
foo("foo");
foo("foo\nlol");
foo("foo\n\"lol");
foo("foo\n\"'lol");

View File

@@ -0,0 +1,4 @@
foo("foo");
foo("foo\nlol");
foo("foo\n\"lol");
foo("foo\n\"'lol");

View File

@@ -0,0 +1,4 @@
foo('foo');
foo('foo\nlol');
foo('foo\n"lol');
foo('foo\n"\'lol');

View File

@@ -0,0 +1,4 @@
foo('foo');
foo('foo\nlol');
foo('foo\n"lol');
foo('foo\n"\'lol');

View File

@@ -3,13 +3,13 @@ function somethingAdvanced({topLeft: {x: x1, y: y1}, bottomRight: {x: x2, y: y2}
}
function unpackObject({title: title, author: author}) {
return title + ' ' + author;
return title + " " + author;
}
console.log(unpackObject({title: 'title', author: 'author'}));
console.log(unpackObject({title: "title", author: "author"}));
var unpackArray = function ([a, b, c], [x, y, z]) {
return a+b+c;
};
console.log(unpackArray(['hello', ', ', 'world'], [1, 2, 3]));
console.log(unpackArray(["hello", ", ", "world"], [1, 2, 3]));

View File

@@ -1,4 +1,4 @@
const A = 'a';
const A = "a";
const o = {
A // comment
};

View File

@@ -1,2 +1,2 @@
var string = 'foo💩bar';
var string = "foo💩bar";
var match = string.match(/foo(.)bar/u);

View File

@@ -1,2 +1,2 @@
var string = 'foo💩bar';
var string = "foo💩bar";
var match = string.match(/foo(.)bar/);

View File

@@ -1,7 +1,7 @@
var x =
<div>
foo
{'bar'}
{"bar"}
baz
<div>
buz