This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { ui } from 'tabris'; | |
function positive(prototype: object, property: string) { | |
const sym = Symbol(); | |
Object.defineProperty(prototype, property, { | |
enumerable: true, | |
set(value: number) { | |
if (value < 0) { | |
throw new Error('Positive number expected'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { ui } from 'tabris'; | |
function pattern(regEx: RegExp) { | |
return (prototype: object, property: string) => { | |
const sym = Symbol(); | |
Object.defineProperty(prototype, property, { | |
enumerable: true, | |
set(value: string) { | |
if (!regEx.test(value)) { | |
throw new Error(`Invalid ${property} "${value}"`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log('Hello Gist'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/******************************************************************************* | |
* Copyright (c) 2011 EclipseSource and others. All rights reserved. | |
******************************************************************************/ | |
import org.eclipse.rwt.internal.widgets.JSExecutor; | |
import org.eclipse.rwt.lifecycle.IEntryPoint; | |
import org.eclipse.swt.SWT; | |
import org.eclipse.swt.widgets.Button; | |
import org.eclipse.swt.widgets.Canvas; | |
import org.eclipse.swt.widgets.Display; |
NewerOlder