id stringlengths 34 124 | type stringclasses 4
values | prompt stringlengths 0 4.95k | response stringlengths 21 4.89k | source_lang stringclasses 3
values | target_lang stringclasses 2
values | repo stringclasses 75
values | path stringlengths 10 88 | license stringclasses 1
value | commit stringlengths 40 40 | stars int64 431 18.7k | source_url stringlengths 86 176 | line_start int64 1 214 | line_end int64 3 253 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ichord/At.js:spec/javascripts/content_editable.spec.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
describe "content editable", ->
$inputor = null
app = null
beforeEach ->
loadFixtures "inputors.html"
$inputor = $("#editable").atwho(at: "@", data: ["Jobs"])
app = getAppOf $inputor
it "can insert content", ->
triggerAtwhoAt $inputor
expect($inpu... | describe("content editable", function() {
var $inputor, app;
$inputor = null;
app = null;
beforeEach(function() {
loadFixtures("inputors.html");
$inputor = $("#editable").atwho({
at: "@",
data: ["Jobs"]
});
return app = getAppOf($inputor);
});
it("can insert content", function() ... | CoffeeScript | JavaScript | ichord/At.js | spec/javascripts/content_editable.spec.coffee | MIT | c084f8afce9a723d5a0556e0b1173484518fc33a | 5,250 | https://github.com/ichord/At.js/blob/c084f8afce9a723d5a0556e0b1173484518fc33a/spec/javascripts/content_editable.spec.coffee | 1 | 18 |
ichord/At.js:spec/javascripts/content_editable.spec.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
describe("content editable", function() {
var $inputor, app;
$inputor = null;
app = null;
beforeEach(function() {
loadFixtures("inputors.html");
$inputor = $("#editable").atwho({
at: "@",
data: ["Jobs"]
});
return app = getAppOf(... | describe "content editable", ->
$inputor = null
app = null
beforeEach ->
loadFixtures "inputors.html"
$inputor = $("#editable").atwho(at: "@", data: ["Jobs"])
app = getAppOf $inputor
it "can insert content", ->
triggerAtwhoAt $inputor
expect($inputor.text()).toContain('@Jobs')
it "insert by click", ->... | JavaScript | CoffeeScript | ichord/At.js | spec/javascripts/content_editable.spec.coffee | MIT | c084f8afce9a723d5a0556e0b1173484518fc33a | 5,250 | https://github.com/ichord/At.js/blob/c084f8afce9a723d5a0556e0b1173484518fc33a/spec/javascripts/content_editable.spec.coffee | 1 | 18 |
ichord/At.js:spec/javascripts/content_editable.spec.coffee:1:completion | completion | describe "content editable", ->
$inputor = null
app = null
beforeEach ->
loadFixtures "inputors.html"
$inputor = $("#editable").atwho(at: "@", data: ["Jobs"])
app = getAppOf $inputor | it "can insert content", ->
triggerAtwhoAt $inputor
expect($inputor.text()).toContain('@Jobs')
it "insert by click", ->
simulateTypingIn $inputor
$inputor.blur()
app.controller().view.$el.find('ul').children().first().trigger('click')
expect($inputor.text()).toContain('@Jobs') | CoffeeScript | CoffeeScript | ichord/At.js | spec/javascripts/content_editable.spec.coffee | MIT | c084f8afce9a723d5a0556e0b1173484518fc33a | 5,250 | https://github.com/ichord/At.js/blob/c084f8afce9a723d5a0556e0b1173484518fc33a/spec/javascripts/content_editable.spec.coffee | 1 | 18 |
ichord/At.js:spec/javascripts/content_editable.spec.coffee:1:raw_corpus | raw_corpus | describe "content editable", ->
$inputor = null
app = null
beforeEach ->
loadFixtures "inputors.html"
$inputor = $("#editable").atwho(at: "@", data: ["Jobs"])
app = getAppOf $inputor
it "can insert content", ->
triggerAtwhoAt $inputor
expect($inputor.text()).toContain('@Jobs')
it "insert by click", ->... | CoffeeScript | ichord/At.js | spec/javascripts/content_editable.spec.coffee | MIT | e028042d0045d491b94bc51ecbb8462ac71ff902 | 5,250 | https://github.com/ichord/At.js/blob/e028042d0045d491b94bc51ecbb8462ac71ff902/spec/javascripts/content_editable.spec.coffee | 1 | 17 | ||
ichord/At.js:spec/javascripts/content_editable.spec.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
describe "content editable", ->
$inputor = null
app = null
beforeEach ->
loadFixtures "inputors.html"
$inputor = $("#editable").atwho(at: "@", data: ["Jobs"])
app = getAppOf $inputor
it "can insert content", ->
triggerAtwhoAt $inputor
expect($inpu... | describe("content editable", function() {
var $inputor, app;
$inputor = null;
app = null;
beforeEach(function() {
loadFixtures("inputors.html");
$inputor = $("#editable").atwho({
at: "@",
data: ["Jobs"]
});
return app = getAppOf($inputor);
});
it("can insert content", function() ... | CoffeeScript | JavaScript | ichord/At.js | spec/javascripts/content_editable.spec.coffee | MIT | e028042d0045d491b94bc51ecbb8462ac71ff902 | 5,250 | https://github.com/ichord/At.js/blob/e028042d0045d491b94bc51ecbb8462ac71ff902/spec/javascripts/content_editable.spec.coffee | 1 | 17 |
ichord/At.js:spec/javascripts/content_editable.spec.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
describe("content editable", function() {
var $inputor, app;
$inputor = null;
app = null;
beforeEach(function() {
loadFixtures("inputors.html");
$inputor = $("#editable").atwho({
at: "@",
data: ["Jobs"]
});
return app = getAppOf(... | describe "content editable", ->
$inputor = null
app = null
beforeEach ->
loadFixtures "inputors.html"
$inputor = $("#editable").atwho(at: "@", data: ["Jobs"])
app = getAppOf $inputor
it "can insert content", ->
triggerAtwhoAt $inputor
expect($inputor.text()).toContain('@Jobs')
it "insert by click", ->... | JavaScript | CoffeeScript | ichord/At.js | spec/javascripts/content_editable.spec.coffee | MIT | e028042d0045d491b94bc51ecbb8462ac71ff902 | 5,250 | https://github.com/ichord/At.js/blob/e028042d0045d491b94bc51ecbb8462ac71ff902/spec/javascripts/content_editable.spec.coffee | 1 | 17 |
ichord/At.js:spec/javascripts/content_editable.spec.coffee:1:completion | completion | describe "content editable", ->
$inputor = null
app = null
beforeEach ->
loadFixtures "inputors.html"
$inputor = $("#editable").atwho(at: "@", data: ["Jobs"])
app = getAppOf $inputor | it "can insert content", ->
triggerAtwhoAt $inputor
expect($inputor.text()).toContain('@Jobs')
it "insert by click", ->
simulateTypingIn $inputor
app.controller().view.$el.find('ul').children().first().trigger('click')
expect($inputor.text()).toContain('@Jobs') | CoffeeScript | CoffeeScript | ichord/At.js | spec/javascripts/content_editable.spec.coffee | MIT | e028042d0045d491b94bc51ecbb8462ac71ff902 | 5,250 | https://github.com/ichord/At.js/blob/e028042d0045d491b94bc51ecbb8462ac71ff902/spec/javascripts/content_editable.spec.coffee | 1 | 17 |
jsdf/coffee-react-transform:demo.coffee:1:raw_corpus | raw_corpus | {Parser, serialise} = require './csx'
start = new Date()
ast = new Parser().parse '''
<Car doors=4 safety={getSafetyRating()*2} crackedWindscreen = "yep" insurance={ insurancehas() ? 'cool': 'ahh noooo'} data-yolo='swag\\' checked check=me_out />
'''
"""
# @jsx React.DOM
<Person name={window.isLoggedIn ? window.nam... | CoffeeScript | jsdf/coffee-react-transform | demo.coffee | MIT | aea1be00b515d4aa13653c13ccd2658fc56445fb | 431 | https://github.com/jsdf/coffee-react-transform/blob/aea1be00b515d4aa13653c13ccd2658fc56445fb/demo.coffee | 1 | 50 | ||
jsdf/coffee-react-transform:demo.coffee:1:completion | completion | {Parser, serialise} = require './csx'
start = new Date()
ast = new Parser().parse '''
<Car doors=4 safety={getSafetyRating()*2} crackedWindscreen = "yep" insurance={ insurancehas() ? 'cool': 'ahh noooo'} data-yolo='swag\\' checked check=me_out />
'''
"""
# @jsx React.DOM
<Person name={window.isLoggedIn ? window.nam... | asf
<li xy={"as"}>{ n+1 }<a /> <a /> </li>
</div>
}
</Person>
<Person name={window.isLoggedIn ? window.name : \'\'}
loltags='on new line' />
HelloWorld = React.createClass({
render: () ->
return (
<p>
Hello, <input type="text" placeholder="Your name here" />!
It is {this.props.d... | CoffeeScript | CoffeeScript | jsdf/coffee-react-transform | demo.coffee | MIT | aea1be00b515d4aa13653c13ccd2658fc56445fb | 431 | https://github.com/jsdf/coffee-react-transform/blob/aea1be00b515d4aa13653c13ccd2658fc56445fb/demo.coffee | 1 | 50 |
jsdf/coffee-react-transform:demo.coffee:2:raw_corpus | raw_corpus | , 500);
React.createClass
render: ->
return <Nav color="blue">
{<Profile>click{Math.random(),<Selfclosing coolattr />}</Profile> for i in [start...finish]}
</Nav>
"""
console.log 'AST:'
console.log JSON.stringify(ast, null, 4)
console.log 'Transformed CSX:'
console.log serialise ast
end = new Date()... | CoffeeScript | jsdf/coffee-react-transform | demo.coffee | MIT | aea1be00b515d4aa13653c13ccd2658fc56445fb | 431 | https://github.com/jsdf/coffee-react-transform/blob/aea1be00b515d4aa13653c13ccd2658fc56445fb/demo.coffee | 51 | 68 | ||
jsdf/coffee-react-transform:demo.coffee:2:completion | completion | , 500);
React.createClass
render: ->
return <Nav color="blue">
{<Profile>click{Math.random(),<Selfclosing coolattr />}</Profile> for i in [start...finish]}
</Nav> | """
console.log 'AST:'
console.log JSON.stringify(ast, null, 4)
console.log 'Transformed CSX:'
console.log serialise ast
end = new Date()
console.log "done in #{end - start}ms" | CoffeeScript | CoffeeScript | jsdf/coffee-react-transform | demo.coffee | MIT | aea1be00b515d4aa13653c13ccd2658fc56445fb | 431 | https://github.com/jsdf/coffee-react-transform/blob/aea1be00b515d4aa13653c13ccd2658fc56445fb/demo.coffee | 51 | 68 |
jianliaoim/talk-os:talk-web/client/app/team-overview.coffee:1:raw_corpus | raw_corpus | module.exports = React.createClass
displayName: 'team-overview'
propTypes:
team: React.PropTypes.instanceOf(Immutable.Map).isRequired
user: React.PropTypes.instanceOf(Immutable.Map).isRequired
teams: React.PropTypes.instanceOf(Immutable.Map).isRequired
activities: React.PropTypes.instanceOf(Immutab... | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/team-overview.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/team-overview.coffee | 21 | 70 | ||
jianliaoim/talk-os:talk-web/client/app/team-overview.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
module.exports = React.createClass
displayName: 'team-overview'
propTypes:
team: React.PropTypes.instanceOf(Immutable.Map).isRequired
user: React.PropTypes.instanceOf(Immutable.Map).isRequired
teams: React.PropTypes.instanceOf(Immutable.Map).isRe... | module.exports = React.createClass({
displayName: 'team-overview',
propTypes: {
team: React.PropTypes.instanceOf(Immutable.Map).isRequired,
user: React.PropTypes.instanceOf(Immutable.Map).isRequired,
teams: React.PropTypes.instanceOf(Immutable.Map).isRequired,
activities: React.PropTypes.instanceOf(... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/app/team-overview.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/team-overview.coffee | 21 | 70 |
jianliaoim/talk-os:talk-web/client/app/team-overview.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
module.exports = React.createClass({
displayName: 'team-overview',
propTypes: {
team: React.PropTypes.instanceOf(Immutable.Map).isRequired,
user: React.PropTypes.instanceOf(Immutable.Map).isRequired,
teams: React.PropTypes.instanceOf(Immutable.Map).... | module.exports = React.createClass
displayName: 'team-overview'
propTypes:
team: React.PropTypes.instanceOf(Immutable.Map).isRequired
user: React.PropTypes.instanceOf(Immutable.Map).isRequired
teams: React.PropTypes.instanceOf(Immutable.Map).isRequired
activities: React.PropTypes.instanceOf(Immutab... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/team-overview.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/team-overview.coffee | 21 | 70 |
jianliaoim/talk-os:talk-web/client/app/team-overview.coffee:1:completion | completion | module.exports = React.createClass
displayName: 'team-overview'
propTypes:
team: React.PropTypes.instanceOf(Immutable.Map).isRequired
user: React.PropTypes.instanceOf(Immutable.Map).isRequired
teams: React.PropTypes.instanceOf(Immutable.Map).isRequired
activities: React.PropTypes.instanceOf(Immutab... | requestMoreActivities: ->
_maxId = find.minId(@props.activities)
actions.activities.get @props.team.get('_id'), _maxId, (resp) =>
if resp.length is 0
@setState hasMore: false
# events
onGlobalScroll: (event) ->
if @state.hasMore
if (@rootEl.clientHeight + @rootEl.scrollTop + 20) > ... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/team-overview.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/team-overview.coffee | 21 | 70 |
jianliaoim/talk-os:talk-web/client/app/team-overview.coffee:2:raw_corpus | raw_corpus | team: @props.team
teams: @props.teams
router: @props.router
TeamToolbar
_teamId: _teamId
user: @props.user
router: @props.router
render: ->
div className: 'team-overview', ref: 'root',
div className: 'team-content-wrapper',
div className: 'team-content'... | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/team-overview.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/team-overview.coffee | 71 | 98 | ||
jianliaoim/talk-os:talk-web/client/app/team-overview.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
team: @props.team
teams: @props.teams
router: @props.router
TeamToolbar
_teamId: _teamId
user: @props.user
router: @props.router
render: ->
div className: 'team-overview', ref: 'root',
div className: 'tea... | ({
team: this.props.team({
teams: this.props.teams,
router: this.props.router
})
});
TeamToolbar({
_teamId: _teamId,
user: this.props.user,
router: this.props.router
});
({
render: function() {
return div({
className: 'team-overview',
ref: 'root'
}, div({
className: 'team... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-web/client/app/team-overview.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/team-overview.coffee | 71 | 98 |
jianliaoim/talk-os:talk-web/client/app/team-overview.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
({
team: this.props.team({
teams: this.props.teams,
router: this.props.router
})
});
TeamToolbar({
_teamId: _teamId,
user: this.props.user,
router: this.props.router
});
({
render: function() {
return div({
className: 'team-overview'... | team: @props.team
teams: @props.teams
router: @props.router
TeamToolbar
_teamId: _teamId
user: @props.user
router: @props.router
render: ->
div className: 'team-overview', ref: 'root',
div className: 'team-content-wrapper',
div className: 'team-content'... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/team-overview.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/team-overview.coffee | 71 | 98 |
jianliaoim/talk-os:talk-web/client/app/team-overview.coffee:2:completion | completion | team: @props.team
teams: @props.teams
router: @props.router
TeamToolbar
_teamId: _teamId
user: @props.user
router: @props.router
render: ->
div className: 'team-overview', ref: 'root',
div className: 'team-content-wrapper',
div className: 'team-content'... | lang.getText('team-lastest-activities')
@props.activities.map (activity) =>
TeamActivity team: @props.team, activity: activity, key: activity.get('_id'), showRemove: @props.isAdmin
Space height: 40
div className: 'overview-loading',
if @props.activities.si... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-web/client/app/team-overview.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-web/client/app/team-overview.coffee | 71 | 98 |
jianliaoim/talk-os:talk-api2x/mshells/cleanup-repeat-client-id.coffee:1:raw_corpus | raw_corpus | devicetokens = db.devicetokens.find().sort({updatedAt: -1})
dtMap = {}
tokenMap = {}
removeCount = 0
devicetokens.forEach (dt) ->
key = "#{dt.user}#{dt.type}#{dt.clientId}"
if dtMap[key] or tokenMap[dt.token] or not dt.clientId
print "Remove", JSON.stringify(dt)
removeCount += 1
db.devicetokens.remov... | CoffeeScript | jianliaoim/talk-os | talk-api2x/mshells/cleanup-repeat-client-id.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/mshells/cleanup-repeat-client-id.coffee | 1 | 19 | ||
jianliaoim/talk-os:talk-api2x/mshells/cleanup-repeat-client-id.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
devicetokens = db.devicetokens.find().sort({updatedAt: -1})
dtMap = {}
tokenMap = {}
removeCount = 0
devicetokens.forEach (dt) ->
key = "#{dt.user}#{dt.type}#{dt.clientId}"
if dtMap[key] or tokenMap[dt.token] or not dt.clientId
print "Remove", JSON.str... | var devicetokens, dtMap, removeCount, tokenMap;
devicetokens = db.devicetokens.find().sort({
updatedAt: -1
});
dtMap = {};
tokenMap = {};
removeCount = 0;
devicetokens.forEach(function(dt) {
var key;
key = `${dt.user}${dt.type}${dt.clientId}`;
if (dtMap[key] || tokenMap[dt.token] || !dt.clientId) {
pri... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-api2x/mshells/cleanup-repeat-client-id.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/mshells/cleanup-repeat-client-id.coffee | 1 | 19 |
jianliaoim/talk-os:talk-api2x/mshells/cleanup-repeat-client-id.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var devicetokens, dtMap, removeCount, tokenMap;
devicetokens = db.devicetokens.find().sort({
updatedAt: -1
});
dtMap = {};
tokenMap = {};
removeCount = 0;
devicetokens.forEach(function(dt) {
var key;
key = `${dt.user}${dt.type}${dt.clientId}`;
if (dtMa... | devicetokens = db.devicetokens.find().sort({updatedAt: -1})
dtMap = {}
tokenMap = {}
removeCount = 0
devicetokens.forEach (dt) ->
key = "#{dt.user}#{dt.type}#{dt.clientId}"
if dtMap[key] or tokenMap[dt.token] or not dt.clientId
print "Remove", JSON.stringify(dt)
removeCount += 1
db.devicetokens.remov... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/mshells/cleanup-repeat-client-id.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/mshells/cleanup-repeat-client-id.coffee | 1 | 19 |
jianliaoim/talk-os:talk-api2x/mshells/cleanup-repeat-client-id.coffee:1:completion | completion | devicetokens = db.devicetokens.find().sort({updatedAt: -1})
dtMap = {}
tokenMap = {}
removeCount = 0
devicetokens.forEach (dt) ->
key = "#{dt.user}#{dt.type}#{dt.clientId}" | if dtMap[key] or tokenMap[dt.token] or not dt.clientId
print "Remove", JSON.stringify(dt)
removeCount += 1
db.devicetokens.remove({_id: dt._id})
else
# Log key index
dtMap[key] = dt._id
tokenMap[dt.token] = dt._id
print "Removed count", removeCount | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/mshells/cleanup-repeat-client-id.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/mshells/cleanup-repeat-client-id.coffee | 1 | 19 |
elving/swag:test/numbers_test.coffee:1:raw_corpus | raw_corpus | require 'should'
Handlebars = require 'handlebars'
Swag = require '../lib/swag'
Swag.registerHelpers Handlebars
describe 'toFixed', ->
describe '{{toFixed value}}', ->
it 'should return the value rounded to the nearest integer.', ->
source = '{{toFixed value}}'
template = Handle... | CoffeeScript | elving/swag | test/numbers_test.coffee | MIT | e9c8788dfc9f640038c00eaafe33f4137ff5f465 | 675 | https://github.com/elving/swag/blob/e9c8788dfc9f640038c00eaafe33f4137ff5f465/test/numbers_test.coffee | 1 | 40 | ||
elving/swag:test/numbers_test.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
require 'should'
Handlebars = require 'handlebars'
Swag = require '../lib/swag'
Swag.registerHelpers Handlebars
describe 'toFixed', ->
describe '{{toFixed value}}', ->
it 'should return the value rounded to the nearest integer.', ->
sou... | var Handlebars, Swag;
require('should');
Handlebars = require('handlebars');
Swag = require('../lib/swag');
Swag.registerHelpers(Handlebars);
describe('toFixed', function() {
describe('{{toFixed value}}', function() {
return it('should return the value rounded to the nearest integer.', function() {
var... | CoffeeScript | JavaScript | elving/swag | test/numbers_test.coffee | MIT | e9c8788dfc9f640038c00eaafe33f4137ff5f465 | 675 | https://github.com/elving/swag/blob/e9c8788dfc9f640038c00eaafe33f4137ff5f465/test/numbers_test.coffee | 1 | 40 |
elving/swag:test/numbers_test.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Handlebars, Swag;
require('should');
Handlebars = require('handlebars');
Swag = require('../lib/swag');
Swag.registerHelpers(Handlebars);
describe('toFixed', function() {
describe('{{toFixed value}}', function() {
return it('should return the value r... | require 'should'
Handlebars = require 'handlebars'
Swag = require '../lib/swag'
Swag.registerHelpers Handlebars
describe 'toFixed', ->
describe '{{toFixed value}}', ->
it 'should return the value rounded to the nearest integer.', ->
source = '{{toFixed value}}'
template = Handle... | JavaScript | CoffeeScript | elving/swag | test/numbers_test.coffee | MIT | e9c8788dfc9f640038c00eaafe33f4137ff5f465 | 675 | https://github.com/elving/swag/blob/e9c8788dfc9f640038c00eaafe33f4137ff5f465/test/numbers_test.coffee | 1 | 40 |
elving/swag:test/numbers_test.coffee:1:completion | completion | require 'should'
Handlebars = require 'handlebars'
Swag = require '../lib/swag'
Swag.registerHelpers Handlebars
describe 'toFixed', ->
describe '{{toFixed value}}', ->
it 'should return the value rounded to the nearest integer.', ->
source = '{{toFixed value}}'
template = Handle... | context = value: 5.53231
template(context).should.equal '5.532'
describe 'toPrecision', ->
describe '{{toPrecision value}}', ->
it 'Returns the number in fixed-point or exponential notation rounded to n significant digits.', ->
source = '{{toPrecision value}}'
templa... | CoffeeScript | CoffeeScript | elving/swag | test/numbers_test.coffee | MIT | e9c8788dfc9f640038c00eaafe33f4137ff5f465 | 675 | https://github.com/elving/swag/blob/e9c8788dfc9f640038c00eaafe33f4137ff5f465/test/numbers_test.coffee | 1 | 40 |
elving/swag:test/numbers_test.coffee:2:raw_corpus | raw_corpus | describe 'toExponential', ->
describe '{{toExponential value}}', ->
it 'should return the number in fixed-point or exponential notation rounded to n significant digits.', ->
source = '{{toExponential value}}'
template = Handlebars.compile(source)
context = value: 5
... | CoffeeScript | elving/swag | test/numbers_test.coffee | MIT | e9c8788dfc9f640038c00eaafe33f4137ff5f465 | 675 | https://github.com/elving/swag/blob/e9c8788dfc9f640038c00eaafe33f4137ff5f465/test/numbers_test.coffee | 42 | 82 | ||
elving/swag:test/numbers_test.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
describe 'toExponential', ->
describe '{{toExponential value}}', ->
it 'should return the number in fixed-point or exponential notation rounded to n significant digits.', ->
source = '{{toExponential value}}'
template = Handl... | describe('toExponential', function() {
describe('{{toExponential value}}', function() {
return it('should return the number in fixed-point or exponential notation rounded to n significant digits.', function() {
var context, source, template;
source = '{{toExponential value}}';
template = Handleb... | CoffeeScript | JavaScript | elving/swag | test/numbers_test.coffee | MIT | e9c8788dfc9f640038c00eaafe33f4137ff5f465 | 675 | https://github.com/elving/swag/blob/e9c8788dfc9f640038c00eaafe33f4137ff5f465/test/numbers_test.coffee | 42 | 82 |
elving/swag:test/numbers_test.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
describe('toExponential', function() {
describe('{{toExponential value}}', function() {
return it('should return the number in fixed-point or exponential notation rounded to n significant digits.', function() {
var context, source, template;
sourc... | describe 'toExponential', ->
describe '{{toExponential value}}', ->
it 'should return the number in fixed-point or exponential notation rounded to n significant digits.', ->
source = '{{toExponential value}}'
template = Handlebars.compile(source)
context = value: 5
... | JavaScript | CoffeeScript | elving/swag | test/numbers_test.coffee | MIT | e9c8788dfc9f640038c00eaafe33f4137ff5f465 | 675 | https://github.com/elving/swag/blob/e9c8788dfc9f640038c00eaafe33f4137ff5f465/test/numbers_test.coffee | 42 | 82 |
elving/swag:test/numbers_test.coffee:2:completion | completion | describe 'toExponential', ->
describe '{{toExponential value}}', ->
it 'should return the number in fixed-point or exponential notation rounded to n significant digits.', ->
source = '{{toExponential value}}'
template = Handlebars.compile(source)
context = value: 5
... | source = '{{toInt value}}'
template = Handlebars.compile(source)
context = value: '3cc'
template(context).should.equal '3'
describe 'toFloat', ->
describe '{{toFloat value}}', ->
it 'should return a floating point number.', ->
source = '{{toFloat value}... | CoffeeScript | CoffeeScript | elving/swag | test/numbers_test.coffee | MIT | e9c8788dfc9f640038c00eaafe33f4137ff5f465 | 675 | https://github.com/elving/swag/blob/e9c8788dfc9f640038c00eaafe33f4137ff5f465/test/numbers_test.coffee | 42 | 82 |
elving/swag:test/numbers_test.coffee:3:raw_corpus | raw_corpus | template(context).should.equal '2,222,222'
describe '{{digitGrouping value separator}}', ->
it 'should add custom separator to a number.', ->
source = '{{digitGrouping value "-"}}'
template = Handlebars.compile(source)
context = value: 2222222
template(co... | CoffeeScript | elving/swag | test/numbers_test.coffee | MIT | e9c8788dfc9f640038c00eaafe33f4137ff5f465 | 675 | https://github.com/elving/swag/blob/e9c8788dfc9f640038c00eaafe33f4137ff5f465/test/numbers_test.coffee | 84 | 92 | ||
elving/swag:test/numbers_test.coffee:3:completion | completion | template(context).should.equal '2,222,222'
describe '{{digitGrouping value separator}}', ->
it 'should add custom separator to a number.', -> | source = '{{digitGrouping value "-"}}'
template = Handlebars.compile(source)
context = value: 2222222
template(context).should.equal '2-222-222' | CoffeeScript | CoffeeScript | elving/swag | test/numbers_test.coffee | MIT | e9c8788dfc9f640038c00eaafe33f4137ff5f465 | 675 | https://github.com/elving/swag/blob/e9c8788dfc9f640038c00eaafe33f4137ff5f465/test/numbers_test.coffee | 84 | 92 |
elving/swag:test/numbers_test.coffee:1:raw_corpus | raw_corpus | require 'should'
Handlebars = require 'handlebars'
Swag = require '../lib/swag'
describe 'toFixed', ->
describe '{{toFixed value}}', ->
it 'should return the value rounded to the nearest integer.', ->
source = '{{toFixed value}}'
template = Handlebars.compile(source)
... | CoffeeScript | elving/swag | test/numbers_test.coffee | MIT | 860854078a9c2176b43dad49f71a5a782cab3fab | 675 | https://github.com/elving/swag/blob/860854078a9c2176b43dad49f71a5a782cab3fab/test/numbers_test.coffee | 1 | 45 | ||
elving/swag:test/numbers_test.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
require 'should'
Handlebars = require 'handlebars'
Swag = require '../lib/swag'
describe 'toFixed', ->
describe '{{toFixed value}}', ->
it 'should return the value rounded to the nearest integer.', ->
source = '{{toFixed value}}'
... | var Handlebars, Swag;
require('should');
Handlebars = require('handlebars');
Swag = require('../lib/swag');
describe('toFixed', function() {
describe('{{toFixed value}}', function() {
return it('should return the value rounded to the nearest integer.', function() {
var context, source, template;
s... | CoffeeScript | JavaScript | elving/swag | test/numbers_test.coffee | MIT | 860854078a9c2176b43dad49f71a5a782cab3fab | 675 | https://github.com/elving/swag/blob/860854078a9c2176b43dad49f71a5a782cab3fab/test/numbers_test.coffee | 1 | 45 |
elving/swag:test/numbers_test.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var Handlebars, Swag;
require('should');
Handlebars = require('handlebars');
Swag = require('../lib/swag');
describe('toFixed', function() {
describe('{{toFixed value}}', function() {
return it('should return the value rounded to the nearest integer.', fu... | require 'should'
Handlebars = require 'handlebars'
Swag = require '../lib/swag'
describe 'toFixed', ->
describe '{{toFixed value}}', ->
it 'should return the value rounded to the nearest integer.', ->
source = '{{toFixed value}}'
template = Handlebars.compile(source)
... | JavaScript | CoffeeScript | elving/swag | test/numbers_test.coffee | MIT | 860854078a9c2176b43dad49f71a5a782cab3fab | 675 | https://github.com/elving/swag/blob/860854078a9c2176b43dad49f71a5a782cab3fab/test/numbers_test.coffee | 1 | 45 |
elving/swag:test/numbers_test.coffee:1:completion | completion | require 'should'
Handlebars = require 'handlebars'
Swag = require '../lib/swag'
describe 'toFixed', ->
describe '{{toFixed value}}', ->
it 'should return the value rounded to the nearest integer.', ->
source = '{{toFixed value}}'
template = Handlebars.compile(source)
... | describe 'toPrecision', ->
describe '{{toPrecision value}}', ->
it 'Returns the number in fixed-point or exponential notation rounded to n significant digits.', ->
source = '{{toPrecision value}}'
template = Handlebars.compile(source)
context = value: 555.322
... | CoffeeScript | CoffeeScript | elving/swag | test/numbers_test.coffee | MIT | 860854078a9c2176b43dad49f71a5a782cab3fab | 675 | https://github.com/elving/swag/blob/860854078a9c2176b43dad49f71a5a782cab3fab/test/numbers_test.coffee | 1 | 45 |
elving/swag:test/numbers_test.coffee:2:raw_corpus | raw_corpus | template(context).should.equal '5e+0'
describe '{{toExponential value 5}}', ->
it 'should return the number in fixed-point or exponential notation rounded to exactly n significant digits.', ->
source = '{{toExponential value 5}}'
template = Handlebars.compile(source)
c... | CoffeeScript | elving/swag | test/numbers_test.coffee | MIT | 860854078a9c2176b43dad49f71a5a782cab3fab | 675 | https://github.com/elving/swag/blob/860854078a9c2176b43dad49f71a5a782cab3fab/test/numbers_test.coffee | 47 | 88 | ||
elving/swag:test/numbers_test.coffee:2:completion | completion | template(context).should.equal '5e+0'
describe '{{toExponential value 5}}', ->
it 'should return the number in fixed-point or exponential notation rounded to exactly n significant digits.', ->
source = '{{toExponential value 5}}'
template = Handlebars.compile(source)
c... | it 'should return a floating point number.', ->
source = '{{toFloat value}}'
template = Handlebars.compile(source)
context = value: '3.1cc'
template(context).should.equal '3.1'
describe 'digitGrouping', ->
describe '{{digitGrouping value}}', ->
it 'should... | CoffeeScript | CoffeeScript | elving/swag | test/numbers_test.coffee | MIT | 860854078a9c2176b43dad49f71a5a782cab3fab | 675 | https://github.com/elving/swag/blob/860854078a9c2176b43dad49f71a5a782cab3fab/test/numbers_test.coffee | 47 | 88 |
elving/swag:test/numbers_test.coffee:2:raw_corpus | raw_corpus | template(context).should.equal '5e+0'
describe '{{toExponential value 5}}', ->
it 'should return the number in fixed-point or exponential notation rounded to exactly n significant digits.', ->
source = '{{toExponential value 5}}'
template = Handlebars.compile(source)
c... | CoffeeScript | elving/swag | test/numbers_test.coffee | MIT | b691217045ff6f67119d54d3a9d346dca70d062a | 675 | https://github.com/elving/swag/blob/b691217045ff6f67119d54d3a9d346dca70d062a/test/numbers_test.coffee | 47 | 88 | ||
elving/swag:test/numbers_test.coffee:2:completion | completion | template(context).should.equal '5e+0'
describe '{{toExponential value 5}}', ->
it 'should return the number in fixed-point or exponential notation rounded to exactly n significant digits.', ->
source = '{{toExponential value 5}}'
template = Handlebars.compile(source)
c... | it 'should return a floating point number.', ->
source = '{{toFloat value}}'
template = Handlebars.compile(source)
context = value: '3.1cc'
template(context).should.equal '3.1'
describe 'digitGrouping', ->
describe '{{digitGrouping value}}', ->
it 'should... | CoffeeScript | CoffeeScript | elving/swag | test/numbers_test.coffee | MIT | b691217045ff6f67119d54d3a9d346dca70d062a | 675 | https://github.com/elving/swag/blob/b691217045ff6f67119d54d3a9d346dca70d062a/test/numbers_test.coffee | 47 | 88 |
elving/swag:test/numbers_test.coffee:2:raw_corpus | raw_corpus | template(context).should.equal '5e+0'
describe '{{toExponential value 5}}', ->
it 'should return the number in fixed-point or exponential notation rounded to exactly n significant digits.', ->
source = '{{toExponential value 5}}'
template = Handlebars.compile(source)
c... | CoffeeScript | elving/swag | test/numbers_test.coffee | MIT | ceecfbab2987ad991113cb7ce1daaec9811408ae | 675 | https://github.com/elving/swag/blob/ceecfbab2987ad991113cb7ce1daaec9811408ae/test/numbers_test.coffee | 47 | 82 | ||
elving/swag:test/numbers_test.coffee:2:completion | completion | template(context).should.equal '5e+0'
describe '{{toExponential value 5}}', ->
it 'should return the number in fixed-point or exponential notation rounded to exactly n significant digits.', ->
source = '{{toExponential value 5}}'
template = Handlebars.compile(source)
c... | describe 'toFloat', ->
describe '{{toFloat value}}', ->
it 'should return a floating point number.', ->
source = '{{toFloat value}}'
template = Handlebars.compile(source)
context = value: '3.1cc'
template(context).should.equal '3.1'
describe 'addCommas', ... | CoffeeScript | CoffeeScript | elving/swag | test/numbers_test.coffee | MIT | ceecfbab2987ad991113cb7ce1daaec9811408ae | 675 | https://github.com/elving/swag/blob/ceecfbab2987ad991113cb7ce1daaec9811408ae/test/numbers_test.coffee | 47 | 82 |
elving/swag:test/numbers_test.coffee:2:raw_corpus | raw_corpus | template(context).should.equal '5e+0'
describe '{{toExponential value 5}}', ->
it 'should return the number in fixed-point or exponential notation rounded to exactly n significant digits.', ->
source = '{{toExponential value 5}}'
template = Handlebars.compile(source)
c... | CoffeeScript | elving/swag | test/numbers_test.coffee | MIT | 5e45f8e30f1605c8b521997024c9a49806571fc8 | 675 | https://github.com/elving/swag/blob/5e45f8e30f1605c8b521997024c9a49806571fc8/test/numbers_test.coffee | 47 | 82 | ||
elving/swag:test/numbers_test.coffee:2:completion | completion | template(context).should.equal '5e+0'
describe '{{toExponential value 5}}', ->
it 'should return the number in fixed-point or exponential notation rounded to exactly n significant digits.', ->
source = '{{toExponential value 5}}'
template = Handlebars.compile(source)
c... | describe 'toFloat', ->
describe '{{toFloat value}}', ->
it 'should return a floating point number.', ->
source = '{{toFloat value}}'
template = Handlebars.compile(source)
context = value: '3.1cc'
template(context).should.equal 3.1
describe 'addCommas', ->... | CoffeeScript | CoffeeScript | elving/swag | test/numbers_test.coffee | MIT | 5e45f8e30f1605c8b521997024c9a49806571fc8 | 675 | https://github.com/elving/swag/blob/5e45f8e30f1605c8b521997024c9a49806571fc8/test/numbers_test.coffee | 47 | 82 |
jianliaoim/talk-os:talk-api2x/test/controllers/preference.coffee:1:raw_corpus | raw_corpus | should = require 'should'
async = require 'async'
limbo = require 'limbo'
db = limbo.use 'talk'
app = require '../app'
{prepare, clear, request} = app
describe 'Preference#ReadOne', ->
before prepare
it 'should preference of user1', (done) ->
options =
method: 'get'
url: 'preferences'
qs:
... | CoffeeScript | jianliaoim/talk-os | talk-api2x/test/controllers/preference.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/test/controllers/preference.coffee | 1 | 42 | ||
jianliaoim/talk-os:talk-api2x/test/controllers/preference.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
should = require 'should'
async = require 'async'
limbo = require 'limbo'
db = limbo.use 'talk'
app = require '../app'
{prepare, clear, request} = app
describe 'Preference#ReadOne', ->
before prepare
it 'should preference of user1', (done) ->
options ... | var app, async, clear, db, limbo, prepare, request, should;
should = require('should');
async = require('async');
limbo = require('limbo');
db = limbo.use('talk');
app = require('../app');
({prepare, clear, request} = app);
describe('Preference#ReadOne', function() {
before(prepare);
it('should preference of... | CoffeeScript | JavaScript | jianliaoim/talk-os | talk-api2x/test/controllers/preference.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/test/controllers/preference.coffee | 1 | 42 |
jianliaoim/talk-os:talk-api2x/test/controllers/preference.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var app, async, clear, db, limbo, prepare, request, should;
should = require('should');
async = require('async');
limbo = require('limbo');
db = limbo.use('talk');
app = require('../app');
({prepare, clear, request} = app);
describe('Preference#ReadOne', fun... | should = require 'should'
async = require 'async'
limbo = require 'limbo'
db = limbo.use 'talk'
app = require '../app'
{prepare, clear, request} = app
describe 'Preference#ReadOne', ->
before prepare
it 'should preference of user1', (done) ->
options =
method: 'get'
url: 'preferences'
qs:
... | JavaScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/test/controllers/preference.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/test/controllers/preference.coffee | 1 | 42 |
jianliaoim/talk-os:talk-api2x/test/controllers/preference.coffee:1:completion | completion | should = require 'should'
async = require 'async'
limbo = require 'limbo'
db = limbo.use 'talk'
app = require '../app'
{prepare, clear, request} = app
describe 'Preference#ReadOne', ->
before prepare
it 'should preference of user1', (done) ->
options =
method: 'get'
url: 'preferences'
qs:
... | after clear
describe 'Preference#Update', ->
before prepare
it 'should update preference of user1', (done) ->
options =
method: 'put'
url: 'preferences'
body: JSON.stringify
_sessionUserId: app.user1._id
desktopNotification: true
displayMode: 'slim'
request optio... | CoffeeScript | CoffeeScript | jianliaoim/talk-os | talk-api2x/test/controllers/preference.coffee | MIT | 2545c4497865779a55762e03963a39237df9046b | 2,703 | https://github.com/jianliaoim/talk-os/blob/2545c4497865779a55762e03963a39237df9046b/talk-api2x/test/controllers/preference.coffee | 1 | 42 |
soulwire/Coffee-Physics:source/behaviour/Attraction.coffee:1:raw_corpus | raw_corpus | ### Attraction Behaviour ###
class Attraction extends Behaviour
constructor: (@target = new Vector(), @radius = 1000, @strength = 100.0) ->
@_delta = new Vector()
@setRadius @radius
super
### Sets the effective radius of the bahavious. ###
setRadius: (radius) ->
@radius... | CoffeeScript | soulwire/Coffee-Physics | source/behaviour/Attraction.coffee | MIT | df9d43d3153dfc6a734fef1b24eb5a90c2c61e4d | 1,053 | https://github.com/soulwire/Coffee-Physics/blob/df9d43d3153dfc6a734fef1b24eb5a90c2c61e4d/source/behaviour/Attraction.coffee | 1 | 35 | ||
soulwire/Coffee-Physics:source/behaviour/Attraction.coffee:1:completion | completion | ### Attraction Behaviour ###
class Attraction extends Behaviour
constructor: (@target = new Vector(), @radius = 1000, @strength = 100.0) ->
@_delta = new Vector()
@setRadius @radius
super
### Sets the effective radius of the bahavious. ###
setRadius: (radius) ->
@radius... | apply: (p, dt, index) ->
#super p, dt, index
# Vector pointing from particle to target.
(@_delta.copy @target).sub p.pos
# Squared distance to target.
distSq = @_delta.magSq()
# Limit force to behaviour radius.
if distSq < @radiusSq and distSq > 0.000001
... | CoffeeScript | CoffeeScript | soulwire/Coffee-Physics | source/behaviour/Attraction.coffee | MIT | df9d43d3153dfc6a734fef1b24eb5a90c2c61e4d | 1,053 | https://github.com/soulwire/Coffee-Physics/blob/df9d43d3153dfc6a734fef1b24eb5a90c2c61e4d/source/behaviour/Attraction.coffee | 1 | 35 |
mattinsler/longjohn:lib/longjohn.coffee:1:raw_corpus | raw_corpus | format_location = (frame) ->
return 'native' if frame.isNative()
return 'eval at ' + frame.getEvalOrigin() if frame.isEval()
file = frame.getFileName()
file = frame.getFileName() || '<anonymous>'
line = frame.getLineNumber()
column = frame.getColumnNumber()
column = if column? then ':' + column else ''
... | CoffeeScript | mattinsler/longjohn | lib/longjohn.coffee | MIT | 01f30ac186f5f617e2d342d81299e9188494b066 | 841 | https://github.com/mattinsler/longjohn/blob/01f30ac186f5f617e2d342d81299e9188494b066/lib/longjohn.coffee | 9 | 21 | ||
mattinsler/longjohn:lib/longjohn.coffee:1:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
format_location = (frame) ->
return 'native' if frame.isNative()
return 'eval at ' + frame.getEvalOrigin() if frame.isEval()
file = frame.getFileName()
file = frame.getFileName() || '<anonymous>'
line = frame.getLineNumber()
column = frame.getColumnN... | var format_location;
format_location = function(frame) {
var column, file, line;
if (frame.isNative()) {
return 'native';
}
if (frame.isEval()) {
return 'eval at ' + frame.getEvalOrigin();
}
file = frame.getFileName();
file = frame.getFileName() || '<anonymous>';
line = frame.getLineNumber();
... | CoffeeScript | JavaScript | mattinsler/longjohn | lib/longjohn.coffee | MIT | 01f30ac186f5f617e2d342d81299e9188494b066 | 841 | https://github.com/mattinsler/longjohn/blob/01f30ac186f5f617e2d342d81299e9188494b066/lib/longjohn.coffee | 9 | 21 |
mattinsler/longjohn:lib/longjohn.coffee:1:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var format_location;
format_location = function(frame) {
var column, file, line;
if (frame.isNative()) {
return 'native';
}
if (frame.isEval()) {
return 'eval at ' + frame.getEvalOrigin();
}
file = frame.getFileName();
file = frame.getFileNam... | format_location = (frame) ->
return 'native' if frame.isNative()
return 'eval at ' + frame.getEvalOrigin() if frame.isEval()
file = frame.getFileName()
file = frame.getFileName() || '<anonymous>'
line = frame.getLineNumber()
column = frame.getColumnNumber()
column = if column? then ':' + column else ''
... | JavaScript | CoffeeScript | mattinsler/longjohn | lib/longjohn.coffee | MIT | 01f30ac186f5f617e2d342d81299e9188494b066 | 841 | https://github.com/mattinsler/longjohn/blob/01f30ac186f5f617e2d342d81299e9188494b066/lib/longjohn.coffee | 9 | 21 |
mattinsler/longjohn:lib/longjohn.coffee:1:completion | completion | format_location = (frame) ->
return 'native' if frame.isNative()
return 'eval at ' + frame.getEvalOrigin() if frame.isEval()
file = frame.getFileName()
file = frame.getFileName() || '<anonymous>' | line = frame.getLineNumber()
column = frame.getColumnNumber()
column = if column? then ':' + column else ''
line = if line? then ':' + line else ''
file + line + column | CoffeeScript | CoffeeScript | mattinsler/longjohn | lib/longjohn.coffee | MIT | 01f30ac186f5f617e2d342d81299e9188494b066 | 841 | https://github.com/mattinsler/longjohn/blob/01f30ac186f5f617e2d342d81299e9188494b066/lib/longjohn.coffee | 9 | 21 |
mattinsler/longjohn:lib/longjohn.coffee:2:raw_corpus | raw_corpus | format_method = (frame) ->
function_name = frame.getFunctionName()
unless frame.isToplevel() or frame.isConstructor()
method = frame.getMethodName()
type = frame.getTypeName()
return "#{type}.#{method ? '<anonymous>'}" unless function_name?
return "#{type}.#{function_name}" if method is function_na... | CoffeeScript | mattinsler/longjohn | lib/longjohn.coffee | MIT | 01f30ac186f5f617e2d342d81299e9188494b066 | 841 | https://github.com/mattinsler/longjohn/blob/01f30ac186f5f617e2d342d81299e9188494b066/lib/longjohn.coffee | 23 | 35 | ||
mattinsler/longjohn:lib/longjohn.coffee:2:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
format_method = (frame) ->
function_name = frame.getFunctionName()
unless frame.isToplevel() or frame.isConstructor()
method = frame.getMethodName()
type = frame.getTypeName()
return "#{type}.#{method ? '<anonymous>'}" unless function_name?
r... | var format_method;
format_method = function(frame) {
var function_name, method, type;
function_name = frame.getFunctionName();
if (!(frame.isToplevel() || frame.isConstructor())) {
method = frame.getMethodName();
type = frame.getTypeName();
if (function_name == null) {
return `${type}.${method ... | CoffeeScript | JavaScript | mattinsler/longjohn | lib/longjohn.coffee | MIT | 01f30ac186f5f617e2d342d81299e9188494b066 | 841 | https://github.com/mattinsler/longjohn/blob/01f30ac186f5f617e2d342d81299e9188494b066/lib/longjohn.coffee | 23 | 35 |
mattinsler/longjohn:lib/longjohn.coffee:2:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var format_method;
format_method = function(frame) {
var function_name, method, type;
function_name = frame.getFunctionName();
if (!(frame.isToplevel() || frame.isConstructor())) {
method = frame.getMethodName();
type = frame.getTypeName();
if (f... | format_method = (frame) ->
function_name = frame.getFunctionName()
unless frame.isToplevel() or frame.isConstructor()
method = frame.getMethodName()
type = frame.getTypeName()
return "#{type}.#{method ? '<anonymous>'}" unless function_name?
return "#{type}.#{function_name}" if method is function_na... | JavaScript | CoffeeScript | mattinsler/longjohn | lib/longjohn.coffee | MIT | 01f30ac186f5f617e2d342d81299e9188494b066 | 841 | https://github.com/mattinsler/longjohn/blob/01f30ac186f5f617e2d342d81299e9188494b066/lib/longjohn.coffee | 23 | 35 |
mattinsler/longjohn:lib/longjohn.coffee:2:completion | completion | format_method = (frame) ->
function_name = frame.getFunctionName()
unless frame.isToplevel() or frame.isConstructor()
method = frame.getMethodName()
type = frame.getTypeName() | return "#{type}.#{method ? '<anonymous>'}" unless function_name?
return "#{type}.#{function_name}" if method is function_name
"#{type}.#{function_name} [as #{method}]"
return "new #{function_name ? '<anonymous>'}" if frame.isConstructor()
return function_name if function_name?
null | CoffeeScript | CoffeeScript | mattinsler/longjohn | lib/longjohn.coffee | MIT | 01f30ac186f5f617e2d342d81299e9188494b066 | 841 | https://github.com/mattinsler/longjohn/blob/01f30ac186f5f617e2d342d81299e9188494b066/lib/longjohn.coffee | 23 | 35 |
mattinsler/longjohn:lib/longjohn.coffee:3:raw_corpus | raw_corpus | exports.format_stack_frame = (frame) ->
return exports.empty_frame if frame.getFileName() is exports.empty_frame
method = format_method(frame)
location = format_location(frame)
return " at #{location}" unless method?
" at #{method} (#{location})" | CoffeeScript | mattinsler/longjohn | lib/longjohn.coffee | MIT | 01f30ac186f5f617e2d342d81299e9188494b066 | 841 | https://github.com/mattinsler/longjohn/blob/01f30ac186f5f617e2d342d81299e9188494b066/lib/longjohn.coffee | 37 | 44 | ||
mattinsler/longjohn:lib/longjohn.coffee:3:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
exports.format_stack_frame = (frame) ->
return exports.empty_frame if frame.getFileName() is exports.empty_frame
method = format_method(frame)
location = format_location(frame)
return " at #{location}" unless method?
" at #{method} (#{location})... | exports.format_stack_frame = function(frame) {
var location, method;
if (frame.getFileName() === exports.empty_frame) {
return exports.empty_frame;
}
method = format_method(frame);
location = format_location(frame);
if (method == null) {
return ` at ${location}`;
}
return ` at ${method} ($... | CoffeeScript | JavaScript | mattinsler/longjohn | lib/longjohn.coffee | MIT | 01f30ac186f5f617e2d342d81299e9188494b066 | 841 | https://github.com/mattinsler/longjohn/blob/01f30ac186f5f617e2d342d81299e9188494b066/lib/longjohn.coffee | 37 | 44 |
mattinsler/longjohn:lib/longjohn.coffee:3:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
exports.format_stack_frame = function(frame) {
var location, method;
if (frame.getFileName() === exports.empty_frame) {
return exports.empty_frame;
}
method = format_method(frame);
location = format_location(frame);
if (method == null) {
return ... | exports.format_stack_frame = (frame) ->
return exports.empty_frame if frame.getFileName() is exports.empty_frame
method = format_method(frame)
location = format_location(frame)
return " at #{location}" unless method?
" at #{method} (#{location})" | JavaScript | CoffeeScript | mattinsler/longjohn | lib/longjohn.coffee | MIT | 01f30ac186f5f617e2d342d81299e9188494b066 | 841 | https://github.com/mattinsler/longjohn/blob/01f30ac186f5f617e2d342d81299e9188494b066/lib/longjohn.coffee | 37 | 44 |
mattinsler/longjohn:lib/longjohn.coffee:3:completion | completion | exports.format_stack_frame = (frame) ->
return exports.empty_frame if frame.getFileName() is exports.empty_frame
method = format_method(frame) | location = format_location(frame)
return " at #{location}" unless method?
" at #{method} (#{location})" | CoffeeScript | CoffeeScript | mattinsler/longjohn | lib/longjohn.coffee | MIT | 01f30ac186f5f617e2d342d81299e9188494b066 | 841 | https://github.com/mattinsler/longjohn/blob/01f30ac186f5f617e2d342d81299e9188494b066/lib/longjohn.coffee | 37 | 44 |
mattinsler/longjohn:lib/longjohn.coffee:4:raw_corpus | raw_corpus | exports.format_stack = (err, frames) ->
lines = []
try
lines.push(err.toString())
catch e
console.log 'Caught error in longjohn. Please report this to matt.insler@gmail.com.'
lines.push(frames.map(exports.format_stack_frame)...)
lines.join('\n') | CoffeeScript | mattinsler/longjohn | lib/longjohn.coffee | MIT | 01f30ac186f5f617e2d342d81299e9188494b066 | 841 | https://github.com/mattinsler/longjohn/blob/01f30ac186f5f617e2d342d81299e9188494b066/lib/longjohn.coffee | 46 | 53 | ||
mattinsler/longjohn:lib/longjohn.coffee:4:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
exports.format_stack = (err, frames) ->
lines = []
try
lines.push(err.toString())
catch e
console.log 'Caught error in longjohn. Please report this to matt.insler@gmail.com.'
lines.push(frames.map(exports.format_stack_frame)...)
lines.join('\n')... | exports.format_stack = function(err, frames) {
var e, lines;
lines = [];
try {
lines.push(err.toString());
} catch (error) {
e = error;
console.log('Caught error in longjohn. Please report this to matt.insler@gmail.com.');
}
lines.push(...frames.map(exports.format_stack_frame));
return lines.j... | CoffeeScript | JavaScript | mattinsler/longjohn | lib/longjohn.coffee | MIT | 01f30ac186f5f617e2d342d81299e9188494b066 | 841 | https://github.com/mattinsler/longjohn/blob/01f30ac186f5f617e2d342d81299e9188494b066/lib/longjohn.coffee | 46 | 53 |
mattinsler/longjohn:lib/longjohn.coffee:4:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
exports.format_stack = function(err, frames) {
var e, lines;
lines = [];
try {
lines.push(err.toString());
} catch (error) {
e = error;
console.log('Caught error in longjohn. Please report this to matt.insler@gmail.com.');
}
lines.push(...fr... | exports.format_stack = (err, frames) ->
lines = []
try
lines.push(err.toString())
catch e
console.log 'Caught error in longjohn. Please report this to matt.insler@gmail.com.'
lines.push(frames.map(exports.format_stack_frame)...)
lines.join('\n') | JavaScript | CoffeeScript | mattinsler/longjohn | lib/longjohn.coffee | MIT | 01f30ac186f5f617e2d342d81299e9188494b066 | 841 | https://github.com/mattinsler/longjohn/blob/01f30ac186f5f617e2d342d81299e9188494b066/lib/longjohn.coffee | 46 | 53 |
mattinsler/longjohn:lib/longjohn.coffee:4:completion | completion | exports.format_stack = (err, frames) ->
lines = []
try
lines.push(err.toString()) | catch e
console.log 'Caught error in longjohn. Please report this to matt.insler@gmail.com.'
lines.push(frames.map(exports.format_stack_frame)...)
lines.join('\n') | CoffeeScript | CoffeeScript | mattinsler/longjohn | lib/longjohn.coffee | MIT | 01f30ac186f5f617e2d342d81299e9188494b066 | 841 | https://github.com/mattinsler/longjohn/blob/01f30ac186f5f617e2d342d81299e9188494b066/lib/longjohn.coffee | 46 | 53 |
mattinsler/longjohn:lib/longjohn.coffee:5:raw_corpus | raw_corpus | create_callsite = (location) ->
Object.create {
getFileName: -> location
getLineNumber: -> null
getFunctionName: -> null
getTypeName: -> null
getMethodName: -> null
getColumnNumber: -> null
isNative: -> null
} | CoffeeScript | mattinsler/longjohn | lib/longjohn.coffee | MIT | 01f30ac186f5f617e2d342d81299e9188494b066 | 841 | https://github.com/mattinsler/longjohn/blob/01f30ac186f5f617e2d342d81299e9188494b066/lib/longjohn.coffee | 55 | 64 | ||
mattinsler/longjohn:lib/longjohn.coffee:5:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
create_callsite = (location) ->
Object.create {
getFileName: -> location
getLineNumber: -> null
getFunctionName: -> null
getTypeName: -> null
getMethodName: -> null
getColumnNumber: -> null
isNative: -> null
}
``` | var create_callsite;
create_callsite = function(location) {
return Object.create({
getFileName: function() {
return location;
},
getLineNumber: function() {
return null;
},
getFunctionName: function() {
return null;
},
getTypeName: function() {
return null;
},
... | CoffeeScript | JavaScript | mattinsler/longjohn | lib/longjohn.coffee | MIT | 01f30ac186f5f617e2d342d81299e9188494b066 | 841 | https://github.com/mattinsler/longjohn/blob/01f30ac186f5f617e2d342d81299e9188494b066/lib/longjohn.coffee | 55 | 64 |
mattinsler/longjohn:lib/longjohn.coffee:5:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var create_callsite;
create_callsite = function(location) {
return Object.create({
getFileName: function() {
return location;
},
getLineNumber: function() {
return null;
},
getFunctionName: function() {
return null;
},
... | create_callsite = (location) ->
Object.create {
getFileName: -> location
getLineNumber: -> null
getFunctionName: -> null
getTypeName: -> null
getMethodName: -> null
getColumnNumber: -> null
isNative: -> null
} | JavaScript | CoffeeScript | mattinsler/longjohn | lib/longjohn.coffee | MIT | 01f30ac186f5f617e2d342d81299e9188494b066 | 841 | https://github.com/mattinsler/longjohn/blob/01f30ac186f5f617e2d342d81299e9188494b066/lib/longjohn.coffee | 55 | 64 |
mattinsler/longjohn:lib/longjohn.coffee:5:completion | completion | create_callsite = (location) ->
Object.create {
getFileName: -> location
getLineNumber: -> null
getFunctionName: -> null | getTypeName: -> null
getMethodName: -> null
getColumnNumber: -> null
isNative: -> null
} | CoffeeScript | CoffeeScript | mattinsler/longjohn | lib/longjohn.coffee | MIT | 01f30ac186f5f617e2d342d81299e9188494b066 | 841 | https://github.com/mattinsler/longjohn/blob/01f30ac186f5f617e2d342d81299e9188494b066/lib/longjohn.coffee | 55 | 64 |
mattinsler/longjohn:lib/longjohn.coffee:6:raw_corpus | raw_corpus | prepareStackTrace = (error, structured_stack_trace) ->
++in_prepare
unless error.__cached_trace__?
error.__cached_trace__ = structured_stack_trace.filter (f) -> f.getFileName() isnt filename
error.__previous__ = current_trace_error if !error.__previous__? and in_prepare is 1
if error.__previous__?
... | CoffeeScript | mattinsler/longjohn | lib/longjohn.coffee | MIT | 01f30ac186f5f617e2d342d81299e9188494b066 | 841 | https://github.com/mattinsler/longjohn/blob/01f30ac186f5f617e2d342d81299e9188494b066/lib/longjohn.coffee | 66 | 82 | ||
mattinsler/longjohn:lib/longjohn.coffee:6:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
prepareStackTrace = (error, structured_stack_trace) ->
++in_prepare
unless error.__cached_trace__?
error.__cached_trace__ = structured_stack_trace.filter (f) -> f.getFileName() isnt filename
error.__previous__ = current_trace_error if !error.__previo... | var prepareStackTrace;
prepareStackTrace = function(error, structured_stack_trace) {
var previous_stack;
++in_prepare;
if (error.__cached_trace__ == null) {
error.__cached_trace__ = structured_stack_trace.filter(function(f) {
return f.getFileName() !== filename;
});
if ((error.__previous__ == n... | CoffeeScript | JavaScript | mattinsler/longjohn | lib/longjohn.coffee | MIT | 01f30ac186f5f617e2d342d81299e9188494b066 | 841 | https://github.com/mattinsler/longjohn/blob/01f30ac186f5f617e2d342d81299e9188494b066/lib/longjohn.coffee | 66 | 82 |
mattinsler/longjohn:lib/longjohn.coffee:6:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var prepareStackTrace;
prepareStackTrace = function(error, structured_stack_trace) {
var previous_stack;
++in_prepare;
if (error.__cached_trace__ == null) {
error.__cached_trace__ = structured_stack_trace.filter(function(f) {
return f.getFileName()... | prepareStackTrace = (error, structured_stack_trace) ->
++in_prepare
unless error.__cached_trace__?
error.__cached_trace__ = structured_stack_trace.filter (f) -> f.getFileName() isnt filename
error.__previous__ = current_trace_error if !error.__previous__? and in_prepare is 1
if error.__previous__?
... | JavaScript | CoffeeScript | mattinsler/longjohn | lib/longjohn.coffee | MIT | 01f30ac186f5f617e2d342d81299e9188494b066 | 841 | https://github.com/mattinsler/longjohn/blob/01f30ac186f5f617e2d342d81299e9188494b066/lib/longjohn.coffee | 66 | 82 |
mattinsler/longjohn:lib/longjohn.coffee:6:completion | completion | prepareStackTrace = (error, structured_stack_trace) ->
++in_prepare
unless error.__cached_trace__?
error.__cached_trace__ = structured_stack_trace.filter (f) -> f.getFileName() isnt filename
error.__previous__ = current_trace_error if !error.__previous__? and in_prepare is 1
if error.__previous__? | previous_stack =prepareStackTrace(error.__previous__, error.__previous__.__stack__)
if previous_stack?.length > 0
error.__cached_trace__.push(create_callsite(exports.empty_frame))
error.__cached_trace__.push(previous_stack...)
--in_prepare
return error.__cached_trace__ if in_prepare > 0
ex... | CoffeeScript | CoffeeScript | mattinsler/longjohn | lib/longjohn.coffee | MIT | 01f30ac186f5f617e2d342d81299e9188494b066 | 841 | https://github.com/mattinsler/longjohn/blob/01f30ac186f5f617e2d342d81299e9188494b066/lib/longjohn.coffee | 66 | 82 |
mattinsler/longjohn:lib/longjohn.coffee:7:raw_corpus | raw_corpus | limit_frames = (stack) ->
return if exports.async_trace_limit <= 0
count = exports.async_trace_limit - 1
previous = stack
while previous? and count > 1
previous = previous.__previous__
--count
delete previous.__previous__ if previous?
ERROR_ID = 1 | CoffeeScript | mattinsler/longjohn | lib/longjohn.coffee | MIT | 01f30ac186f5f617e2d342d81299e9188494b066 | 841 | https://github.com/mattinsler/longjohn/blob/01f30ac186f5f617e2d342d81299e9188494b066/lib/longjohn.coffee | 84 | 95 | ||
mattinsler/longjohn:lib/longjohn.coffee:7:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
limit_frames = (stack) ->
return if exports.async_trace_limit <= 0
count = exports.async_trace_limit - 1
previous = stack
while previous? and count > 1
previous = previous.__previous__
--count
delete previous.__previous__ if previous?
ERROR_I... | var ERROR_ID, limit_frames;
limit_frames = function(stack) {
var count, previous;
if (exports.async_trace_limit <= 0) {
return;
}
count = exports.async_trace_limit - 1;
previous = stack;
while ((previous != null) && count > 1) {
previous = previous.__previous__;
--count;
}
if (previous != n... | CoffeeScript | JavaScript | mattinsler/longjohn | lib/longjohn.coffee | MIT | 01f30ac186f5f617e2d342d81299e9188494b066 | 841 | https://github.com/mattinsler/longjohn/blob/01f30ac186f5f617e2d342d81299e9188494b066/lib/longjohn.coffee | 84 | 95 |
mattinsler/longjohn:lib/longjohn.coffee:7:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var ERROR_ID, limit_frames;
limit_frames = function(stack) {
var count, previous;
if (exports.async_trace_limit <= 0) {
return;
}
count = exports.async_trace_limit - 1;
previous = stack;
while ((previous != null) && count > 1) {
previous = prev... | limit_frames = (stack) ->
return if exports.async_trace_limit <= 0
count = exports.async_trace_limit - 1
previous = stack
while previous? and count > 1
previous = previous.__previous__
--count
delete previous.__previous__ if previous?
ERROR_ID = 1 | JavaScript | CoffeeScript | mattinsler/longjohn | lib/longjohn.coffee | MIT | 01f30ac186f5f617e2d342d81299e9188494b066 | 841 | https://github.com/mattinsler/longjohn/blob/01f30ac186f5f617e2d342d81299e9188494b066/lib/longjohn.coffee | 84 | 95 |
mattinsler/longjohn:lib/longjohn.coffee:7:completion | completion | limit_frames = (stack) ->
return if exports.async_trace_limit <= 0
count = exports.async_trace_limit - 1
previous = stack | while previous? and count > 1
previous = previous.__previous__
--count
delete previous.__previous__ if previous?
ERROR_ID = 1 | CoffeeScript | CoffeeScript | mattinsler/longjohn | lib/longjohn.coffee | MIT | 01f30ac186f5f617e2d342d81299e9188494b066 | 841 | https://github.com/mattinsler/longjohn/blob/01f30ac186f5f617e2d342d81299e9188494b066/lib/longjohn.coffee | 84 | 95 |
mattinsler/longjohn:lib/longjohn.coffee:8:raw_corpus | raw_corpus | wrap_callback = (callback, location) ->
orig = Error.prepareStackTrace
Error.prepareStackTrace = (x, stack) -> stack
trace_error = new Error()
Error.captureStackTrace(trace_error, arguments.callee)
trace_error.__stack__ = trace_error.stack;
Error.prepareStackTrace = orig
trace_error.id = ERROR_ID++
if t... | CoffeeScript | mattinsler/longjohn | lib/longjohn.coffee | MIT | 01f30ac186f5f617e2d342d81299e9188494b066 | 841 | https://github.com/mattinsler/longjohn/blob/01f30ac186f5f617e2d342d81299e9188494b066/lib/longjohn.coffee | 97 | 137 | ||
mattinsler/longjohn:lib/longjohn.coffee:8:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
wrap_callback = (callback, location) ->
orig = Error.prepareStackTrace
Error.prepareStackTrace = (x, stack) -> stack
trace_error = new Error()
Error.captureStackTrace(trace_error, arguments.callee)
trace_error.__stack__ = trace_error.stack;
Error.prep... | var _addListener, _listeners, _on, _once, wrap_callback;
wrap_callback = function(callback, location) {
var new_callback, orig, trace_error;
orig = Error.prepareStackTrace;
Error.prepareStackTrace = function(x, stack) {
return stack;
};
trace_error = new Error();
Error.captureStackTrace(trace_error, ar... | CoffeeScript | JavaScript | mattinsler/longjohn | lib/longjohn.coffee | MIT | 01f30ac186f5f617e2d342d81299e9188494b066 | 841 | https://github.com/mattinsler/longjohn/blob/01f30ac186f5f617e2d342d81299e9188494b066/lib/longjohn.coffee | 97 | 137 |
mattinsler/longjohn:lib/longjohn.coffee:8:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var _addListener, _listeners, _on, _once, wrap_callback;
wrap_callback = function(callback, location) {
var new_callback, orig, trace_error;
orig = Error.prepareStackTrace;
Error.prepareStackTrace = function(x, stack) {
return stack;
};
trace_error =... | wrap_callback = (callback, location) ->
orig = Error.prepareStackTrace
Error.prepareStackTrace = (x, stack) -> stack
trace_error = new Error()
Error.captureStackTrace(trace_error, arguments.callee)
trace_error.__stack__ = trace_error.stack;
Error.prepareStackTrace = orig
trace_error.id = ERROR_ID++
if t... | JavaScript | CoffeeScript | mattinsler/longjohn | lib/longjohn.coffee | MIT | 01f30ac186f5f617e2d342d81299e9188494b066 | 841 | https://github.com/mattinsler/longjohn/blob/01f30ac186f5f617e2d342d81299e9188494b066/lib/longjohn.coffee | 97 | 137 |
mattinsler/longjohn:lib/longjohn.coffee:8:completion | completion | wrap_callback = (callback, location) ->
orig = Error.prepareStackTrace
Error.prepareStackTrace = (x, stack) -> stack
trace_error = new Error()
Error.captureStackTrace(trace_error, arguments.callee)
trace_error.__stack__ = trace_error.stack;
Error.prepareStackTrace = orig
trace_error.id = ERROR_ID++
if t... | # Clear trace_error variable from the closure, so it can potentially be garbage collected.
trace_error = null
try
callback.apply(this, arguments)
catch e
# Ensure we're formatting the Error in longjohn
e.stack
throw e
finally
current_trace_error = null
new_callback.list... | CoffeeScript | CoffeeScript | mattinsler/longjohn | lib/longjohn.coffee | MIT | 01f30ac186f5f617e2d342d81299e9188494b066 | 841 | https://github.com/mattinsler/longjohn/blob/01f30ac186f5f617e2d342d81299e9188494b066/lib/longjohn.coffee | 97 | 137 |
mattinsler/longjohn:lib/longjohn.coffee:9:raw_corpus | raw_corpus | EventEmitter.prototype.addListener = (event, callback) ->
args = Array::slice.call(arguments)
args[1] = wrap_callback(callback, 'EventEmitter.addListener')
_addListener.apply(this, args) | CoffeeScript | mattinsler/longjohn | lib/longjohn.coffee | MIT | 01f30ac186f5f617e2d342d81299e9188494b066 | 841 | https://github.com/mattinsler/longjohn/blob/01f30ac186f5f617e2d342d81299e9188494b066/lib/longjohn.coffee | 139 | 142 | ||
mattinsler/longjohn:lib/longjohn.coffee:9:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
EventEmitter.prototype.addListener = (event, callback) ->
args = Array::slice.call(arguments)
args[1] = wrap_callback(callback, 'EventEmitter.addListener')
_addListener.apply(this, args)
``` | EventEmitter.prototype.addListener = function(event, callback) {
var args;
args = Array.prototype.slice.call(arguments);
args[1] = wrap_callback(callback, 'EventEmitter.addListener');
return _addListener.apply(this, args);
}; | CoffeeScript | JavaScript | mattinsler/longjohn | lib/longjohn.coffee | MIT | 01f30ac186f5f617e2d342d81299e9188494b066 | 841 | https://github.com/mattinsler/longjohn/blob/01f30ac186f5f617e2d342d81299e9188494b066/lib/longjohn.coffee | 139 | 142 |
mattinsler/longjohn:lib/longjohn.coffee:9:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
EventEmitter.prototype.addListener = function(event, callback) {
var args;
args = Array.prototype.slice.call(arguments);
args[1] = wrap_callback(callback, 'EventEmitter.addListener');
return _addListener.apply(this, args);
};
``` | EventEmitter.prototype.addListener = (event, callback) ->
args = Array::slice.call(arguments)
args[1] = wrap_callback(callback, 'EventEmitter.addListener')
_addListener.apply(this, args) | JavaScript | CoffeeScript | mattinsler/longjohn | lib/longjohn.coffee | MIT | 01f30ac186f5f617e2d342d81299e9188494b066 | 841 | https://github.com/mattinsler/longjohn/blob/01f30ac186f5f617e2d342d81299e9188494b066/lib/longjohn.coffee | 139 | 142 |
mattinsler/longjohn:lib/longjohn.coffee:9:completion | completion | EventEmitter.prototype.addListener = (event, callback) ->
args = Array::slice.call(arguments) | args[1] = wrap_callback(callback, 'EventEmitter.addListener')
_addListener.apply(this, args) | CoffeeScript | CoffeeScript | mattinsler/longjohn | lib/longjohn.coffee | MIT | 01f30ac186f5f617e2d342d81299e9188494b066 | 841 | https://github.com/mattinsler/longjohn/blob/01f30ac186f5f617e2d342d81299e9188494b066/lib/longjohn.coffee | 139 | 142 |
mattinsler/longjohn:lib/longjohn.coffee:10:raw_corpus | raw_corpus | EventEmitter.prototype.on = (event, callback) ->
args = Array::slice.call(arguments)
args[1] = wrap_callback(callback, 'EventEmitter.on')
_on.apply(this, args) | CoffeeScript | mattinsler/longjohn | lib/longjohn.coffee | MIT | 01f30ac186f5f617e2d342d81299e9188494b066 | 841 | https://github.com/mattinsler/longjohn/blob/01f30ac186f5f617e2d342d81299e9188494b066/lib/longjohn.coffee | 144 | 147 | ||
mattinsler/longjohn:lib/longjohn.coffee:10:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
EventEmitter.prototype.on = (event, callback) ->
args = Array::slice.call(arguments)
args[1] = wrap_callback(callback, 'EventEmitter.on')
_on.apply(this, args)
``` | EventEmitter.prototype.on = function(event, callback) {
var args;
args = Array.prototype.slice.call(arguments);
args[1] = wrap_callback(callback, 'EventEmitter.on');
return _on.apply(this, args);
}; | CoffeeScript | JavaScript | mattinsler/longjohn | lib/longjohn.coffee | MIT | 01f30ac186f5f617e2d342d81299e9188494b066 | 841 | https://github.com/mattinsler/longjohn/blob/01f30ac186f5f617e2d342d81299e9188494b066/lib/longjohn.coffee | 144 | 147 |
mattinsler/longjohn:lib/longjohn.coffee:10:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
EventEmitter.prototype.on = function(event, callback) {
var args;
args = Array.prototype.slice.call(arguments);
args[1] = wrap_callback(callback, 'EventEmitter.on');
return _on.apply(this, args);
};
``` | EventEmitter.prototype.on = (event, callback) ->
args = Array::slice.call(arguments)
args[1] = wrap_callback(callback, 'EventEmitter.on')
_on.apply(this, args) | JavaScript | CoffeeScript | mattinsler/longjohn | lib/longjohn.coffee | MIT | 01f30ac186f5f617e2d342d81299e9188494b066 | 841 | https://github.com/mattinsler/longjohn/blob/01f30ac186f5f617e2d342d81299e9188494b066/lib/longjohn.coffee | 144 | 147 |
mattinsler/longjohn:lib/longjohn.coffee:10:completion | completion | EventEmitter.prototype.on = (event, callback) ->
args = Array::slice.call(arguments) | args[1] = wrap_callback(callback, 'EventEmitter.on')
_on.apply(this, args) | CoffeeScript | CoffeeScript | mattinsler/longjohn | lib/longjohn.coffee | MIT | 01f30ac186f5f617e2d342d81299e9188494b066 | 841 | https://github.com/mattinsler/longjohn/blob/01f30ac186f5f617e2d342d81299e9188494b066/lib/longjohn.coffee | 144 | 147 |
mattinsler/longjohn:lib/longjohn.coffee:11:raw_corpus | raw_corpus | EventEmitter.prototype.once = (event, callback) ->
args = Array::slice.call(arguments)
args[1] = wrap_callback(callback, 'EventEmitter.once')
_once.apply(this, args) | CoffeeScript | mattinsler/longjohn | lib/longjohn.coffee | MIT | 01f30ac186f5f617e2d342d81299e9188494b066 | 841 | https://github.com/mattinsler/longjohn/blob/01f30ac186f5f617e2d342d81299e9188494b066/lib/longjohn.coffee | 149 | 152 | ||
mattinsler/longjohn:lib/longjohn.coffee:11:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
EventEmitter.prototype.once = (event, callback) ->
args = Array::slice.call(arguments)
args[1] = wrap_callback(callback, 'EventEmitter.once')
_once.apply(this, args)
``` | EventEmitter.prototype.once = function(event, callback) {
var args;
args = Array.prototype.slice.call(arguments);
args[1] = wrap_callback(callback, 'EventEmitter.once');
return _once.apply(this, args);
}; | CoffeeScript | JavaScript | mattinsler/longjohn | lib/longjohn.coffee | MIT | 01f30ac186f5f617e2d342d81299e9188494b066 | 841 | https://github.com/mattinsler/longjohn/blob/01f30ac186f5f617e2d342d81299e9188494b066/lib/longjohn.coffee | 149 | 152 |
mattinsler/longjohn:lib/longjohn.coffee:11:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
EventEmitter.prototype.once = function(event, callback) {
var args;
args = Array.prototype.slice.call(arguments);
args[1] = wrap_callback(callback, 'EventEmitter.once');
return _once.apply(this, args);
};
``` | EventEmitter.prototype.once = (event, callback) ->
args = Array::slice.call(arguments)
args[1] = wrap_callback(callback, 'EventEmitter.once')
_once.apply(this, args) | JavaScript | CoffeeScript | mattinsler/longjohn | lib/longjohn.coffee | MIT | 01f30ac186f5f617e2d342d81299e9188494b066 | 841 | https://github.com/mattinsler/longjohn/blob/01f30ac186f5f617e2d342d81299e9188494b066/lib/longjohn.coffee | 149 | 152 |
mattinsler/longjohn:lib/longjohn.coffee:11:completion | completion | EventEmitter.prototype.once = (event, callback) ->
args = Array::slice.call(arguments) | args[1] = wrap_callback(callback, 'EventEmitter.once')
_once.apply(this, args) | CoffeeScript | CoffeeScript | mattinsler/longjohn | lib/longjohn.coffee | MIT | 01f30ac186f5f617e2d342d81299e9188494b066 | 841 | https://github.com/mattinsler/longjohn/blob/01f30ac186f5f617e2d342d81299e9188494b066/lib/longjohn.coffee | 149 | 152 |
mattinsler/longjohn:lib/longjohn.coffee:12:raw_corpus | raw_corpus | EventEmitter.prototype.listeners = (event) ->
listeners = _listeners.call(this, event)
unwrapped = []
for l in listeners
if l.listener
unwrapped.push l.listener
else
unwrapped.push l
return unwrapped
_nextTick = process.nextTick | CoffeeScript | mattinsler/longjohn | lib/longjohn.coffee | MIT | 01f30ac186f5f617e2d342d81299e9188494b066 | 841 | https://github.com/mattinsler/longjohn/blob/01f30ac186f5f617e2d342d81299e9188494b066/lib/longjohn.coffee | 154 | 164 | ||
mattinsler/longjohn:lib/longjohn.coffee:12:coffee_to_js | coffee_to_js | Convert this CoffeeScript to JavaScript.
```coffeescript
EventEmitter.prototype.listeners = (event) ->
listeners = _listeners.call(this, event)
unwrapped = []
for l in listeners
if l.listener
unwrapped.push l.listener
else
unwrapped.push l
return unwrapped
_nextTick = process.nextTick
``` | var _nextTick;
EventEmitter.prototype.listeners = function(event) {
var i, l, len, listeners, unwrapped;
listeners = _listeners.call(this, event);
unwrapped = [];
for (i = 0, len = listeners.length; i < len; i++) {
l = listeners[i];
if (l.listener) {
unwrapped.push(l.listener);
} else {
... | CoffeeScript | JavaScript | mattinsler/longjohn | lib/longjohn.coffee | MIT | 01f30ac186f5f617e2d342d81299e9188494b066 | 841 | https://github.com/mattinsler/longjohn/blob/01f30ac186f5f617e2d342d81299e9188494b066/lib/longjohn.coffee | 154 | 164 |
mattinsler/longjohn:lib/longjohn.coffee:12:js_to_coffee | js_to_coffee | Convert this JavaScript to CoffeeScript.
```javascript
var _nextTick;
EventEmitter.prototype.listeners = function(event) {
var i, l, len, listeners, unwrapped;
listeners = _listeners.call(this, event);
unwrapped = [];
for (i = 0, len = listeners.length; i < len; i++) {
l = listeners[i];
if (l.listener)... | EventEmitter.prototype.listeners = (event) ->
listeners = _listeners.call(this, event)
unwrapped = []
for l in listeners
if l.listener
unwrapped.push l.listener
else
unwrapped.push l
return unwrapped
_nextTick = process.nextTick | JavaScript | CoffeeScript | mattinsler/longjohn | lib/longjohn.coffee | MIT | 01f30ac186f5f617e2d342d81299e9188494b066 | 841 | https://github.com/mattinsler/longjohn/blob/01f30ac186f5f617e2d342d81299e9188494b066/lib/longjohn.coffee | 154 | 164 |
mattinsler/longjohn:lib/longjohn.coffee:12:completion | completion | EventEmitter.prototype.listeners = (event) ->
listeners = _listeners.call(this, event)
unwrapped = []
for l in listeners
if l.listener | unwrapped.push l.listener
else
unwrapped.push l
return unwrapped
_nextTick = process.nextTick | CoffeeScript | CoffeeScript | mattinsler/longjohn | lib/longjohn.coffee | MIT | 01f30ac186f5f617e2d342d81299e9188494b066 | 841 | https://github.com/mattinsler/longjohn/blob/01f30ac186f5f617e2d342d81299e9188494b066/lib/longjohn.coffee | 154 | 164 |
mattinsler/longjohn:lib/longjohn.coffee:13:raw_corpus | raw_corpus | process.nextTick = (callback) ->
args = Array::slice.call(arguments)
args[0] = wrap_callback(callback, 'process.nextTick')
_nextTick.apply(this, args)
__nextDomainTick = process._nextDomainTick | CoffeeScript | mattinsler/longjohn | lib/longjohn.coffee | MIT | 01f30ac186f5f617e2d342d81299e9188494b066 | 841 | https://github.com/mattinsler/longjohn/blob/01f30ac186f5f617e2d342d81299e9188494b066/lib/longjohn.coffee | 166 | 172 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.