forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request rust-lang#3189 from scampi/issue3032
fix logic for adding or not a newline after a missed span
- Loading branch information
Showing
3 changed files
with
46 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
pub fn get_array_index_from_id(_cx: *mut JSContext, id: HandleId) -> Option<u32> { | ||
let raw_id = id.into(); | ||
unsafe { | ||
if RUST_JSID_IS_INT(raw_id) { | ||
return Some(RUST_JSID_TO_INT(raw_id) as u32); | ||
} | ||
None | ||
} | ||
// if id is length atom, -1, otherwise | ||
/*return if JSID_IS_ATOM(id) { | ||
let atom = JSID_TO_ATOM(id); | ||
//let s = *GetAtomChars(id); | ||
if s > 'a' && s < 'z' { | ||
return -1; | ||
} | ||
let i = 0; | ||
let str = AtomToLinearString(JSID_TO_ATOM(id)); | ||
return if StringIsArray(str, &mut i) != 0 { i } else { -1 } | ||
} else { | ||
IdToInt32(cx, id); | ||
}*/ | ||
} | ||
|
||
impl Foo { | ||
fn bar() -> usize { | ||
42 | ||
/* a block comment */ | ||
} | ||
|
||
fn baz() -> usize { | ||
42 | ||
// this is a line | ||
/* a block comment */ | ||
} | ||
} |