vscodium theme moved to dotsplus repo
@@ -1,44 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
|
||||
<Metadata>
|
||||
<Identity Language="en-US" Id="night-owl" Version="2.0.1" Publisher="sdras"/>
|
||||
<DisplayName>Night Owl</DisplayName>
|
||||
<Description xml:space="preserve">A VS Code theme for the night owls out there. Now introducing Light Owl theme for daytime usage. Decisions were based on meaningful contrast for reading comprehension and for optimal razzle dazzle. ✨</Description>
|
||||
<Tags>Theme,Dark Theme,Light Theme,Night Owl,Night Theme,Light Owl,Snow Owl,Early Bird,Accessible Theme,theme,color-theme</Tags>
|
||||
<Categories>Themes</Categories>
|
||||
<GalleryFlags>Public</GalleryFlags>
|
||||
<Badges></Badges>
|
||||
<Properties>
|
||||
<Property Id="Microsoft.VisualStudio.Code.Engine" Value="^1.17.0" />
|
||||
<Property Id="Microsoft.VisualStudio.Code.ExtensionDependencies" Value="" />
|
||||
<Property Id="Microsoft.VisualStudio.Code.ExtensionPack" Value="" />
|
||||
<Property Id="Microsoft.VisualStudio.Code.ExtensionKind" Value="ui,workspace,web" />
|
||||
<Property Id="Microsoft.VisualStudio.Code.LocalizedLanguages" Value="" />
|
||||
|
||||
<Property Id="Microsoft.VisualStudio.Services.Links.Source" Value="https://github.com/sdras/night-owl-vscode-theme" />
|
||||
<Property Id="Microsoft.VisualStudio.Services.Links.Getstarted" Value="https://github.com/sdras/night-owl-vscode-theme" />
|
||||
|
||||
<Property Id="Microsoft.VisualStudio.Services.Links.GitHub" Value="https://github.com/sdras/night-owl-vscode-theme" />
|
||||
|
||||
|
||||
|
||||
|
||||
<Property Id="Microsoft.VisualStudio.Services.Branding.Color" Value="#061526" />
|
||||
<Property Id="Microsoft.VisualStudio.Services.Branding.Theme" Value="dark" />
|
||||
<Property Id="Microsoft.VisualStudio.Services.GitHubFlavoredMarkdown" Value="true" />
|
||||
|
||||
|
||||
|
||||
</Properties>
|
||||
|
||||
<Icon>extension/owl-icon.png</Icon>
|
||||
</Metadata>
|
||||
<Installation>
|
||||
<InstallationTarget Id="Microsoft.VisualStudio.Code"/>
|
||||
</Installation>
|
||||
<Dependencies/>
|
||||
<Assets>
|
||||
<Asset Type="Microsoft.VisualStudio.Code.Manifest" Path="extension/package.json" Addressable="true" />
|
||||
<Asset Type="Microsoft.VisualStudio.Services.Content.Details" Path="extension/README.md" Addressable="true" /><Asset Type="Microsoft.VisualStudio.Services.Content.Changelog" Path="extension/CHANGELOG.md" Addressable="true" /><Asset Type="Microsoft.VisualStudio.Services.Icons.Default" Path="extension/owl-icon.png" Addressable="true" />
|
||||
</Assets>
|
||||
</PackageManifest>
|
||||
@@ -1,211 +0,0 @@
|
||||
# Change Log
|
||||
|
||||
All notable changes to the "night-owl" extension are be documented in this file.
|
||||
|
||||
# "2.0.1
|
||||
|
||||
- update readme
|
||||
- update branch name
|
||||
|
||||
## "2.0.0"
|
||||
|
||||
- change strings
|
||||
- turn a base color less neon green
|
||||
- turn off semantic highlighting
|
||||
|
||||
## "1.2.1"
|
||||
|
||||
- fix italic/non-italic inconsistencies
|
||||
|
||||
## "1.2.0"
|
||||
|
||||
- fix dart files
|
||||
- update demo files, add in react hook example
|
||||
- fix contrast on popups
|
||||
- add in more ports to readme
|
||||
|
||||
## "1.1.4"
|
||||
|
||||
- fix typescript variable keyword highlighting inside classes
|
||||
|
||||
## "1.1.3"
|
||||
|
||||
### Light
|
||||
|
||||
- Update Go too-light function calls
|
||||
|
||||
### Dark
|
||||
|
||||
- make selection background in search more legible
|
||||
|
||||
## "1.1.2"
|
||||
|
||||
### Light Theme
|
||||
|
||||
- make selection background darker
|
||||
- make code comments darker
|
||||
|
||||
## "1.1.1"
|
||||
|
||||
### Light Theme
|
||||
|
||||
- fix the find match background
|
||||
- fix the badge background to not be so distracting
|
||||
- fix keyword other unit css bright yellow
|
||||
- fix the too-bright-orange
|
||||
- fix the too-light turquoise, give it some contrast from the purple
|
||||
- fix up invalid illegal, make it not white so you can read it
|
||||
- stop all the weird border error lines
|
||||
|
||||
### Dark theme
|
||||
|
||||
- fix up terminal selection background
|
||||
|
||||
## "1.1.0"
|
||||
|
||||
- Light theme no italics introduced
|
||||
- Fix bug in empty editor view
|
||||
|
||||
## "1.0.1"
|
||||
|
||||
- Updated readme with new screenshots, including light theme
|
||||
|
||||
## "1.0.0"
|
||||
|
||||
- Light theme introduced
|
||||
- C++ support
|
||||
- Fix active selection background bug
|
||||
- Fix Markdown Header bug
|
||||
|
||||
## "0.5.0"
|
||||
|
||||
- Better Closure support
|
||||
- Better Powershell support
|
||||
- Update notification toasts so you can see them better
|
||||
- Make Proptypes stand out a bit more
|
||||
- Fix bottom statusbar foreground
|
||||
- Make inactive tab less distracting
|
||||
- Make object.other.property more pronounced
|
||||
- Update editorGroup.emptyBackground from deprecated version
|
||||
- Make contrast between function keyword stronger
|
||||
- Fix bug in markdown punctuation
|
||||
- Make a difference between current highlighted and searched-for keyword
|
||||
- Update JSON key to be less barfy
|
||||
|
||||
## "0.4.3"
|
||||
|
||||
- Update README: vs code => visual studio code
|
||||
|
||||
## "0.4.2"
|
||||
|
||||
- Update warn widget color
|
||||
- Fix misnamed theme
|
||||
- Remove italics from git diff in no italics theme
|
||||
- Add symbol highlighting
|
||||
|
||||
## "0.4.1"
|
||||
|
||||
- Improved TypeScript support
|
||||
- Changed active panel coloring
|
||||
|
||||
## "0.4.0"
|
||||
|
||||
- Make cursor more visible
|
||||
- Added basic react in TS support
|
||||
- Fix ts and js differences
|
||||
- Lighter color for active indent guide
|
||||
|
||||
## "0.3.2"
|
||||
|
||||
- Fix scss/sass variables
|
||||
- Update readme to mention ported versions
|
||||
- Fix badge color
|
||||
- Update readme to specify how to make more contrast in sidebar
|
||||
- Make line number contrast more strong
|
||||
- Fix typescript 'import' and 'from' reserved words color
|
||||
- Fix PHP accessing property color
|
||||
|
||||
## "0.3.1"
|
||||
|
||||
- Return conditionals to their original state so that they don't stand out so much
|
||||
|
||||
## "0.3.0"
|
||||
|
||||
- Do a ton of keyword refinements, mainly across JavaScript and Ruby
|
||||
|
||||
## "0.2.6"
|
||||
|
||||
- Register italic alternate in package.json
|
||||
- Fix editor ruler color
|
||||
- More consistent italic in different scope
|
||||
|
||||
## "0.2.5"
|
||||
|
||||
- Update the inactive titlebar to be the same color as inactive tab
|
||||
- Match the html in React to regular HTML
|
||||
- Start creating a no italics theme
|
||||
|
||||
## "0.2.4"
|
||||
|
||||
- Remove operator italics
|
||||
|
||||
## "0.2.3"
|
||||
|
||||
- Update terminal colors for testing, tweaks
|
||||
- Fix a python blue for consistency
|
||||
|
||||
## "0.2.2"
|
||||
|
||||
- Update terminal colors for testing
|
||||
|
||||
## "0.2.1"
|
||||
|
||||
- Revert activity bar background change
|
||||
|
||||
## "0.2.0"
|
||||
|
||||
- Fix more overuse of italics
|
||||
- Section highlight and placeholder fixes
|
||||
- More contrast for React component tags
|
||||
- Fix top bar color
|
||||
- Fix block scope/editor indent lack of border
|
||||
- Operator color continuity
|
||||
- Fix peek result color contrast
|
||||
|
||||
## "0.1.8"
|
||||
|
||||
- Fix overuse of italics
|
||||
- Fix bug in prompts
|
||||
- Update Ruby highlighting
|
||||
|
||||
## "0.1.7"
|
||||
|
||||
- Make .gitignored files have less contrast
|
||||
- Make modified files a bright blue instead of bright yellow
|
||||
- Fix similar keyword highlight for some files
|
||||
- Function arrows no longer italicized
|
||||
- Codelense highlight not as distracting
|
||||
|
||||
## "0.1.6"
|
||||
|
||||
- Fix terminal blacks
|
||||
- Fix inactive tabs when there are two panes
|
||||
- Minor tweaks to JSON to match bracket pairs
|
||||
|
||||
## "0.1.4 / 0.1.5"
|
||||
|
||||
- Make scrollbar transparent
|
||||
|
||||
## "0.1.3"
|
||||
|
||||
- Update terminal division
|
||||
|
||||
## "0.1.2"
|
||||
|
||||
- Define clarity between active and inactive tabs
|
||||
- Make scrollbar visible
|
||||
- Make comments more legible
|
||||
|
||||
## "0.1.0"
|
||||
|
||||
- Initial release
|
||||
@@ -1,21 +0,0 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2018 Sarah Drasner
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -1,127 +0,0 @@
|
||||
# Night Owl 🌌
|
||||
|
||||
[](https://aka.ms/nightowl)
|
||||
[](https://aka.ms/nightowl)
|
||||
|
||||
A Visual Studio Code theme for the night owls out there. Fine-tuned for those of us who like to code late into the night. Color choices have taken into consideration what is accessible to people with colorblindness and in low-light circumstances. Decisions were also based on meaningful contrast for reading comprehension and for optimal razzle dazzle. ✨
|
||||
|
||||
As of 1.0.0, there's a Light Owl Theme too! Color balanced from the Dark version for easy viewing in daylight. 🌅
|
||||
|
||||
About this theme, and some of the considerations made while creating it (as well as _how_ to create it should you want to make your own): [https://css-tricks.com/creating-a-vs-code-theme/](https://css-tricks.com/creating-a-vs-code-theme/)
|
||||
|
||||
## Night Owl
|
||||

|
||||

|
||||
|
||||
## Light Owl
|
||||

|
||||

|
||||
|
||||
# Installation
|
||||
|
||||
1. Install [Visual Studio Code](https://code.visualstudio.com/)
|
||||
2. Launch Visual Studio Code
|
||||
3. Choose **Extensions** from menu
|
||||
4. Search for `night owl`
|
||||
5. Click **Install** to install it
|
||||
6. Click **Reload** to reload the Code
|
||||
7. From the menu bar click: Code > Preferences > Color Theme > **Night Owl**
|
||||
|
||||
## Disable Italics
|
||||
|
||||
If you wish to disable italics, there is now a no-italic theme available. You will have access to both, select **Night Owl No Italics** as your color theme.
|
||||
|
||||
## Other versions
|
||||
|
||||
The community is awesome and has ported this theme over to other environments.
|
||||
|
||||
#### Dark Theme
|
||||
|
||||
- Hyper: [https://github.com/pbomb/hyper-night-owl](https://github.com/pbomb/hyper-night-owl)
|
||||
- iTerm2
|
||||
1. [https://github.com/nickcernis/iterm2-night-owl](https://github.com/nickcernis/iterm2-night-owl)
|
||||
2. [https://github.com/jsit/night-owl-iterm2-theme](https://github.com/jsit/night-owl-iterm2-theme)
|
||||
3. [https://github.com/florianeckerstorfer/night-owl-itermcolors](https://github.com/florianeckerstorfer/night-owl-itermcolors)
|
||||
4. [https://github.com/andrewfluck/night-owl-iterm2](https://github.com/andrewfluck/night-owl-iterm2)
|
||||
- Xresources: [https://github.com/alochaus/night-owl-xresources-theme](https://github.com/alochaus/night-owl-xresources-theme)
|
||||
- Atom: [https://atom.io/themes/night-owl-vs-code-syntax](https://atom.io/themes/night-owl-vs-code-syntax)
|
||||
- Jetbrains: [https://github.com/xdrop/night-owl-jetbrains](https://github.com/xdrop/night-owl-jetbrains)
|
||||
- Emacs: [https://github.com/aaronjensen/night-owl-emacs](https://github.com/aaronjensen/night-owl-emacs)
|
||||
- Vim
|
||||
1. [https://github.com/Khaledgarbaya/night-owl-vim-theme](https://github.com/Khaledgarbaya/night-owl-vim-theme)
|
||||
2. [https://github.com/haishanh/night-owl.vim](https://github.com/haishanh/night-owl.vim)
|
||||
- Pygments [https://github.com/liamdawson/nightowl-pygments-style](https://github.com/liamdawson/nightowl-pygments-style)
|
||||
- Alfred: [https://github.com/jbharat/night-owl-alfred-theme](https://github.com/jbharat/night-owl-alfred-theme)
|
||||
- Ulauncher: [https://github.com/christoph-fricke/ulauncher-night-owl-theme](https://github.com/christoph-fricke/ulauncher-night-owl-theme)
|
||||
- TextMate [https://github.com/batpigandme/night-owlish](https://github.com/batpigandme/night-owlish/tree/master/tmTheme)
|
||||
- Ace Editor [https://github.com/batpigandme/night-owlish](https://github.com/batpigandme/night-owlish/tree/master/aceTheme)
|
||||
- RStudio [https://github.com/batpigandme/night-owlish](https://github.com/batpigandme/night-owlish/tree/master/rstheme)
|
||||
- Insomnia [https://github.com/yoannfleurydev/insomnia-plugin-night-owl-theme](https://github.com/yoannfleurydev/insomnia-plugin-night-owl-theme)
|
||||
- Sublime Text 3 [https://github.com/VonHeikemen/night-owl-sublime-scheme](https://github.com/VonHeikemen/night-owl-sublime-scheme)
|
||||
- Slack [https://github.com/clouby/night-owl-slack](https://github.com/clouby/night-owl-slack)
|
||||
- Xcode [https://github.com/stealthanthrax/xcode-Night-Owl](https://github.com/stealthanthrax/xcode-Night-Owl)
|
||||
- Visual Studio 2019: [https://github.com/kai-oswald/NightOwl-VS-Theme](https://github.com/kai-oswald/NightOwl-VS-Theme)
|
||||
- Prism [https://github.com/SaraVieira/prism-theme-night-owl](https://github.com/SaraVieira/prism-theme-night-owl)
|
||||
- Windows Terminal [https://github.com/edurojasr/Windows_Terminal_Theme_Night_Owl](https://github.com/edurojasr/Windows_Terminal_Theme_Night_Owl)
|
||||
- Alacritty: [https://github.com/alacritty/alacritty](https://github.com/alacritty/alacritty/wiki/Color-schemes)
|
||||
|
||||
|
||||
#### Light Theme
|
||||
|
||||
- iTerm2: [https://github.com/fcaldera/night-owl-light-iterm2](https://github.com/fcaldera/night-owl-light-iterm2)
|
||||
- Vim: [https://github.com/macguirerintoul/night_owl_light.vim](https://github.com/macguirerintoul/night_owl_light.vim)
|
||||
- Tilix: [https://github.com/johanhammar/light-owl-tilix](https://github.com/johanhammar/light-owl-tilix)
|
||||
- Alacritty: [https://github.com/nik27/night-owl-alacritty-theme](https://github.com/nik27/night-owl-alacritty-theme)
|
||||
|
||||
|
||||
## Separate the Editor from the Sidebar
|
||||
|
||||
This theme uses contrast sparingly so that when it's applied, it's more meaningful. This can help reduce noise and improve your ability to scan. However, some of the decisions may not work for everyone. One such decision that some disagree on is whether or not to have a separation between the editor and sidebar, and the amount of contrast. If you wish for this to have more visual signifigance, please paste this into your user settings preferences. These are my recommendations for these settings but you can use whatever colors you wish. ☺️
|
||||
|
||||
```
|
||||
"workbench.colorCustomizations": {
|
||||
"[Night Owl]": {
|
||||
"activityBar.background": "#000C1D",
|
||||
"activityBar.border": "#102a44",
|
||||
"editorGroup.border": "#102a44",
|
||||
"sideBar.background": "#001122",
|
||||
"sideBar.border": "#102a44",
|
||||
"sideBar.foreground": "#8BADC1"
|
||||
},
|
||||
"[Night Owl (No Italics)]": {
|
||||
"activityBar.background": "#000C1D",
|
||||
"activityBar.border": "#102a44",
|
||||
"editorGroup.border": "#102a44",
|
||||
"sideBar.background": "#001122",
|
||||
"sideBar.border": "#102a44",
|
||||
"sideBar.foreground": "#8BADC1"
|
||||
}
|
||||
},
|
||||
```
|
||||
|
||||
## Preferences shown in the preview
|
||||
|
||||
The font in the preview image is Dank Mono, [available here](https://dank.sh/). Editor settings to activate font ligatures:
|
||||
|
||||
```
|
||||
"editor.fontFamily": "Dank Mono",
|
||||
"editor.fontLigatures": true,
|
||||
```
|
||||
|
||||
The preview image is using [Bracket Pair Colorizer](https://marketplace.visualstudio.com/items?itemName=CoenraadS.bracket-pair-colorizer), a really cool extension that highlights matching brackets. This can help reduce unwanted errors.
|
||||
|
||||
I use this setting:
|
||||
|
||||
```
|
||||
"bracketPairColorizer.forceIterationColorCycle": true,
|
||||
```
|
||||
|
||||

|
||||
|
||||
## Misc
|
||||
|
||||
This is my first foray into creating a theme, so if you see something amiss, please feel free to [file an issue](https://github.com/sdras/night-owl-vscode-theme/issues)! I'm sure there are things I missed.
|
||||
|
||||
Any relevant changes for each version are documented in the changelog. Please update and check the changelog before filing any issues, as they may have already been taken care of.
|
||||
|
||||
This palette was inspired in part by Material Palenight [Theme](https://marketplace.visualstudio.com/items?itemName=whizkydee.material-palenight-theme), and the accessibility idea was inspired in part by Solarized [Themes](http://ethanschoonover.com/solarized)
|
||||
|
Before Width: | Height: | Size: 68 KiB |
|
Before Width: | Height: | Size: 75 KiB |
|
Before Width: | Height: | Size: 67 KiB |
|
Before Width: | Height: | Size: 83 KiB |
|
Before Width: | Height: | Size: 3.6 KiB |
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"python.linting.enabled": false
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import * as TestUtils from 'react-dom/test-utils';
|
||||
import CheckboxWithLabel from '../CheckboxWithLabel';
|
||||
|
||||
it('CheckboxWithLabel changes the text after click', () => {
|
||||
// Render a checkbox with label in the document
|
||||
const checkbox = TestUtils.renderIntoDocument(
|
||||
<CheckboxWithLabel labelOn="On" labelOff="Off" />
|
||||
)
|
||||
|
||||
const checkboxNode = ReactDOM.findDOMNode(checkbox)
|
||||
|
||||
// Verify that it's Off by default
|
||||
expect(checkboxNode.textContent).toEqual('Off')
|
||||
|
||||
// Simulate a click and verify that it is now On
|
||||
TestUtils.Simulate.change(
|
||||
TestUtils.findRenderedDOMComponentWithTag(checkbox, 'input')
|
||||
)
|
||||
expect(checkboxNode.textContent).toEqual('On')
|
||||
})
|
||||
@@ -1,26 +0,0 @@
|
||||
(ns hello.world.clojure)
|
||||
|
||||
(defn sum [& numbers]
|
||||
(if (empty? numbers)
|
||||
0
|
||||
(reduce + 0 numbers)))
|
||||
|
||||
(defn print-name [{:keys [first last age]}]
|
||||
(println (str "Your name is " first " " last " and you are " age " years old.")))
|
||||
|
||||
(defn set-age [person new-age]
|
||||
(assoc person :age new-age))
|
||||
|
||||
(defn hello-world []
|
||||
(let [john {:first "John" :last "Smith" :age 65}
|
||||
jack {:first "Jack" :last "Road" :age 76}
|
||||
george {:first "George" :last "Way" :age 23}
|
||||
george-junior (assoc george :age 6)
|
||||
all-persons [john jack george george-junior]]
|
||||
|
||||
(doseq [person all-persons]
|
||||
(print-name person))
|
||||
|
||||
(println (str "Total age is: " (apply sum (map :age all-persons))))))
|
||||
|
||||
(hello-world)
|
||||
@@ -1,21 +0,0 @@
|
||||
(ns hello.world.clojurescript
|
||||
(:require [reagent.core :as r])
|
||||
|
||||
(def counter (r/atom 0))
|
||||
(def text-component-style {:background-color :grey
|
||||
:border "1px solid black"
|
||||
:padding "5px"})
|
||||
|
||||
(defn counter-clicked []
|
||||
(.log js/console "You clicked the counter component.")
|
||||
(swap! counter inc))
|
||||
|
||||
(defn text-counter [text]
|
||||
[:div {:on-click counter-clicked
|
||||
:style text-component-style})
|
||||
(str text @counter])
|
||||
|
||||
(defn main-component []
|
||||
[:div
|
||||
[:p {:style {:color :red}} "Hello world! Click the element below:"]
|
||||
[text-counter "Clicked: "]])
|
||||
@@ -1,616 +0,0 @@
|
||||
// Copyright 2012 the V8 project authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#ifndef V8_API_H_
|
||||
#define V8_API_H_
|
||||
|
||||
#include "include/v8-testing.h"
|
||||
#include "src/contexts.h"
|
||||
#include "src/debug/debug-interface.h"
|
||||
#include "src/detachable-vector.h"
|
||||
#include "src/heap/factory.h"
|
||||
#include "src/isolate.h"
|
||||
#include "src/objects.h"
|
||||
#include "src/objects/bigint.h"
|
||||
#include "src/objects/js-collection.h"
|
||||
#include "src/objects/js-generator.h"
|
||||
#include "src/objects/js-promise.h"
|
||||
#include "src/objects/js-proxy.h"
|
||||
#include "src/objects/module.h"
|
||||
#include "src/objects/shared-function-info.h"
|
||||
|
||||
#include "src/objects/templates.h"
|
||||
|
||||
namespace v8 {
|
||||
|
||||
// Constants used in the implementation of the API. The most natural thing
|
||||
// would usually be to place these with the classes that use them, but
|
||||
// we want to keep them out of v8.h because it is an externally
|
||||
// visible file.
|
||||
class Consts {
|
||||
public:
|
||||
enum TemplateType {
|
||||
FUNCTION_TEMPLATE = 0,
|
||||
OBJECT_TEMPLATE = 1
|
||||
};
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
inline T ToCData(v8::internal::Object* obj);
|
||||
|
||||
template <>
|
||||
inline v8::internal::Address ToCData(v8::internal::Object* obj);
|
||||
|
||||
template <typename T>
|
||||
inline v8::internal::Handle<v8::internal::Object> FromCData(
|
||||
v8::internal::Isolate* isolate, T obj);
|
||||
|
||||
template <>
|
||||
inline v8::internal::Handle<v8::internal::Object> FromCData(
|
||||
v8::internal::Isolate* isolate, v8::internal::Address obj);
|
||||
|
||||
class ApiFunction {
|
||||
public:
|
||||
explicit ApiFunction(v8::internal::Address addr) : addr_(addr) { }
|
||||
v8::internal::Address address() { return addr_; }
|
||||
private:
|
||||
v8::internal::Address addr_;
|
||||
};
|
||||
|
||||
|
||||
|
||||
class RegisteredExtension {
|
||||
public:
|
||||
explicit RegisteredExtension(Extension* extension);
|
||||
static void Register(RegisteredExtension* that);
|
||||
static void UnregisterAll();
|
||||
Extension* extension() { return extension_; }
|
||||
RegisteredExtension* next() { return next_; }
|
||||
static RegisteredExtension* first_extension() { return first_extension_; }
|
||||
private:
|
||||
Extension* extension_;
|
||||
RegisteredExtension* next_;
|
||||
static RegisteredExtension* first_extension_;
|
||||
};
|
||||
|
||||
#define OPEN_HANDLE_LIST(V) \
|
||||
V(Template, TemplateInfo) \
|
||||
V(FunctionTemplate, FunctionTemplateInfo) \
|
||||
V(ObjectTemplate, ObjectTemplateInfo) \
|
||||
V(Signature, FunctionTemplateInfo) \
|
||||
V(AccessorSignature, FunctionTemplateInfo) \
|
||||
V(Data, Object) \
|
||||
V(RegExp, JSRegExp) \
|
||||
V(Object, JSReceiver) \
|
||||
V(Array, JSArray) \
|
||||
V(Map, JSMap) \
|
||||
V(Set, JSSet) \
|
||||
V(ArrayBuffer, JSArrayBuffer) \
|
||||
V(ArrayBufferView, JSArrayBufferView) \
|
||||
V(TypedArray, JSTypedArray) \
|
||||
V(Uint8Array, JSTypedArray) \
|
||||
V(Uint8ClampedArray, JSTypedArray) \
|
||||
V(Int8Array, JSTypedArray) \
|
||||
V(Uint16Array, JSTypedArray) \
|
||||
V(Int16Array, JSTypedArray) \
|
||||
V(Uint32Array, JSTypedArray) \
|
||||
V(Int32Array, JSTypedArray) \
|
||||
V(Float32Array, JSTypedArray) \
|
||||
V(Float64Array, JSTypedArray) \
|
||||
V(DataView, JSDataView) \
|
||||
V(SharedArrayBuffer, JSArrayBuffer) \
|
||||
V(Name, Name) \
|
||||
V(String, String) \
|
||||
V(Symbol, Symbol) \
|
||||
V(Script, JSFunction) \
|
||||
V(UnboundModuleScript, SharedFunctionInfo) \
|
||||
V(UnboundScript, SharedFunctionInfo) \
|
||||
V(Module, Module) \
|
||||
V(Function, JSReceiver) \
|
||||
V(Message, JSMessageObject) \
|
||||
V(Context, Context) \
|
||||
V(External, Object) \
|
||||
V(StackTrace, FixedArray) \
|
||||
V(StackFrame, StackFrameInfo) \
|
||||
V(Proxy, JSProxy) \
|
||||
V(debug::GeneratorObject, JSGeneratorObject) \
|
||||
V(debug::Script, Script) \
|
||||
V(debug::WeakMap, JSWeakMap) \
|
||||
V(Promise, JSPromise) \
|
||||
V(Primitive, Object) \
|
||||
V(PrimitiveArray, FixedArray) \
|
||||
V(BigInt, BigInt) \
|
||||
V(ScriptOrModule, Script)
|
||||
|
||||
class Utils {
|
||||
public:
|
||||
static inline bool ApiCheck(bool condition,
|
||||
const char* location,
|
||||
const char* message) {
|
||||
if (!condition) Utils::ReportApiFailure(location, message);
|
||||
return condition;
|
||||
}
|
||||
static void ReportOOMFailure(v8::internal::Isolate* isolate,
|
||||
const char* location, bool is_heap_oom);
|
||||
|
||||
static inline Local<Context> ToLocal(
|
||||
v8::internal::Handle<v8::internal::Context> obj);
|
||||
static inline Local<Value> ToLocal(
|
||||
v8::internal::Handle<v8::internal::Object> obj);
|
||||
static inline Local<Module> ToLocal(
|
||||
v8::internal::Handle<v8::internal::Module> obj);
|
||||
static inline Local<Name> ToLocal(
|
||||
v8::internal::Handle<v8::internal::Name> obj);
|
||||
static inline Local<String> ToLocal(
|
||||
v8::internal::Handle<v8::internal::String> obj);
|
||||
static inline Local<Symbol> ToLocal(
|
||||
v8::internal::Handle<v8::internal::Symbol> obj);
|
||||
static inline Local<RegExp> ToLocal(
|
||||
v8::internal::Handle<v8::internal::JSRegExp> obj);
|
||||
static inline Local<Object> ToLocal(
|
||||
v8::internal::Handle<v8::internal::JSReceiver> obj);
|
||||
static inline Local<Object> ToLocal(
|
||||
v8::internal::Handle<v8::internal::JSObject> obj);
|
||||
static inline Local<Function> ToLocal(
|
||||
v8::internal::Handle<v8::internal::JSFunction> obj);
|
||||
static inline Local<Array> ToLocal(
|
||||
v8::internal::Handle<v8::internal::JSArray> obj);
|
||||
static inline Local<Map> ToLocal(
|
||||
v8::internal::Handle<v8::internal::JSMap> obj);
|
||||
static inline Local<Set> ToLocal(
|
||||
v8::internal::Handle<v8::internal::JSSet> obj);
|
||||
static inline Local<Proxy> ToLocal(
|
||||
v8::internal::Handle<v8::internal::JSProxy> obj);
|
||||
static inline Local<ArrayBuffer> ToLocal(
|
||||
v8::internal::Handle<v8::internal::JSArrayBuffer> obj);
|
||||
static inline Local<ArrayBufferView> ToLocal(
|
||||
v8::internal::Handle<v8::internal::JSArrayBufferView> obj);
|
||||
static inline Local<DataView> ToLocal(
|
||||
v8::internal::Handle<v8::internal::JSDataView> obj);
|
||||
static inline Local<TypedArray> ToLocal(
|
||||
v8::internal::Handle<v8::internal::JSTypedArray> obj);
|
||||
static inline Local<Uint8Array> ToLocalUint8Array(
|
||||
v8::internal::Handle<v8::internal::JSTypedArray> obj);
|
||||
static inline Local<Uint8ClampedArray> ToLocalUint8ClampedArray(
|
||||
v8::internal::Handle<v8::internal::JSTypedArray> obj);
|
||||
static inline Local<Int8Array> ToLocalInt8Array(
|
||||
v8::internal::Handle<v8::internal::JSTypedArray> obj);
|
||||
static inline Local<Uint16Array> ToLocalUint16Array(
|
||||
v8::internal::Handle<v8::internal::JSTypedArray> obj);
|
||||
static inline Local<Int16Array> ToLocalInt16Array(
|
||||
v8::internal::Handle<v8::internal::JSTypedArray> obj);
|
||||
static inline Local<Uint32Array> ToLocalUint32Array(
|
||||
v8::internal::Handle<v8::internal::JSTypedArray> obj);
|
||||
static inline Local<Int32Array> ToLocalInt32Array(
|
||||
v8::internal::Handle<v8::internal::JSTypedArray> obj);
|
||||
static inline Local<Float32Array> ToLocalFloat32Array(
|
||||
v8::internal::Handle<v8::internal::JSTypedArray> obj);
|
||||
static inline Local<Float64Array> ToLocalFloat64Array(
|
||||
v8::internal::Handle<v8::internal::JSTypedArray> obj);
|
||||
static inline Local<BigInt64Array> ToLocalBigInt64Array(
|
||||
v8::internal::Handle<v8::internal::JSTypedArray> obj);
|
||||
static inline Local<BigUint64Array> ToLocalBigUint64Array(
|
||||
v8::internal::Handle<v8::internal::JSTypedArray> obj);
|
||||
|
||||
static inline Local<SharedArrayBuffer> ToLocalShared(
|
||||
v8::internal::Handle<v8::internal::JSArrayBuffer> obj);
|
||||
|
||||
static inline Local<Message> MessageToLocal(
|
||||
v8::internal::Handle<v8::internal::Object> obj);
|
||||
static inline Local<Promise> PromiseToLocal(
|
||||
v8::internal::Handle<v8::internal::JSObject> obj);
|
||||
static inline Local<StackTrace> StackTraceToLocal(
|
||||
v8::internal::Handle<v8::internal::FixedArray> obj);
|
||||
static inline Local<StackFrame> StackFrameToLocal(
|
||||
v8::internal::Handle<v8::internal::StackFrameInfo> obj);
|
||||
static inline Local<Number> NumberToLocal(
|
||||
v8::internal::Handle<v8::internal::Object> obj);
|
||||
static inline Local<Integer> IntegerToLocal(
|
||||
v8::internal::Handle<v8::internal::Object> obj);
|
||||
static inline Local<Uint32> Uint32ToLocal(
|
||||
v8::internal::Handle<v8::internal::Object> obj);
|
||||
static inline Local<BigInt> ToLocal(
|
||||
v8::internal::Handle<v8::internal::BigInt> obj);
|
||||
static inline Local<FunctionTemplate> ToLocal(
|
||||
v8::internal::Handle<v8::internal::FunctionTemplateInfo> obj);
|
||||
static inline Local<ObjectTemplate> ToLocal(
|
||||
v8::internal::Handle<v8::internal::ObjectTemplateInfo> obj);
|
||||
static inline Local<Signature> SignatureToLocal(
|
||||
v8::internal::Handle<v8::internal::FunctionTemplateInfo> obj);
|
||||
static inline Local<AccessorSignature> AccessorSignatureToLocal(
|
||||
v8::internal::Handle<v8::internal::FunctionTemplateInfo> obj);
|
||||
static inline Local<External> ExternalToLocal(
|
||||
v8::internal::Handle<v8::internal::JSObject> obj);
|
||||
static inline Local<Function> CallableToLocal(
|
||||
v8::internal::Handle<v8::internal::JSReceiver> obj);
|
||||
static inline Local<Primitive> ToLocalPrimitive(
|
||||
v8::internal::Handle<v8::internal::Object> obj);
|
||||
static inline Local<PrimitiveArray> ToLocal(
|
||||
v8::internal::Handle<v8::internal::FixedArray> obj);
|
||||
static inline Local<ScriptOrModule> ScriptOrModuleToLocal(
|
||||
v8::internal::Handle<v8::internal::Script> obj);
|
||||
|
||||
#define DECLARE_OPEN_HANDLE(From, To) \
|
||||
static inline v8::internal::Handle<v8::internal::To> \
|
||||
OpenHandle(const From* that, bool allow_empty_handle = false);
|
||||
|
||||
OPEN_HANDLE_LIST(DECLARE_OPEN_HANDLE)
|
||||
|
||||
#undef DECLARE_OPEN_HANDLE
|
||||
|
||||
template <class From, class To>
|
||||
static inline Local<To> Convert(v8::internal::Handle<From> obj);
|
||||
|
||||
template <class T>
|
||||
static inline v8::internal::Handle<v8::internal::Object> OpenPersistent(
|
||||
const v8::Persistent<T>& persistent) {
|
||||
return v8::internal::Handle<v8::internal::Object>(
|
||||
reinterpret_cast<v8::internal::Object**>(persistent.val_));
|
||||
}
|
||||
|
||||
template <class T>
|
||||
static inline v8::internal::Handle<v8::internal::Object> OpenPersistent(
|
||||
v8::Persistent<T>* persistent) {
|
||||
return OpenPersistent(*persistent);
|
||||
}
|
||||
|
||||
template <class From, class To>
|
||||
static inline v8::internal::Handle<To> OpenHandle(v8::Local<From> handle) {
|
||||
return OpenHandle(*handle);
|
||||
}
|
||||
|
||||
private:
|
||||
static void ReportApiFailure(const char* location, const char* message);
|
||||
};
|
||||
|
||||
|
||||
template <class T>
|
||||
inline T* ToApi(v8::internal::Handle<v8::internal::Object> obj) {
|
||||
return reinterpret_cast<T*>(obj.location());
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline v8::Local<T> ToApiHandle(
|
||||
v8::internal::Handle<v8::internal::Object> obj) {
|
||||
return Utils::Convert<v8::internal::Object, T>(obj);
|
||||
}
|
||||
|
||||
|
||||
template <class T>
|
||||
inline bool ToLocal(v8::internal::MaybeHandle<v8::internal::Object> maybe,
|
||||
Local<T>* local) {
|
||||
v8::internal::Handle<v8::internal::Object> handle;
|
||||
if (maybe.ToHandle(&handle)) {
|
||||
*local = Utils::Convert<v8::internal::Object, T>(handle);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
namespace internal {
|
||||
|
||||
class V8_EXPORT_PRIVATE DeferredHandles {
|
||||
public:
|
||||
~DeferredHandles();
|
||||
|
||||
private:
|
||||
DeferredHandles(Object** first_block_limit, Isolate* isolate)
|
||||
: next_(nullptr),
|
||||
previous_(nullptr),
|
||||
first_block_limit_(first_block_limit),
|
||||
isolate_(isolate) {
|
||||
isolate->LinkDeferredHandles(this);
|
||||
}
|
||||
|
||||
void Iterate(RootVisitor* v);
|
||||
|
||||
std::vector<Object**> blocks_;
|
||||
DeferredHandles* next_;
|
||||
DeferredHandles* previous_;
|
||||
Object** first_block_limit_;
|
||||
Isolate* isolate_;
|
||||
|
||||
friend class HandleScopeImplementer;
|
||||
friend class Isolate;
|
||||
};
|
||||
|
||||
|
||||
// This class is here in order to be able to declare it a friend of
|
||||
// HandleScope. Moving these methods to be members of HandleScope would be
|
||||
// neat in some ways, but it would expose internal implementation details in
|
||||
// our public header file, which is undesirable.
|
||||
//
|
||||
// An isolate has a single instance of this class to hold the current thread's
|
||||
// data. In multithreaded V8 programs this data is copied in and out of storage
|
||||
// so that the currently executing thread always has its own copy of this
|
||||
// data.
|
||||
class HandleScopeImplementer {
|
||||
public:
|
||||
explicit HandleScopeImplementer(Isolate* isolate)
|
||||
: isolate_(isolate),
|
||||
microtask_context_(nullptr),
|
||||
spare_(nullptr),
|
||||
call_depth_(0),
|
||||
microtasks_depth_(0),
|
||||
microtasks_suppressions_(0),
|
||||
entered_contexts_count_(0),
|
||||
entered_context_count_during_microtasks_(0),
|
||||
#ifdef DEBUG
|
||||
debug_microtasks_depth_(0),
|
||||
#endif
|
||||
microtasks_policy_(v8::MicrotasksPolicy::kAuto),
|
||||
last_handle_before_deferred_block_(nullptr) {
|
||||
}
|
||||
|
||||
~HandleScopeImplementer() {
|
||||
DeleteArray(spare_);
|
||||
}
|
||||
|
||||
// Threading support for handle data.
|
||||
static int ArchiveSpacePerThread();
|
||||
char* RestoreThread(char* from);
|
||||
char* ArchiveThread(char* to);
|
||||
void FreeThreadResources();
|
||||
|
||||
// Garbage collection support.
|
||||
void Iterate(v8::internal::RootVisitor* v);
|
||||
static char* Iterate(v8::internal::RootVisitor* v, char* data);
|
||||
|
||||
inline internal::Object** GetSpareOrNewBlock();
|
||||
inline void DeleteExtensions(internal::Object** prev_limit);
|
||||
|
||||
// Call depth represents nested v8 api calls.
|
||||
inline void IncrementCallDepth() {call_depth_++;}
|
||||
inline void DecrementCallDepth() {call_depth_--;}
|
||||
inline bool CallDepthIsZero() { return call_depth_ == 0; }
|
||||
|
||||
// Microtasks scope depth represents nested scopes controlling microtasks
|
||||
// invocation, which happens when depth reaches zero.
|
||||
inline void IncrementMicrotasksScopeDepth() {microtasks_depth_++;}
|
||||
inline void DecrementMicrotasksScopeDepth() {microtasks_depth_--;}
|
||||
inline int GetMicrotasksScopeDepth() { return microtasks_depth_; }
|
||||
|
||||
// Possibly nested microtasks suppression scopes prevent microtasks
|
||||
// from running.
|
||||
inline void IncrementMicrotasksSuppressions() {microtasks_suppressions_++;}
|
||||
inline void DecrementMicrotasksSuppressions() {microtasks_suppressions_--;}
|
||||
inline bool HasMicrotasksSuppressions() { return !!microtasks_suppressions_; }
|
||||
|
||||
#ifdef DEBUG
|
||||
// In debug we check that calls not intended to invoke microtasks are
|
||||
// still correctly wrapped with microtask scopes.
|
||||
inline void IncrementDebugMicrotasksScopeDepth() {debug_microtasks_depth_++;}
|
||||
inline void DecrementDebugMicrotasksScopeDepth() {debug_microtasks_depth_--;}
|
||||
inline bool DebugMicrotasksScopeDepthIsZero() {
|
||||
return debug_microtasks_depth_ == 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
inline void set_microtasks_policy(v8::MicrotasksPolicy policy);
|
||||
inline v8::MicrotasksPolicy microtasks_policy() const;
|
||||
|
||||
inline void EnterContext(Handle<Context> context);
|
||||
inline void LeaveContext();
|
||||
inline bool LastEnteredContextWas(Handle<Context> context);
|
||||
|
||||
// Returns the last entered context or an empty handle if no
|
||||
// contexts have been entered.
|
||||
inline Handle<Context> LastEnteredContext();
|
||||
|
||||
inline void EnterMicrotaskContext(Handle<Context> context);
|
||||
inline void LeaveMicrotaskContext();
|
||||
inline Handle<Context> MicrotaskContext();
|
||||
inline bool MicrotaskContextIsLastEnteredContext() const {
|
||||
return microtask_context_ &&
|
||||
entered_context_count_during_microtasks_ == entered_contexts_.size();
|
||||
}
|
||||
|
||||
inline void SaveContext(Context* context);
|
||||
inline Context* RestoreContext();
|
||||
inline bool HasSavedContexts();
|
||||
|
||||
inline DetachableVector<Object**>* blocks() { return &blocks_; }
|
||||
Isolate* isolate() const { return isolate_; }
|
||||
|
||||
void ReturnBlock(Object** block) {
|
||||
DCHECK_NOT_NULL(block);
|
||||
if (spare_ != nullptr) DeleteArray(spare_);
|
||||
spare_ = block;
|
||||
}
|
||||
|
||||
private:
|
||||
void ResetAfterArchive() {
|
||||
blocks_.detach();
|
||||
entered_contexts_.detach();
|
||||
saved_contexts_.detach();
|
||||
microtask_context_ = nullptr;
|
||||
entered_context_count_during_microtasks_ = 0;
|
||||
spare_ = nullptr;
|
||||
last_handle_before_deferred_block_ = nullptr;
|
||||
call_depth_ = 0;
|
||||
}
|
||||
|
||||
void Free() {
|
||||
DCHECK(blocks_.empty());
|
||||
DCHECK(entered_contexts_.empty());
|
||||
DCHECK(saved_contexts_.empty());
|
||||
DCHECK(!microtask_context_);
|
||||
|
||||
blocks_.free();
|
||||
entered_contexts_.free();
|
||||
saved_contexts_.free();
|
||||
if (spare_ != nullptr) {
|
||||
DeleteArray(spare_);
|
||||
spare_ = nullptr;
|
||||
}
|
||||
DCHECK_EQ(call_depth_, 0);
|
||||
}
|
||||
|
||||
void BeginDeferredScope();
|
||||
DeferredHandles* Detach(Object** prev_limit);
|
||||
|
||||
Isolate* isolate_;
|
||||
DetachableVector<Object**> blocks_;
|
||||
// Used as a stack to keep track of entered contexts.
|
||||
DetachableVector<Context*> entered_contexts_;
|
||||
// Used as a stack to keep track of saved contexts.
|
||||
DetachableVector<Context*> saved_contexts_;
|
||||
Context* microtask_context_;
|
||||
Object** spare_;
|
||||
int call_depth_;
|
||||
int microtasks_depth_;
|
||||
int microtasks_suppressions_;
|
||||
size_t entered_contexts_count_;
|
||||
size_t entered_context_count_during_microtasks_;
|
||||
#ifdef DEBUG
|
||||
int debug_microtasks_depth_;
|
||||
#endif
|
||||
v8::MicrotasksPolicy microtasks_policy_;
|
||||
Object** last_handle_before_deferred_block_;
|
||||
// This is only used for threading support.
|
||||
HandleScopeData handle_scope_data_;
|
||||
|
||||
void IterateThis(RootVisitor* v);
|
||||
char* RestoreThreadHelper(char* from);
|
||||
char* ArchiveThreadHelper(char* to);
|
||||
|
||||
friend class DeferredHandles;
|
||||
friend class DeferredHandleScope;
|
||||
friend class HandleScopeImplementerOffsets;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(HandleScopeImplementer);
|
||||
};
|
||||
|
||||
class HandleScopeImplementerOffsets {
|
||||
public:
|
||||
enum Offsets {
|
||||
kMicrotaskContext = offsetof(HandleScopeImplementer, microtask_context_),
|
||||
kEnteredContexts = offsetof(HandleScopeImplementer, entered_contexts_),
|
||||
kEnteredContextsCount =
|
||||
offsetof(HandleScopeImplementer, entered_contexts_count_),
|
||||
kEnteredContextCountDuringMicrotasks = offsetof(
|
||||
HandleScopeImplementer, entered_context_count_during_microtasks_)
|
||||
};
|
||||
|
||||
private:
|
||||
DISALLOW_IMPLICIT_CONSTRUCTORS(HandleScopeImplementerOffsets);
|
||||
};
|
||||
|
||||
const int kHandleBlockSize = v8::internal::KB - 2; // fit in one page
|
||||
|
||||
|
||||
void HandleScopeImplementer::set_microtasks_policy(
|
||||
v8::MicrotasksPolicy policy) {
|
||||
microtasks_policy_ = policy;
|
||||
}
|
||||
|
||||
|
||||
v8::MicrotasksPolicy HandleScopeImplementer::microtasks_policy() const {
|
||||
return microtasks_policy_;
|
||||
}
|
||||
|
||||
|
||||
void HandleScopeImplementer::SaveContext(Context* context) {
|
||||
saved_contexts_.push_back(context);
|
||||
}
|
||||
|
||||
|
||||
Context* HandleScopeImplementer::RestoreContext() {
|
||||
Context* last_context = saved_contexts_.back();
|
||||
saved_contexts_.pop_back();
|
||||
return last_context;
|
||||
}
|
||||
|
||||
|
||||
bool HandleScopeImplementer::HasSavedContexts() {
|
||||
return !saved_contexts_.empty();
|
||||
}
|
||||
|
||||
|
||||
void HandleScopeImplementer::EnterContext(Handle<Context> context) {
|
||||
entered_contexts_.push_back(*context);
|
||||
entered_contexts_count_ = entered_contexts_.size();
|
||||
}
|
||||
|
||||
void HandleScopeImplementer::LeaveContext() {
|
||||
entered_contexts_.pop_back();
|
||||
entered_contexts_count_ = entered_contexts_.size();
|
||||
}
|
||||
|
||||
bool HandleScopeImplementer::LastEnteredContextWas(Handle<Context> context) {
|
||||
return !entered_contexts_.empty() && entered_contexts_.back() == *context;
|
||||
}
|
||||
|
||||
void HandleScopeImplementer::EnterMicrotaskContext(Handle<Context> context) {
|
||||
DCHECK(!microtask_context_);
|
||||
microtask_context_ = *context;
|
||||
entered_context_count_during_microtasks_ = entered_contexts_.size();
|
||||
}
|
||||
|
||||
void HandleScopeImplementer::LeaveMicrotaskContext() {
|
||||
microtask_context_ = nullptr;
|
||||
entered_context_count_during_microtasks_ = 0;
|
||||
}
|
||||
|
||||
// If there's a spare block, use it for growing the current scope.
|
||||
internal::Object** HandleScopeImplementer::GetSpareOrNewBlock() {
|
||||
internal::Object** block =
|
||||
(spare_ != nullptr) ? spare_
|
||||
: NewArray<internal::Object*>(kHandleBlockSize);
|
||||
spare_ = nullptr;
|
||||
return block;
|
||||
}
|
||||
|
||||
|
||||
void HandleScopeImplementer::DeleteExtensions(internal::Object** prev_limit) {
|
||||
while (!blocks_.empty()) {
|
||||
internal::Object** block_start = blocks_.back();
|
||||
internal::Object** block_limit = block_start + kHandleBlockSize;
|
||||
|
||||
// SealHandleScope may make the prev_limit to point inside the block.
|
||||
if (block_start <= prev_limit && prev_limit <= block_limit) {
|
||||
#ifdef ENABLE_HANDLE_ZAPPING
|
||||
internal::HandleScope::ZapRange(prev_limit, block_limit);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
||||
blocks_.pop_back();
|
||||
#ifdef ENABLE_HANDLE_ZAPPING
|
||||
internal::HandleScope::ZapRange(block_start, block_limit);
|
||||
#endif
|
||||
if (spare_ != nullptr) {
|
||||
DeleteArray(spare_);
|
||||
}
|
||||
spare_ = block_start;
|
||||
}
|
||||
DCHECK((blocks_.empty() && prev_limit == nullptr) ||
|
||||
(!blocks_.empty() && prev_limit != nullptr));
|
||||
}
|
||||
|
||||
// Interceptor functions called from generated inline caches to notify
|
||||
// CPU profiler that external callbacks are invoked.
|
||||
void InvokeAccessorGetterCallback(
|
||||
v8::Local<v8::Name> property,
|
||||
const v8::PropertyCallbackInfo<v8::Value>& info,
|
||||
v8::AccessorNameGetterCallback getter);
|
||||
|
||||
void InvokeFunctionCallback(const v8::FunctionCallbackInfo<v8::Value>& info,
|
||||
v8::FunctionCallback callback);
|
||||
|
||||
class Testing {
|
||||
public:
|
||||
static v8::Testing::StressType stress_type() { return stress_type_; }
|
||||
static void set_stress_type(v8::Testing::StressType stress_type) {
|
||||
stress_type_ = stress_type;
|
||||
}
|
||||
|
||||
private:
|
||||
static v8::Testing::StressType stress_type_;
|
||||
};
|
||||
|
||||
} // namespace internal
|
||||
} // namespace v8
|
||||
|
||||
#endif // V8_API_H_
|
||||
@@ -1,54 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace NightOwl.demo
|
||||
{
|
||||
public class CSharp
|
||||
{
|
||||
private readonly string _testField;
|
||||
|
||||
public string TestProperty { get; set; }
|
||||
|
||||
#region RegionTest
|
||||
public string Getter => TestProperty;
|
||||
|
||||
public CSharp(string testField)
|
||||
{
|
||||
_testField = testField;
|
||||
string text = $"{TestProperty} this is a text string";
|
||||
int number = 1;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Hello this is an xml comment
|
||||
/// </summary>
|
||||
/// <param name="testParam">param comment</param>
|
||||
/// <returns></returns>
|
||||
public async Task<string> TestMethod(string testParam)
|
||||
{
|
||||
for(var i = 0; i <= 5; i++)
|
||||
{
|
||||
testParam.Trim();
|
||||
_testField?.Trim();
|
||||
|
||||
var enumVal = (int)TestEnum.TestValue;
|
||||
|
||||
|
||||
// Hello this is a normal comment
|
||||
new List<string>().Where(c => c == "Test");
|
||||
}
|
||||
|
||||
return await Task.FromResult(testParam);
|
||||
}
|
||||
}
|
||||
|
||||
public enum TestEnum
|
||||
{
|
||||
TestValue
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
.someClass {
|
||||
font-family: serif;
|
||||
}
|
||||
|
||||
#someID {
|
||||
background: yellow;
|
||||
}
|
||||
|
||||
main {
|
||||
margin-top: 20px;
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
main : Program Never Model Msg
|
||||
main =
|
||||
program
|
||||
{ init = init
|
||||
, view = view
|
||||
, update = update
|
||||
, subscriptions = subscriptions
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
import 'package:flutter/material.dart' as material;
|
||||
|
||||
void main(){
|
||||
runApp(
|
||||
new MaterialApp(
|
||||
home: new MyButton(),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
class MyButton extends StatefulWidget{
|
||||
@override
|
||||
MyButtonState createState() => new MyButtonState();
|
||||
}
|
||||
|
||||
class MyButtonState extends State<MyButton>{
|
||||
String flutterText = "";
|
||||
List<String> collection = ['Flutter', 'is', 'great'];
|
||||
int index = 0;
|
||||
|
||||
void changeText(){
|
||||
setState(
|
||||
() {
|
||||
flutterText = collection[index];
|
||||
index++;
|
||||
index = index % 3;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context){
|
||||
return new Scaffold(
|
||||
appBar: new AppBar(
|
||||
title: new Text("Stateful Widget"),
|
||||
backgroundColor: Colors.orangeAccent,
|
||||
),
|
||||
body: Center(
|
||||
child: new Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
new Text(
|
||||
flutterText,
|
||||
style: new TextStyle(fontSize: 40.0)
|
||||
),
|
||||
new Padding(
|
||||
padding: new EdgeInsets.all(10.0)
|
||||
),
|
||||
new RaisedButton(
|
||||
child: new Text(
|
||||
"Update",
|
||||
style: new TextStyle(color: Colors.white)
|
||||
),
|
||||
color: Colors.blueAccent,
|
||||
onPressed: changeText,
|
||||
)
|
||||
],
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<title>Document</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app">Tacos Tacos</div>
|
||||
|
||||
<p>Tacos tacos tacos</p>
|
||||
<!--comment-->
|
||||
|
||||
<script>
|
||||
var x = '100';
|
||||
x.toString();
|
||||
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -1,29 +0,0 @@
|
||||
import React from 'react'
|
||||
import calculate from '../logic/calculate'
|
||||
import './App.css'
|
||||
import ButtonPanel from './ButtonPanel'
|
||||
import Display from './Display'
|
||||
|
||||
class App extends React.Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.state = {
|
||||
total: null
|
||||
}
|
||||
}
|
||||
|
||||
handleClick = buttonName => {
|
||||
this.setState(calculate(this.state, buttonName))
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div className="component-app">
|
||||
Tacos
|
||||
<Display value={this.state.next || this.state.total || '0'} />
|
||||
<ButtonPanel clickHandler={this.handleClick} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
export default App
|
||||
@@ -1,29 +0,0 @@
|
||||
import React from 'react'
|
||||
import calculate from '../logic/calculate'
|
||||
import './App.css'
|
||||
import ButtonPanel from './ButtonPanel'
|
||||
import Display from './Display'
|
||||
|
||||
class App extends React.Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.state = {
|
||||
total: null
|
||||
}
|
||||
}
|
||||
|
||||
handleClick = buttonName => {
|
||||
this.setState(calculate(this.state, buttonName))
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div className="component-app">
|
||||
Tacos
|
||||
<Display value={this.state.next || this.state.total || '0'} />
|
||||
<ButtonPanel clickHandler={this.handleClick} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
export default App
|
||||
@@ -1,73 +0,0 @@
|
||||
'use strict'
|
||||
class Sale {
|
||||
constructor(price) {
|
||||
;[this.decoratorsList, this.price] = [[], price]
|
||||
}
|
||||
|
||||
decorate(decorator) {
|
||||
if (!Sale[decorator]) throw new Error(`decorator not exist: ${decorator}`)
|
||||
this.decoratorsList.push(Sale[decorator])
|
||||
}
|
||||
|
||||
getPrice() {
|
||||
for (let decorator of this.decoratorsList) {
|
||||
this.price = decorator(this.price)
|
||||
}
|
||||
return this.price.toFixed(2)
|
||||
}
|
||||
|
||||
static quebec(price) {
|
||||
// this is a comment
|
||||
return price + price * 7.5 / 100
|
||||
}
|
||||
|
||||
static fedtax(price) {
|
||||
return price + price * 5 / 100
|
||||
}
|
||||
}
|
||||
|
||||
let sale = new Sale(100)
|
||||
sale.decorate('fedtax')
|
||||
sale.decorate('quebec')
|
||||
console.log(sale.getPrice()) //112.88
|
||||
|
||||
getPrice()
|
||||
|
||||
//deeply nested
|
||||
|
||||
async function asyncCall() {
|
||||
var result = await resolveAfter2Seconds();
|
||||
}
|
||||
|
||||
const options = {
|
||||
connections: {
|
||||
compression: false
|
||||
}
|
||||
}
|
||||
|
||||
for (let i = 0; i < 10; i++) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (true) { }
|
||||
|
||||
while (true) { }
|
||||
|
||||
switch (2) {
|
||||
case 2:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
class EditFishForm extends Component {
|
||||
static propTypes = {
|
||||
updateFish: PropTypes.func,
|
||||
deleteFish: PropTypes.func,
|
||||
index: PropTypes.string,
|
||||
fish: PropTypes.shape({
|
||||
image: PropTypes.string,
|
||||
name: PropTypes.string.isRequired
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
{
|
||||
"env": {
|
||||
"es6": true,
|
||||
"mocha": true,
|
||||
"node": true
|
||||
},
|
||||
"extends": "eslint:recommended",
|
||||
"rules": {
|
||||
"indent": ["error", 2],
|
||||
"linebreak-style": ["error", "unix"],
|
||||
"quotes": ["error", "single"],
|
||||
"semi": ["error", "always"]
|
||||
}
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
# Night Owl Theme
|
||||
|
||||
> Night Owl theme for VS Code.
|
||||
|
||||

|
||||
|
||||
# Installation
|
||||
|
||||
1. Install [Visual Studio Code](https://code.visualstudio.com/)
|
||||
2. Launch Visual Studio Code
|
||||
3. Choose **Extensions** from menu
|
||||
4. Search for `night-owl`
|
||||
5. Click **Install** to install it
|
||||
6. Click **Reload** to reload the Code
|
||||
7. File > Preferences > Color Theme > **Night Owl**
|
||||
|
||||
-[ ] check check 12 12
|
||||
-[ ] check check 12 12
|
||||
|
||||
Heading 1
|
||||
========
|
||||
|
||||
Heading 2
|
||||
--------------
|
||||
|
||||
### Heading 3
|
||||
@@ -1,36 +0,0 @@
|
||||
<?php
|
||||
class HelloWorldTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @var PDO
|
||||
*/
|
||||
private $pdo;
|
||||
public function setUp()
|
||||
{
|
||||
$this->pdo = new PDO($GLOBALS['db_dsn'], $GLOBALS['db_username'], $GLOBALS['db_password']);
|
||||
$this->pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
$this->pdo->query("CREATE TABLE hello (what VARCHAR(50) NOT NULL)");
|
||||
}
|
||||
public function tearDown()
|
||||
{
|
||||
$this->pdo->query("DROP TABLE hello");
|
||||
}
|
||||
public function testHelloWorld()
|
||||
{
|
||||
$helloWorld = new HelloWorld($this->pdo);
|
||||
$this->assertEquals('Hello World', $helloWorld->hello());
|
||||
}
|
||||
public function testHello()
|
||||
{
|
||||
$helloWorld = new HelloWorld($this->pdo);
|
||||
$this->assertEquals('Hello Bar', $helloWorld->hello('Bar'));
|
||||
}
|
||||
public function testWhat()
|
||||
{
|
||||
$helloWorld = new HelloWorld($this->pdo);
|
||||
$this->assertFalse($helloWorld->what());
|
||||
$helloWorld->hello('Bar');
|
||||
$this->assertEquals('Bar', $helloWorld->what());
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -1,68 +0,0 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Provisions a example powershell function
|
||||
.EXAMPLE
|
||||
PS C:\> .\powershell.ps1 -Argument1 "hola soy un texto"
|
||||
#>
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
[Parameter(Mandatory = $true, HelpMessage = "This argument is required")]
|
||||
[String]
|
||||
$textParameter
|
||||
)
|
||||
|
||||
try {
|
||||
#almost every function is called like this:
|
||||
Write-Host "Initializing example function"
|
||||
Write-Host "The parameter is " $textParameter -ForegroundColor Red
|
||||
|
||||
#this are variables
|
||||
$customArray = @(
|
||||
@{
|
||||
Id = 1;
|
||||
Value = "I'm an option";
|
||||
},
|
||||
@{
|
||||
Id = 2;
|
||||
Value = "Option No. 2";
|
||||
}
|
||||
)
|
||||
|
||||
foreach ($option in $customArray) {
|
||||
Write-Host "Iterating options:" $option.Value
|
||||
}
|
||||
|
||||
$collectionWithItems = New-Object System.Collections.ArrayList
|
||||
$temp = New-Object System.Object
|
||||
$temp | Add-Member -MemberType NoteProperty -Name "Title" -Value "Custom Object Title 1"
|
||||
$temp | Add-Member -MemberType NoteProperty -Name "Subject" -Value "Delegación del plan de acción [Folio_PlandeAccion]"
|
||||
$temp | Add-Member -MemberType NoteProperty -Name "Body" -Value "<div>This s a note example, with lots of text</div>
|
||||
<div> <br/> </div>
|
||||
<div>It happens to be in html format, but is just text the property couldnt't know<br/></div>
|
||||
<div><br/> <br/></div>
|
||||
<div>It's up for the one who uses me to render me correctly. <a href='/ligaPlanAccion'>Or not.</a></div>"
|
||||
$collectionWithItems.Add($temp) | Out-Null
|
||||
Write-Host "My collection has" $collectionWithItems.Count "item(s)" -ForegroundColor Green
|
||||
|
||||
#Calling some other scripts. Sometimes its nice to have a "master" script and call subscripts with other functions / actions
|
||||
.\otherscript.ps1 "Parameter ?"
|
||||
.\thisonewithoutparams.ps1
|
||||
|
||||
#little bit of SharePoint *the original issue* :D
|
||||
$web = Get-SPWeb http://mysharepointsite
|
||||
$list = $web.Lists["ListName"]
|
||||
$query = New-Object Microsoft.SharePoint.SPQuery
|
||||
$query.Query= "CAMLQuery here"
|
||||
$query.ViewFields= "<FieldRef Name='ID'/><FieldRef Name='Title'/>"
|
||||
$query.ViewFieldsOnly= $true
|
||||
$listitems = $list.GetItems($query);
|
||||
foreach($item in $listitems) {
|
||||
if($item -ne $null) {
|
||||
Write-Host "There is an elmeent in the list, id" $item.ID
|
||||
}
|
||||
}
|
||||
}
|
||||
catch {
|
||||
Write-Host -ForegroundColor Red "Exception Type: $($_.Exception.GetType().FullName)"
|
||||
Write-Host -ForegroundColor Red "Exception Message: $($_.Exception.Message)"
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
html(lang="en")
|
||||
|
||||
head
|
||||
meta(charset="UTF-8")
|
||||
meta(name="viewport", content="width=device-width, initial-scale=1.0")
|
||||
meta(http-equiv="X-UA-Compatible", content="ie=edge")
|
||||
title Document
|
||||
|
||||
body
|
||||
h1 Pug
|
||||
@@ -1,34 +0,0 @@
|
||||
from collections import deque
|
||||
|
||||
|
||||
def topo(G, ind=None, Q=[1]):
|
||||
if ind == None:
|
||||
ind = [0] * (len(G) + 1) # this is a comment
|
||||
for u in G:
|
||||
for v in G[u]:
|
||||
ind[v] += 1
|
||||
Q = deque()
|
||||
for i in G:
|
||||
if ind[i] == 0:
|
||||
Q.append(i)
|
||||
if len(Q) == 0:
|
||||
return
|
||||
v = Q.popleft()
|
||||
print(v)
|
||||
for w in G[v]:
|
||||
ind[w] -= 1
|
||||
if ind[w] == 0:
|
||||
Q.append(w)
|
||||
topo(G, ind, Q)
|
||||
|
||||
|
||||
class SomeClass:
|
||||
def create_arr(self): # An instance method
|
||||
self.arr = []
|
||||
|
||||
def insert_to_arr(self, value): #An instance method
|
||||
self.arr.append(value)
|
||||
|
||||
@classmethod
|
||||
def class_method(cls):
|
||||
print("the class method was called")
|
||||
@@ -1,31 +0,0 @@
|
||||
import React from 'react';
|
||||
import calculate from '../logic/calculate';
|
||||
import './App.css';
|
||||
import ButtonPanel from './ButtonPanel';
|
||||
import Display from './Display';
|
||||
|
||||
class App extends React.Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.state = {
|
||||
total: null,
|
||||
next: null,
|
||||
operation: null
|
||||
}
|
||||
}
|
||||
|
||||
handleClick = buttonName => {
|
||||
this.setState(calculate(this.state, buttonName))
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div className="component-app">
|
||||
Tacos
|
||||
<Display value={this.state.next || this.state.total || '0'} />
|
||||
<ButtonPanel clickHandler={this.handleClick} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
export default App
|
||||
@@ -1,20 +0,0 @@
|
||||
import React, { useState, useEffect } from 'react';
|
||||
|
||||
function Example() {
|
||||
const [count, setCount] = useState(0);
|
||||
|
||||
// Similar to componentDidMount and componentDidUpdate:
|
||||
useEffect(() => {
|
||||
// Update the document title using the browser API
|
||||
document.title = `You clicked ${count} times`;
|
||||
});
|
||||
|
||||
return (
|
||||
<div>
|
||||
<p>You clicked {count} times</p>
|
||||
<button onClick={() => setCount(count + 1)}>
|
||||
Click me
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -1,96 +0,0 @@
|
||||
module ExampleModule
|
||||
class ExampleClass::ScopeResolution < NewScope::Operator
|
||||
include Another::Scoped::Module
|
||||
|
||||
def initialize(options)
|
||||
@@class_var = options[:class]
|
||||
@instance_var = options[:instance]
|
||||
|
||||
config.data = []
|
||||
config.actions = []
|
||||
|
||||
new.run
|
||||
end
|
||||
|
||||
def method_examples
|
||||
method_with_args(:arg)
|
||||
method_no_args
|
||||
# method defined on base ruby object
|
||||
method(:array_access)
|
||||
end
|
||||
|
||||
def array_access
|
||||
array = ([1, 2] << 3).uniq
|
||||
array[1]
|
||||
array[dynamic_key]
|
||||
end
|
||||
|
||||
def blocks
|
||||
yield if block_given?
|
||||
[1].each do |num|
|
||||
do_something
|
||||
end
|
||||
|
||||
[2].each { |num| do_something }
|
||||
lambda { do_something }
|
||||
->(arg1) { do_something}
|
||||
Proc.new { |arg| do_something }
|
||||
end
|
||||
|
||||
def hash_access
|
||||
symbol_hash = {
|
||||
key1: 'info',
|
||||
key2: 'info',
|
||||
}.compact
|
||||
|
||||
string_hash = {
|
||||
method_key => 'info',
|
||||
'key2' => 'info',
|
||||
}
|
||||
|
||||
symbol_hash[:key1]
|
||||
string_hash['key2']
|
||||
end
|
||||
|
||||
def output
|
||||
puts 'Output here'
|
||||
pp 'Output here'
|
||||
end
|
||||
|
||||
def self.class_method
|
||||
return "I am a class method!"
|
||||
end
|
||||
|
||||
class << self
|
||||
def another_private_method(arg1, default_arg = {}, **args, &block); end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def other_method(*args)
|
||||
puts "doing other stuff #{42}"
|
||||
end
|
||||
|
||||
def self.private
|
||||
[1, 2, 3].each do |item|
|
||||
puts item
|
||||
end
|
||||
end
|
||||
|
||||
private_class_method :private
|
||||
|
||||
private
|
||||
|
||||
def user_params
|
||||
params.require(:user).permit(:username, :email, :password)
|
||||
params.pluck(:user)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
ExampleModule::ExampleClass::ScopeResolution
|
||||
example_instance = ExampleModule::ExampleClass::ScopeResolution.new(:arg)
|
||||
|
||||
example_instance.method(:arg) do
|
||||
puts 'yielding in block!'
|
||||
end
|
||||
@@ -1,35 +0,0 @@
|
||||
// I use this syntax when my component fits on one line
|
||||
const ListItem = props => <li className="list-item">{props.item.name}</li>
|
||||
|
||||
// I use this when my component has no logic outside JSX
|
||||
const List = ({ items }) => (
|
||||
<ul className="list">{items.map(item => <ListItem item={item} />)}</ul>
|
||||
)
|
||||
|
||||
// I use this when the component needs logic outside JSX.
|
||||
const Body = props => {
|
||||
let items = transformItems(props.rawItems)
|
||||
return (
|
||||
<div>
|
||||
<h1>{props.header}</h1>
|
||||
<List items={items} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
const Foo = () => <div>
|
||||
<div></div>
|
||||
</div>
|
||||
|
||||
// This is equivalent to the last example
|
||||
function Page(props, context) {
|
||||
return (
|
||||
<div>
|
||||
<Body header="My List" rawItems={props.rawItems} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
// propTypes and contextTypes are supported
|
||||
Page.propTypes = {
|
||||
rawItems: React.PropTypes.array.isRequired
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
.someClass {
|
||||
font-family: serif;
|
||||
}
|
||||
|
||||
#someID {
|
||||
background: yellow;
|
||||
}
|
||||
|
||||
main {
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.someotherclass {
|
||||
padding: 20px;
|
||||
box-shadow: 0 0 0 2px inset;
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
import { Component, OnInit, OnDestroy } from '@angular/core'
|
||||
import { Person, SearchService } from '../shared'
|
||||
import { ActivatedRoute } from '@angular/router'
|
||||
import { Subscription } from 'rxjs'
|
||||
|
||||
@Component({
|
||||
selector: 'app-search',
|
||||
templateUrl: './search.component.html',
|
||||
styleUrls: ['./search.component.css']
|
||||
})
|
||||
export class SearchComponent implements OnInit, OnDestroy {
|
||||
query: string
|
||||
searchResults: Array<Person>
|
||||
sub: Subscription
|
||||
|
||||
constructor(
|
||||
private searchService: SearchService,
|
||||
private route: ActivatedRoute
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.sub = this.route.params.subscribe(params => {
|
||||
if (params['term']) {
|
||||
this.query = decodeURIComponent(params['term'])
|
||||
this.search()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
search(): void {
|
||||
this.searchService.search(this.query).subscribe(
|
||||
(data: any) => {
|
||||
this.searchResults = data
|
||||
},
|
||||
error => console.log(error)
|
||||
)
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
if (this.sub) {
|
||||
this.sub.unsubscribe()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<AppSelect />
|
||||
<button
|
||||
@click="getNewIntent"
|
||||
:class="{ disabled: uiState === 'listening' }"
|
||||
></button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
aborted: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
uiState() {
|
||||
return this.$store.state.uiState;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
getNewIntent() {
|
||||
this.$store.dispatch("getSpeech");
|
||||
this.$emit("isaborted", false);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
button {
|
||||
border-radius: 1000px;
|
||||
background: teal;
|
||||
margin-top: 10px;
|
||||
transition: 0.3s all ease-out;
|
||||
}
|
||||
|
||||
button.disabled {
|
||||
background: #ccc;
|
||||
cursor: none;
|
||||
}
|
||||
</style>
|
||||
@@ -1,13 +0,0 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- "6"
|
||||
install:
|
||||
- npm install
|
||||
script:
|
||||
- npm test
|
||||
after_script:
|
||||
- npm run coveralls
|
||||
notifications:
|
||||
email:
|
||||
on_success: never
|
||||
on_failure: always
|
||||
|
Before Width: | Height: | Size: 88 KiB |
|
Before Width: | Height: | Size: 89 KiB |
|
Before Width: | Height: | Size: 9.9 KiB |
@@ -1,73 +0,0 @@
|
||||
{
|
||||
"name": "night-owl",
|
||||
"displayName": "Night Owl",
|
||||
"description": "A VS Code theme for the night owls out there. Now introducing Light Owl theme for daytime usage. Decisions were based on meaningful contrast for reading comprehension and for optimal razzle dazzle. ✨",
|
||||
"version": "2.0.1",
|
||||
"publisher": "sdras",
|
||||
"license": "SEE LICENSE IN LICENSE.md",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sdras/night-owl-vscode-theme"
|
||||
},
|
||||
"keywords": [
|
||||
"Theme",
|
||||
"Dark Theme",
|
||||
"Light Theme",
|
||||
"Night Owl",
|
||||
"Night Theme",
|
||||
"Light Owl",
|
||||
"Snow Owl",
|
||||
"Early Bird",
|
||||
"Accessible Theme"
|
||||
],
|
||||
"scripts": {
|
||||
"publish": "vsce publish"
|
||||
},
|
||||
"galleryBanner": {
|
||||
"color": "#061526",
|
||||
"theme": "dark"
|
||||
},
|
||||
"engines": {
|
||||
"vscode": "^1.17.0"
|
||||
},
|
||||
"categories": [
|
||||
"Themes"
|
||||
],
|
||||
"icon": "owl-icon.png",
|
||||
"contributes": {
|
||||
"themes": [
|
||||
{
|
||||
"label": "Night Owl",
|
||||
"uiTheme": "vs-dark",
|
||||
"path": "./themes/Night Owl-color-theme.json"
|
||||
},
|
||||
{
|
||||
"label": "Night Owl (No Italics)",
|
||||
"uiTheme": "vs-dark",
|
||||
"path": "./themes/Night Owl-color-theme-noitalic.json"
|
||||
},
|
||||
{
|
||||
"label": "Night Owl Light",
|
||||
"uiTheme": "vs",
|
||||
"path": "./themes/Night Owl-Light-color-theme.json"
|
||||
},
|
||||
{
|
||||
"label": "Night Owl Light (No Italics)",
|
||||
"uiTheme": "vs",
|
||||
"path": "./themes/Night Owl-Light-color-theme-noitalic.json"
|
||||
}
|
||||
]
|
||||
},
|
||||
"__metadata": {
|
||||
"id": "e58f546c-babc-455f-a265-ba40dbd140d4",
|
||||
"publisherId": "addae8ad-0041-44f2-a2d4-cbebe4912d50",
|
||||
"publisherDisplayName": "sdras",
|
||||
"targetPlatform": "universal",
|
||||
"updated": false,
|
||||
"isPreReleaseVersion": false,
|
||||
"hasPreReleaseVersion": false,
|
||||
"installedTimestamp": 1715772372013,
|
||||
"pinned": false,
|
||||
"source": "gallery"
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 210 KiB |
|
Before Width: | Height: | Size: 533 KiB |
|
Before Width: | Height: | Size: 66 KiB |
|
Before Width: | Height: | Size: 50 KiB |
@@ -192,13 +192,6 @@ if [ ${operation} == "dots" ] ; then
|
||||
mkdir -p ${file_path}
|
||||
deploy_file "${dots_trg}/vscodium/${file_name}" "${file_path}/${file_name}"
|
||||
|
||||
# https://vscodethemes.com/e/sdras.night-owl/night-owl-no-italics?language=javascript
|
||||
# https://github.com/sdras/night-owl-vscode-theme/tree/main/themes
|
||||
file_name=sdras.night-owl-2.0.1-universal
|
||||
file_path=/home/${user}/.vscode-oss/extensions
|
||||
mkdir -p ${file_path}
|
||||
deploy_file "${dots_trg}/vscodium/${file_name}" "${file_path}/" chown recursive
|
||||
|
||||
# i3wm
|
||||
if [ ${I3WM} == "true" ] ; then
|
||||
|
||||
@@ -246,4 +239,17 @@ if [ ${operation} == "dots+" ] ; then
|
||||
mkdir -p ${file_path}
|
||||
deploy_file "${dotsplus_trg}/wallpapers/install/*" "${file_path}/"
|
||||
|
||||
# ----------
|
||||
# miscelanneous
|
||||
# ----------
|
||||
|
||||
# vscodium theme
|
||||
# https://vscodethemes.com/e/sdras.night-owl/night-owl-no-italics?language=javascript
|
||||
# https://github.com/sdras/night-owl-vscode-theme/tree/main/themes
|
||||
file_name=sdras.night-owl-2.0.1-universal
|
||||
file_path=/home/${user}/.vscode-oss/extensions
|
||||
mkdir -p ${file_path}
|
||||
deploy_file "${dotsplus_trg}/miscellaneous/${file_name}" "${file_path}/" chown recursive
|
||||
|
||||
|
||||
fi
|
||||
|
||||