Skip to content

Commit

Permalink
Remove tabs from the codebase. Spaces only, please.
Browse files Browse the repository at this point in the history
  • Loading branch information
cscott committed Nov 1, 2015
1 parent cc8ac18 commit 45a670a
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 62 deletions.
1 change: 1 addition & 0 deletions .jscsrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// allow some slop to account for legacy code
"validateQuoteMarks": { "mark": "'", "escape": true },
"requireCapitalizedComments": { "allExcept": ["jshint","globals"] },
"disallowTabs": true,

"excludeFiles": [
"test.js",
Expand Down
24 changes: 12 additions & 12 deletions deps/cdconfigure.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,26 @@ var rest = process.argv.slice(0);
// "properly".
switch (process.env.BUILDTYPE || 'Release') {
case 'Debug':
rest.push('--enable-debug');
break;
rest.push('--enable-debug');
break;
default:
case 'Release':
rest.push('--enable-release');
break;
rest.push('--enable-release');
break;
}
// Fixup CFLAGS
if (process.config.variables.target_arch !== 'ia32') {
// needed for x86_64
rest.push('CFLAGS=-fPIC');
rest.push('CXXFLAGS=-fPIC');
// needed for x86_64
rest.push('CFLAGS=-fPIC');
rest.push('CXXFLAGS=-fPIC');
} else {
// needed for multilib builds on x86_64 host
rest.push('CFLAGS=-m32');
rest.push('CXXFLAGS=-m32');
// needed for multilib builds on x86_64 host
rest.push('CFLAGS=-m32');
rest.push('CXXFLAGS=-m32');
}

console.log(path.resolve(confdir, './configure'), rest.join(' '));
var c = child_process.spawn(path.resolve(confdir, './configure'), rest, {
cwd: confdir,
stdio: 'inherit'
cwd: confdir,
stdio: 'inherit'
});
6 changes: 3 additions & 3 deletions scripts/validate_tag.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ if [ `git describe --tags --always HEAD` ]; then
fi
else
echo "warning: travis thinks the tag ($TRAVIS_BRANCH) differs from git (`git describe --tags --always HEAD`)"
if [ "${1:-}" == "--check" ]; then
exit 1
fi
if [ "${1:-}" == "--check" ]; then
exit 1
fi
fi
fi
14 changes: 7 additions & 7 deletions test/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,13 @@ describe('Feeding POST data from JS to PHP', function() {
},
}, {
source: [
'call_user_func(function() {',
' # ensure we handle duplicate headers sent from PHP',
' setcookie("a", "b");',
' setcookie("c", "d", 0, "/");',
' var_dump($_COOKIE);',
' return 1;',
'})',
'call_user_func(function() {',
' # ensure we handle duplicate headers sent from PHP',
' setcookie("a", "b");',
' setcookie("c", "d", 0, "/");',
' var_dump($_COOKIE);',
' return 1;',
'})',
].join('\n'),
}).spread(function(phpvalue, output, response) {
should(phpvalue).be.equal(1);
Expand Down
38 changes: 19 additions & 19 deletions test/jswait.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ describe('Invoking asynchronous JS methods from PHP', function() {
'call_user_func(function () {',
' $setTimeout = $_SERVER["CONTEXT"]->setTimeout;',
' $testAsync = $_SERVER["CONTEXT"]->testAsync;',
// Demonstrate execution of existing node methods
' $setTimeout(new Js\\Wait(), 1); # wait 1 ms',
// Demonstrate that JS thread is not blocked.
' return $testAsync(11, 12, new Js\\Wait());',
// Demonstrate execution of existing node methods
' $setTimeout(new Js\\Wait(), 1); # wait 1 ms',
// Demonstrate that JS thread is not blocked.
' return $testAsync(11, 12, new Js\\Wait());',
'})',
].join('\n'),
}).then(function(v) {
Expand All @@ -54,11 +54,11 @@ describe('Invoking asynchronous JS methods from PHP', function() {
source: [
'call_user_func(function () {',
' $testAsync = $_SERVER["CONTEXT"]->testAsync;',
' try {',
' $testAsync("early", "x", new Js\\Wait());',
' } catch (Exception $e) {',
' return "exception caught";',
' }',
' try {',
' $testAsync("early", "x", new Js\\Wait());',
' } catch (Exception $e) {',
' return "exception caught";',
' }',
'})',
].join('\n'),
}).then(function(v) {
Expand All @@ -74,11 +74,11 @@ describe('Invoking asynchronous JS methods from PHP', function() {
source: [
'call_user_func(function () {',
' $testAsync = $_SERVER["CONTEXT"]->testAsync;',
' try {',
' $testAsync("middle", "x", new Js\\Wait());',
' } catch (Exception $e) {',
' return "exception caught";',
' }',
' try {',
' $testAsync("middle", "x", new Js\\Wait());',
' } catch (Exception $e) {',
' return "exception caught";',
' }',
'})',
].join('\n'),
}).then(function(v) {
Expand All @@ -94,11 +94,11 @@ describe('Invoking asynchronous JS methods from PHP', function() {
source: [
'call_user_func(function () {',
' $testAsync = $_SERVER["CONTEXT"]->testAsync;',
' try {',
' $testAsync("late", "x", new Js\\Wait());',
' } catch (Exception $e) {',
' return "exception caught";',
' }',
' try {',
' $testAsync("late", "x", new Js\\Wait());',
' } catch (Exception $e) {',
' return "exception caught";',
' }',
'})',
].join('\n'),
}).then(function(v) {
Expand Down
43 changes: 22 additions & 21 deletions test/phpobject.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,24 @@ require('should');
describe('Wrapped PHP objects accessed from JavaScript', function() {
var php = require('../');
var code = [
'call_user_func(function () {',
' class SimpleClass {',
'call_user_func(function () {',
' class SimpleClass {',
' // property declaration',
' public $var = "a default value";',
' public $empty = NULL;',
' public $empty = NULL;',
' private $priv = "private";',
' ',
' // method declaration',
' ',
' // method declaration',
' public function displayVar() {',
' echo $this->var;',
' }',
' echo $this->var;',
' }',
' public function getPriv() {',
' return $this->priv;',
' }',
' }',
' class MagicClass {',
' }',
' class MagicClass {',
' private $var = "private";',
' public function __get( $name ) {',
' public function __get( $name ) {',
' echo "__get\n";',
' return $name == "v" ? $this->var : null;',
' }',
Expand All @@ -38,18 +38,19 @@ describe('Wrapped PHP objects accessed from JavaScript', function() {
' echo "__unset\n";',
' if ( $name == "v" ) { $this->var = "unset"; }',
' }',
' public function __call( $name, $arguments ) {',
' echo "__call\n";',
' return $name;',
' }',
' public function __invoke( $x ) {',
' echo "__invoke\n";',
' return $x;',
' }',
' public function __call( $name, $arguments ) {',
' echo "__call\n";',
' return $name;',
' }',
' public function __invoke( $x ) {',
' echo "__invoke\n";',
' return $x;',
' }',
' }',
' $c = $_SERVER["CONTEXT"];',
' return $c->jsfunc(new SimpleClass(), new MagicClass());',
'})',].join('\n');
' $c = $_SERVER["CONTEXT"];',
' return $c->jsfunc(new SimpleClass(), new MagicClass());',
'})',
].join('\n');
var test = function(f) {
var out = new StringStream();
return php.request({ source: code, context: { jsfunc: f }, stream: out })
Expand Down

0 comments on commit 45a670a

Please sign in to comment.