Merge branch 'master' into chrome31

Conflicts:
	common/atom_version.h
This commit is contained in:
Cheng Zhao 2013-12-17 12:58:25 +08:00
commit a4715f936b
7 changed files with 42 additions and 12 deletions

View file

@ -50,8 +50,8 @@ END
// //
VS_VERSION_INFO VERSIONINFO VS_VERSION_INFO VERSIONINFO
FILEVERSION 0,7,5,0 FILEVERSION 0,7,6,0
PRODUCTVERSION 0,7,5,0 PRODUCTVERSION 0,7,6,0
FILEFLAGSMASK 0x3fL FILEFLAGSMASK 0x3fL
#ifdef _DEBUG #ifdef _DEBUG
FILEFLAGS 0x1L FILEFLAGS 0x1L
@ -68,12 +68,12 @@ BEGIN
BEGIN BEGIN
VALUE "CompanyName", "GitHub, Inc." VALUE "CompanyName", "GitHub, Inc."
VALUE "FileDescription", "Atom-Shell" VALUE "FileDescription", "Atom-Shell"
VALUE "FileVersion", "0.7.5" VALUE "FileVersion", "0.7.6"
VALUE "InternalName", "atom.exe" VALUE "InternalName", "atom.exe"
VALUE "LegalCopyright", "Copyright (C) 2013 GitHub, Inc. All rights reserved." VALUE "LegalCopyright", "Copyright (C) 2013 GitHub, Inc. All rights reserved."
VALUE "OriginalFilename", "atom.exe" VALUE "OriginalFilename", "atom.exe"
VALUE "ProductName", "Atom-Shell" VALUE "ProductName", "Atom-Shell"
VALUE "ProductVersion", "0.7.5" VALUE "ProductVersion", "0.7.6"
END END
END END
BLOCK "VarFileInfo" BLOCK "VarFileInfo"

View file

@ -11,7 +11,7 @@
<key>CFBundleIconFile</key> <key>CFBundleIconFile</key>
<string>atom.icns</string> <string>atom.icns</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>0.7.5</string> <string>0.7.6</string>
<key>NSMainNibFile</key> <key>NSMainNibFile</key>
<string>MainMenu</string> <string>MainMenu</string>
<key>NSPrincipalClass</key> <key>NSPrincipalClass</key>

View file

@ -5,8 +5,37 @@
#ifndef ATOM_COMMON_SWAP_OR_ASSIGN_H_ #ifndef ATOM_COMMON_SWAP_OR_ASSIGN_H_
#define ATOM_COMMON_SWAP_OR_ASSIGN_H_ #define ATOM_COMMON_SWAP_OR_ASSIGN_H_
#include "base/compiler_specific.h"
namespace internal { namespace internal {
#if defined(OS_WIN)
template<typename T> inline
void SwapOrAssign(T& v1, const T& v2) {
__if_exists(T::swap) {
v1.swap(const_cast<T&>(v2));
}
__if_not_exists(T::swap) {
v1 = v2;
}
}
template<typename T> inline
void SwapOrAssign(T*& v1, T* v2) {
v1 = v2;
}
inline
void SwapOrAssign(int& v1, int v2) {
v1 = v2;
}
inline
void SwapOrAssign(bool& v1, bool v2) {
v1 = v2;
}
#else // defined(OS_WIN)
// Helper to detect whether value has specified method. // Helper to detect whether value has specified method.
template <typename T> template <typename T>
class HasSwapMethod { class HasSwapMethod {
@ -24,17 +53,18 @@ struct enable_if {};
template<class T> template<class T>
struct enable_if<true, T> { typedef T type; }; struct enable_if<true, T> { typedef T type; };
template<typename T> template<typename T> inline
typename enable_if<HasSwapMethod<T>::value>::type SwapOrAssign( typename enable_if<HasSwapMethod<T>::value>::type SwapOrAssign(
T& v1, const T& v2) { T& v1, const T& v2) {
v1.swap(const_cast<T&>(v2)); v1.swap(const_cast<T&>(v2));
} }
template<typename T> template<typename T> inline
typename enable_if<!HasSwapMethod<T>::value>::type SwapOrAssign( typename enable_if<!HasSwapMethod<T>::value>::type SwapOrAssign(
T& v1, const T& v2) { T& v1, const T& v2) {
v1 = v2; v1 = v2;
} }
#endif // !defined(OS_WIN)
} // namespace internal } // namespace internal

View file

@ -239,7 +239,7 @@ bool FromV8Arguments(const v8::FunctionCallbackInfo<v8::Value>& args,
if (!V8ValueCanBeConvertedTo<T1>(args[index])) if (!V8ValueCanBeConvertedTo<T1>(args[index]))
return false; return false;
internal::SwapOrAssign(*value, internal::SwapOrAssign(*value,
static_cast<const T1&>(FromV8Value(args[index]))); FromV8Value(args[index]).operator T1());
return true; return true;
} }

View file

@ -12,7 +12,7 @@ var Menu = require('menu');
var MenuItem = require('menu-item'); var MenuItem = require('menu-item');
var menu = new Menu(); var menu = new Menu();
menu.append(new MenuItem({ label: 'MenuItem1', click: function() { console.log('item 1clicked'); } })); menu.append(new MenuItem({ label: 'MenuItem1', click: function() { console.log('item 1 clicked'); } }));
menu.append(new MenuItem({ type: 'separator' })); menu.append(new MenuItem({ type: 'separator' }));
menu.append(new MenuItem({ label: 'MenuItem2', type: 'checkbox', clicked: true })); menu.append(new MenuItem({ label: 'MenuItem2', type: 'checkbox', clicked: true }));

View file

@ -3,9 +3,9 @@
## Prerequisites ## Prerequisites
* Windows 7 or later * Windows 7 or later
* Visual Studio 2010 Express or Profissional * Visual Studio 2010 Express or Professional
* Make sure "X64 Compilers and Tools" are installed if you use the * Make sure "X64 Compilers and Tools" are installed if you use the
Profissional edition. Professional edition.
* [Python 2.7](http://www.python.org/download/releases/2.7/) * [Python 2.7](http://www.python.org/download/releases/2.7/)
* [node.js](http://nodejs.org/) * [node.js](http://nodejs.org/)
* [git](http://git-scm.com) * [git](http://git-scm.com)

View file

@ -1,6 +1,6 @@
{ {
"name": "atom-shell", "name": "atom-shell",
"version": "0.7.5", "version": "0.7.6",
"devDependencies": { "devDependencies": {
"coffee-script": "~1.6.3", "coffee-script": "~1.6.3",