Skip to content

Commit

Permalink
Merge pull request #92 from imagentleman/patch-1
Browse files Browse the repository at this point in the history
Update core.js import regex
  • Loading branch information
GianlucaGuarini committed Nov 16, 2016
2 parents 99cba19 + 9fe85fa commit 64ed801
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 32 deletions.
2 changes: 1 addition & 1 deletion src/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ var SPEC_TYPES = /^"(?:number|date(?:time)?|time|month|email|color)\b/i
* Matches the 'import' statement
* @const {RegExp}
*/
var IMPORT_STATEMENT = /^\s*import(?:(\s|\S)*)['|"]/gm
var IMPORT_STATEMENT = /^\s*import(?:(?:\s|[^\s'"])*)['|"].*\n?/gm

/**
* Matches trailing spaces and tabs by line.
Expand Down
2 changes: 1 addition & 1 deletion test/specs/expect/es6-import-untagged.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import* as foo from 'doe'
import 'bar'
import 'bar'
riot.tag2('import-untagged', '<h1>Hello</h1>', '', '', function(opts) {
});
30 changes: 15 additions & 15 deletions test/specs/expect/es6-import.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
import john from 'doe'
import foo from 'bar'
import { foo, bar, baz } from 'foo.bar.baz'
import {
foo,
bar,
baz
} from 'foo.bar.baz'
import {
foo,
bar,
baz } from 'foo.bar.baz'
import foo from 'bar'
import { foo, bar, baz } from 'foo.bar.baz'
import {
foo,
bar,
baz
} from 'foo.bar.baz'
import {
foo,
bar,
baz } from 'foo.bar.baz'

import { foo,
bar,
baz } from 'foo.bar.baz'
import { foo,
bar,
baz } from 'foo.bar.baz'
riot.tag2('import', '<h1>Hello</h1>', '', '', function(opts) {


this.time = function(){
return Date()
}.bind(this)

});
});
30 changes: 15 additions & 15 deletions test/specs/fixtures/es6-import.tag
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@
<h1>Hello</h1>

<script>
import john from 'doe'
import foo from 'bar'
import { foo, bar, baz } from 'foo.bar.baz'
import {
foo,
bar,
baz
} from 'foo.bar.baz'
import {
foo,
bar,
baz } from 'foo.bar.baz'
import john from 'doe'
import foo from 'bar'
import { foo, bar, baz } from 'foo.bar.baz'
import {
foo,
bar,
baz
} from 'foo.bar.baz'
import {
foo,
bar,
baz } from 'foo.bar.baz'

import { foo,
bar,
baz } from 'foo.bar.baz'
import { foo,
bar,
baz } from 'foo.bar.baz'

time(){
return Date()
Expand Down

0 comments on commit 64ed801

Please sign in to comment.