ronantakizawa/codereview-bench huggingface dataset:
Repository: NativeScript/NativeScript
File: packages/webpack5/src/configuration/base.ts (TypeScript)

Code before:
			// and use that if the project doesn't have one?
			// configFile: '',
			transpileOnly: true,
			allowTsInNodeModules: true,
			compilerOptions: {
				sourceMap: true,
				declaration: false,
			},
			getCustomTransformers() {
				return {
					before: [require('../transformers/NativeClass').default],
				};
			},
		});

	// Use Fork TS Checker to do type checking in a separate non-blocking process
	config.when(hasDependency('typescript'), (config) => {
		config
			.plugin('ForkTsCheckerWebpackPlugin')
			.use(ForkTsCheckerWebpackPlugin, [
				{
					typescript: {
						memoryLimit: 4096,
					},
				},
			]);
	});

	// set up js
	config.module
		.rule('js')
		.test(/\.js$/)
		.exclude.add(/node_modules/)
		.end();

	config.module
		.rule('workers')
		.test(/\.(js|ts)$/)
		.exclude.add(/node_modules/)
		.end()
		.use('nativescript-worker-loader')
		.loader('nativescript-worker-loader');

	// default PostCSS options to use
	// projects can change settings
	// via postcss.config.js
	const postCSSOptions = {
		postcssOptions: {
			plugins: [
				// inlines @imported stylesheets
				'postcss-import',

Review comment (refactor):
This should be `true` in watch/dev mode, and false in release mode to speed up the builds during dev. Just noting here, will merge as-as and then refactor.

The CLI won't restart the app if there are build (synchronous) errors, but will still restart if there are async ts errors - which is a fair trade-off for the speed boost it gives...

Code after:
			// and use that if the project doesn't have one?
			// configFile: '',
			transpileOnly: true,
			allowTsInNodeModules: true,
			compilerOptions: {
				sourceMap: true,
				declaration: false,
			},
			getCustomTransformers() {
				return {
					before: [require('../transformers/NativeClass').default],
				};
			},
		});

	// Use Fork TS Checker to do type checking in a separate non-blocking process
	config.when(hasDependency('typescript'), (config) => {
		config
			.plugin('ForkTsCheckerWebpackPlugin')
			.use(ForkTsCheckerWebpackPlugin, [
				{
					// If we use "async" errors compiling typescript will be ignored by
					// WebPack (we will send the "compilation" message back to the CLI,
					// and the process exit code will be zero), therefore we will end
					// up with a broken build
					async: false,
					typescript: {
						memoryLimit: 4096,
					},
				},
			]);
	});

	// set up js
	config.module
		.rule('js')
		.test(/\.js$/)
		.exclude.add(/node_modules/)
		.end();

	config.module
		.rule('workers')
		.test(/\.(js|ts)$/)
		.exclude.add(/node_modules/)
		.end()
		.use('nativescript-worker-loader')
		.loader('nativescript-worker-loader');

	// default PostCSS options to use
	// projects can change settings
	// via postcss.config.js
Repository: NativeScript/NativeScript
File: packages/webpack5/src/configuration/angular.ts (TypeScript)

Code before:
	config.resolve.mainFields.add('module').add('main');

	config.module
		.rule('angular')
		.test(/(?:\.ngfactory.js|\.ngstyle\.js|\.ts)$/)
		.use('@ngtools/webpack')
		.loader('@ngtools/webpack');

	config.module
		.rule('@angular/core')
		.test(/[\/\\]@angular[\/\\]core[\/\\].+\.js$/)
		.parser({ system: true });

	// set up html
	config.module
		.rule('html')
		.test(/\.html$/)
		.use('raw-loader')
		.loader('raw-loader');

	// exclude component css files from the normal css rule
	config.module
		.rule('css')
		.exclude // exclude *.component.{platform}.css
		.add(/\.component(\.\w+)?\.css$/);

	// and instead use raw-loader, since that's what angular expects
	config.module
		.rule('css|component')
		.test(/\.component(\.\w+)?\.css$/)
		.use('raw-loader')
		.loader('raw-loader');

	// get base postCSS options
	const postCSSOptions = config.module
		.rule('scss')
		.uses.get('postcss-loader')
		.get('options');

	// exclude component css files from the normal css rule
	config.module
		.rule('scss')
		.exclude // exclude *.component.{platform}.scss
		.add(/\.component(\.\w+)?\.scss$/);

	// and instead use raw-loader, since that's what angular expects
	config.module
		.rule('scss|component')
		.test(/\.component(\.\w+)?\.scss$/)
		.use('raw-loader')
		.loader('raw-loader')

Review comment (suggestion):
@edusperoni  This would I believe include *all* files in `node_modules`, since there's no extension checking.



Code after:
	config.resolve.mainFields.add('module').add('main');

	config.module
		.rule('angular')
		.test(/(?:\.ngfactory.js|\.ngstyle\.js|\.ts)$/)
		.use('@ngtools/webpack')
		.loader('@ngtools/webpack');

	config.module
		.rule('@angular/core')
		.test(/[\/\\]@angular[\/\\]core[\/\\].+\.js$/)
		.parser({ system: true });

	// set up html
	config.module
		.rule('html')
		.test(/\.html$/)
		.use('raw-loader')
		.loader('raw-loader');

	// exclude component css files from the normal css rule
	config.module
		.rule('css')
		.include.add(resolve(getEntryDirPath(), 'app.css'))
		.add(resolve(getEntryDirPath(), `app.${platform}.css`))
		.add(/node_modules/);

	// and instead use raw-loader, since that's what angular expects
	config.module
		.rule('css|component')
		.exclude.add(resolve(getEntryDirPath(), 'app.css'))
		.add(resolve(getEntryDirPath(), `app.${platform}.css`))
		.add(/node_modules/)
		.end()
		.test(/\.css$/)
		.use('raw-loader')
		.loader('raw-loader');

	// get base postCSS options
	const postCSSOptions = config.module
		.rule('scss')
		.uses.get('postcss-loader')
		.get('options');

	// exclude component css files from the normal css rule
	config.module
		.rule('scss')
		.include.add(resolve(getEntryDirPath(), 'app.scss'))
		.add(resolve(getEntryDirPath(), `app.${platform}.scss`))
		.add(/node_modules/);
Repository: NativeScript/NativeScript
File: packages/core/utils/index.ios.ts (TypeScript)

Code before:
		return controller.presentPreviewAnimated(true);
	} catch (e) {
		Trace.write('Error in openFile', Trace.categories.Error, Trace.messageType.error);
	}

	return false;
}

export function GC() {
	__collect();
}

let hasQueuedGC = false;
export function queueGC() {
	if (hasQueuedGC) {
		return;
	}

	hasQueuedGC = true;

	setTimeout(() => {
		hasQueuedGC = false;
		GC();
	}, 1000);
}

export function releaseNativeObject(object: NSObject) {
	__releaseNativeCounterpart(object);
}

export function openUrl(location: string): boolean {
	try {
		const url = NSURL.URLWithString(location.trim());
		if (UIApplication.sharedApplication.canOpenURL(url)) {
			return UIApplication.sharedApplication.openURL(url);
		}
	} catch (e) {
		// We Don't do anything with an error.  We just output it
		Trace.write('Error in OpenURL', Trace.categories.Error, Trace.messageType.error);
	}

	return false;
}

export function isRealDevice(): boolean {
	return iOSNativeHelper.isRealDevice();
}

export const ad = 0;

export function dismissSoftInput(nativeView?: UIView): void {

Review comment (suggestion):
Since all this code is the same across iOS/Android we can drop into `utils-common.ts` and share across both. There's potential we may want to expose on `Utils` in general barrel for user access to be able to call in their own advanced cases.

Code after:
		return controller.presentPreviewAnimated(true);
	} catch (e) {
		Trace.write('Error in openFile', Trace.categories.Error, Trace.messageType.error);
	}

	return false;
}

export function GC() {
	__collect();
}

export function releaseNativeObject(object: NSObject) {
	__releaseNativeCounterpart(object);
}

export function openUrl(location: string): boolean {
	try {
		const url = NSURL.URLWithString(location.trim());
		if (UIApplication.sharedApplication.canOpenURL(url)) {
			return UIApplication.sharedApplication.openURL(url);
		}
	} catch (e) {
		// We Don't do anything with an error.  We just output it
		Trace.write('Error in OpenURL', Trace.categories.Error, Trace.messageType.error);
	}

	return false;
}

export function isRealDevice(): boolean {
	return iOSNativeHelper.isRealDevice();
}

export const ad = 0;

export function dismissSoftInput(nativeView?: UIView): void {
	if (nativeView instanceof UIView && !nativeView.isFirstResponder) {
		return;
	}
	UIApplication.sharedApplication.sendActionToFromForEvent('resignFirstResponder', null, null, null);
}
Repository: NativeScript/NativeScript
File: packages/core/platforms/ios/typings/objc!NativeScriptUtils.d.ts (TypeScript)

Code before:
declare class NativeScriptUtils extends NSObject {

	static alloc(): NativeScriptUtils; // inherited from NSObject

	static createMutableStringForSpanFontColorBackgroundColorTextDecorationBaselineOffset(text: string, font: UIFont, color: UIColor, backgroundColor: UIColor, textDecoration: string, baselineOffset: number): NSMutableAttributedString;

	static createMutableStringWithDetails(details: NSDictionary<any, any>): NSMutableAttributedString;

	static createUIFont(font: NSDictionary<any, any>): UIFont;

	static getImageDataFormatQuality(image: UIImage, format: string, quality: number): NSData;

	static getSystemFont(size: number, weight: UIFontWeight, italic: boolean, symbolicTraits: UIFontDescriptorSymbolicTraits): UIFont;

	static new(): NativeScriptUtils; // inherited from NSObject

	static scaleImageWidthHeightScaleFactor(image: UIImage, width: number, height: number, scaleFactor: number): UIImage;
}


Review comment (suggestion):
This doesn't look right - you can `ns typings ios` inside of `apps/toolbox` to regen the typings and put this typing back to get it correct. Should still be `getSystemFontWeightItalicSymbolicTraits` I believe.

Code after:
declare class NativeScriptUtils extends NSObject {

	static alloc(): NativeScriptUtils; // inherited from NSObject

	static createMutableStringForSpanFontColorBackgroundColorTextDecorationBaselineOffset(text: string, font: UIFont, color: UIColor, backgroundColor: UIColor, textDecoration: string, baselineOffset: number): NSMutableAttributedString;

	static createMutableStringWithDetails(details: NSDictionary<any, any>): NSMutableAttributedString;

	static createUIFont(font: NSDictionary<any, any>): UIFont;

	static getImageDataFormatQuality(image: UIImage, format: string, quality: number): NSData;

	static getSystemFontWeightItalicSymbolicTraits(size: number, weight: number, italic: boolean, symbolicTraits: UIFontDescriptorSymbolicTraits): UIFont;

	static new(): NativeScriptUtils; // inherited from NSObject

	static scaleImageWidthHeightScaleFactor(image: UIImage, width: number, height: number, scaleFactor: number): UIImage;
}
Repository: NativeScript/NativeScript
File: packages/webpack5/src/loaders/nativescript-hot-loader/hmr.runtime.ts (TypeScript)

Code before:
// @ts-nocheck
// This is a runtime module - included by nativescript-hot-loader
// this file should not include external dependencies
// ---

if (module.hot) {
	let hash = __webpack_require__.h();
	let hmrBootEmittedSymbol = Symbol.for('HMRBootEmitted');
	let originalLiveSyncSymbol = Symbol.for('OriginalLiveSync');
	let hmrRuntimeLastLiveSyncSymbol = Symbol.for('hmrRuntimeLastLiveSyncSymbol');

	const logVerbose = (title: string, ...info: any) => {
		if (__NS_ENV_VERBOSE__) {
			console.log(`[HMR][Verbose] ${title}`);

			if (info?.length) {
				console.log(...info);
				console.log('---');
			}
		}
	};

	const setStatus = (
		hash: string,
		status: 'success' | 'failure' | 'boot',
		message?: string,
		...info: any
	): boolean => {
		// format is important - CLI expects this exact format
		console.log(`[HMR][${hash}] ${status} | ${message}`);
		if (info?.length) {
			logVerbose('Additional Info', info);
		}

		// return true if operation was successful

Review comment (suggestion):
```suggestion
	let hmrRuntimeLastLiveSyncSymbol = Symbol.for('hmrRuntimeLastLiveSync');
```

Code after:
// @ts-nocheck
// This is a runtime module - included by nativescript-hot-loader
// this file should not include external dependencies
// ---

if (module.hot) {
	let hash = __webpack_require__.h();
	let hmrBootEmittedSymbol = Symbol.for('HMRBootEmitted');
	let originalLiveSyncSymbol = Symbol.for('OriginalLiveSync');
	let hmrRuntimeLastLiveSyncSymbol = Symbol.for('HMRRuntimeLastLiveSync');

	const logVerbose = (title: string, ...info: any) => {
		if (__NS_ENV_VERBOSE__) {
			console.log(`[HMR][Verbose] ${title}`);

			if (info?.length) {
				console.log(...info);
				console.log('---');
			}
		}
	};

	const setStatus = (
		hash: string,
		status: 'success' | 'failure' | 'boot',
		message?: string,
		...info: any
	): boolean => {
		// format is important - CLI expects this exact format
		console.log(`[HMR][${hash}] ${status} | ${message}`);
		if (info?.length) {
			logVerbose('Additional Info', info);
		}

		// return true if operation was successful
Repository: NativeScript/NativeScript
File: packages/ui-mobile-base/android/widgets/src/main/java/org/nativescript/widgets/BoxShadowDrawable.java (Java)

Code before:

	// BoxShadow Parameters
	protected int offsetX = 0;
	protected int offsetY = 0;
	protected int blurRadius = 0;
	protected int spreadRadius = 0;
	protected int shadowColor = Color.BLACK;

	// Layers
	protected final ShapeDrawable shadowLayer;
	protected final ShapeDrawable overlayLayer;
	protected final Drawable wrappedLayer;

	protected float[] currentCornerRadii;

	public BoxShadowDrawable(Drawable wrappedDrawable, String value) {
		super(new Drawable[]{});

		Log.d(TAG, "Constructing BoxShadowDrawable!");

		this.wrappedLayer = wrappedDrawable;
		this.shadowLayer = new ShapeDrawable(new RectShape());

		// add our layers
		this.addLayer(shadowLayer);
		if(!((BorderDrawable) this.wrappedLayer).hasBackgroundColor()){
			this.overlayLayer = this.createOverlayLayer();
			this.addLayer(overlayLayer);
		}
		this.addLayer(wrappedLayer);

		this.setValue(value);
	}

	// to allow applying any bg changes on original Drawable
	public Drawable getWrappedDrawable() {
		return this.wrappedLayer;
	}

	public void setValue(String value) {
		try {
			JSONObject config = new JSONObject(value);
			offsetX = config.getInt("offsetX");
			offsetY = config.getInt("offsetY");
			blurRadius = config.getInt("blurRadius");
			spreadRadius = config.getInt("spreadRadius");
			shadowColor = config.getInt("shadowColor");

			float[] outerRadius;

			// if we are wrapping a BorderDrawable - we can get the radii from it

Review comment (suggestion):
This might be unsafe, `this.wrappedLayer` might not always be a BorderDrawable, so casting to it can lead to exceptions. A safer approach would be to check the type of `wrappedLayer`.

Code after:

	// BoxShadow Parameters
	protected int offsetX = 0;
	protected int offsetY = 0;
	protected int blurRadius = 0;
	protected int spreadRadius = 0;
	protected int shadowColor = Color.BLACK;

	// Layers
	protected final ShapeDrawable shadowLayer;
	protected final ShapeDrawable overlayLayer;
	protected final Drawable wrappedLayer;

	protected float[] currentCornerRadii;

	public BoxShadowDrawable(Drawable wrappedDrawable, String value) {
		super(new Drawable[]{});

		Log.d(TAG, "Constructing BoxShadowDrawable!");

		this.shadowLayer = new ShapeDrawable(new RectShape());
		this.wrappedLayer = wrappedDrawable;

		if(shouldHideOverlayLayer()) {
			this.overlayLayer = null;
		} else {
			this.overlayLayer = this.createOverlayLayer();
		}

		// add our layers
		this.addLayer(shadowLayer);
		if(this.overlayLayer != null) {
			this.addLayer(overlayLayer);
		}
		this.addLayer(wrappedLayer);

		this.setValue(value);
	}

	// to allow applying any bg changes on original Drawable
	public Drawable getWrappedDrawable() {
		return this.wrappedLayer;
	}

	public void setValue(String value) {
		try {
			JSONObject config = new JSONObject(value);
			offsetX = config.getInt("offsetX");
			offsetY = config.getInt("offsetY");
			blurRadius = config.getInt("blurRadius");
			spreadRadius = config.getInt("spreadRadius");
Repository: NativeScript/NativeScript
File: packages/ui-mobile-base/android/widgets/src/main/java/org/nativescript/widgets/BoxShadowDrawable.java (Java)

Code before:
		shadowLayer.getPaint().setAntiAlias(true);

		// apply insets that mimic offsets/spread to the shadowLayer
		int inset = -spreadRadius;
		Log.d(TAG, "Insets:"
			+ "\n l: " + (inset + offsetX)
			+ "\n t: " + (inset + offsetY)
			+ "\n r: " + (inset - offsetX)
			+ "\n b: " + (inset - offsetY)
		);
		this.setLayerInset(0,
			inset + offsetX,
			inset + offsetY,
			inset - offsetX,
			inset - offsetY
		);
	}

	private ShapeDrawable createOverlayLayer() {
		ShapeDrawable shapeDrawable = new ShapeDrawable(new RectShape());
		shapeDrawable.getPaint().setColor(DEFAULT_BACKGROUND_COLOR);

		return shapeDrawable;
	}

	private boolean shouldCreateOverLayer(){
		return this.wrappedLayer instanceof BorderDrawable && !((BorderDrawable) this.wrappedLayer).hasBackgroundColor();
	}
	
	@Override
	public String toString() {
		return "BoxShadowDrawable { oX:" + offsetX + " oY:" + offsetY + " br:" + blurRadius + " sr:" + spreadRadius + " c:" + shadowColor + " }";
	}
}


Review comment (suggestion):
```suggestion
	private boolean shouldCreateOverlayLayer(){
```

Code after:
			Float.MIN_VALUE + blurRadius,
			BlurMaskFilter.Blur.NORMAL
		));
		shadowLayer.getPaint().setAntiAlias(true);

		// apply insets that mimic offsets/spread to the shadowLayer
		int inset = -spreadRadius;
		Log.d(TAG, "Insets:"
			+ "\n l: " + (inset + offsetX)
			+ "\n t: " + (inset + offsetY)
			+ "\n r: " + (inset - offsetX)
			+ "\n b: " + (inset - offsetY)
		);
		this.setLayerInset(0,
			inset + offsetX,
			inset + offsetY,
			inset - offsetX,
			inset - offsetY
		);
	}

	private ShapeDrawable createOverlayLayer() {
		ShapeDrawable shapeDrawable = new ShapeDrawable(new RectShape());
		shapeDrawable.getPaint().setColor(DEFAULT_BACKGROUND_COLOR);

		return shapeDrawable;
	}

	private boolean shouldHideOverlayLayer() {
		if (wrappedLayer instanceof BorderDrawable) {
			BorderDrawable bd = (BorderDrawable) this.wrappedLayer;
			if (bd.getBackgroundColor() != 0 || bd.getBackgroundBitmap() != null || bd.getBackgroundGradient() != null) {
				return true;
			}
		}

		return false;
	}

	@Override
	public String toString() {
		return "BoxShadowDrawable { oX:" + offsetX + " oY:" + offsetY + " br:" + blurRadius + " sr:" + spreadRadius + " c:" + shadowColor + " }";
	}
}
Repository: NativeScript/NativeScript
File: packages/ui-mobile-base/android/widgets/src/main/java/org/nativescript/widgets/BoxShadowDrawable.java (Java)

Code before:
	// BoxShadow Parameters
	protected int offsetX = 0;
	protected int offsetY = 0;
	protected int blurRadius = 0;
	protected int spreadRadius = 0;
	protected int shadowColor = Color.BLACK;

	// Layers
	protected final ShapeDrawable shadowLayer;
	protected final ShapeDrawable overlayLayer;
	protected final Drawable wrappedLayer;

	protected float[] currentCornerRadii;

	public BoxShadowDrawable(Drawable wrappedDrawable, String value) {
		super(new Drawable[]{});

		Log.d(TAG, "Constructing BoxShadowDrawable!");

		this.wrappedLayer = wrappedDrawable;
		this.shadowLayer = new ShapeDrawable(new RectShape());

		// add our layers
		this.addLayer(wrappedLayer);
		this.addLayer(shadowLayer);
		if(this.shouldCreateOverLayer()){
			this.overlayLayer = this.createOverlayLayer();
			this.addLayer(this.overlayLayer);
		} else {
			this.overlayLayer = null;
		}

		this.setValue(value);
	}

	// to allow applying any bg changes on original Drawable
	public Drawable getWrappedDrawable() {
		return this.wrappedLayer;
	}

	public void setValue(String value) {
		try {
			JSONObject config = new JSONObject(value);
			offsetX = config.getInt("offsetX");
			offsetY = config.getInt("offsetY");
			blurRadius = config.getInt("blurRadius");
			spreadRadius = config.getInt("spreadRadius");
			shadowColor = config.getInt("shadowColor");

			float[] outerRadius;


Review comment (suggestion):
```suggestion
		if(this.shouldCreateOverlayLayer()){
```

Code after:
	// BoxShadow Parameters
	protected int offsetX = 0;
	protected int offsetY = 0;
	protected int blurRadius = 0;
	protected int spreadRadius = 0;
	protected int shadowColor = Color.BLACK;

	// Layers
	protected final ShapeDrawable shadowLayer;
	protected final ShapeDrawable overlayLayer;
	protected final Drawable wrappedLayer;

	protected float[] currentCornerRadii;

	public BoxShadowDrawable(Drawable wrappedDrawable, String value) {
		super(new Drawable[]{});

		Log.d(TAG, "Constructing BoxShadowDrawable!");

		this.shadowLayer = new ShapeDrawable(new RectShape());
		this.wrappedLayer = wrappedDrawable;

		if(shouldHideOverlayLayer()) {
			this.overlayLayer = null;
		} else {
			this.overlayLayer = this.createOverlayLayer();
		}

		// add our layers
		this.addLayer(shadowLayer);
		if(this.overlayLayer != null) {
			this.addLayer(overlayLayer);
		}
		this.addLayer(wrappedLayer);

		this.setValue(value);
	}

	// to allow applying any bg changes on original Drawable
	public Drawable getWrappedDrawable() {
		return this.wrappedLayer;
	}

	public void setValue(String value) {
		try {
			JSONObject config = new JSONObject(value);
			offsetX = config.getInt("offsetX");
			offsetY = config.getInt("offsetY");
			blurRadius = config.getInt("blurRadius");
			spreadRadius = config.getInt("spreadRadius");
			shadowColor = config.getInt("shadowColor");
Repository: NativeScript/NativeScript
File: packages/core/ui/web-view/index.android.ts (TypeScript)

Code before:
import { disableZoomProperty, WebViewBase, WebViewClient } from './web-view-common';
import { Trace } from '../../trace';
import { knownFolders } from '../../file-system';
import { openUrl } from '../../utils';
import * as application from '../../application';

export * from './web-view-common';

let WebViewClient: WebViewClient;

function initializeWebViewClient(): void {
	if (WebViewClient) {
		return;
	}

	@NativeClass
	class WebViewClientImpl extends android.webkit.WebViewClient {
		constructor(public owner: WebViewBase) {
			super();

			return global.__native(this);
		}

		public shouldOverrideUrlLoading(view: android.webkit.WebView, target: any) {
			const url: string = target instanceof android.webkit.WebResourceRequest ? target.getUrl().toString() : target;

			if (Trace.isEnabled()) {
				Trace.write('WebViewClientClass.shouldOverrideUrlLoading(' + url + ')', Trace.categories.Debug);
			}


Review comment (suggestion):
Instead of importing `application` here, you can import from utils. We've been trying to pair down some circular imports throughout core over time and `application` contains some which would be better to avoid here for bundling.

Instead, do this:
```
import { openUrl, ad } from '../../utils';
```

## For Clarity

`ad` when importing within core relatively is short for `android` to avoid bumping up against the `android` global. It is exported from the main barrel for consumption as:

```
import { Utils } from '@nativescript/core'

// for example:
Utils.android.getApplicationContext()
```

Code after:
import { disableZoomProperty, WebViewBase, WebViewClient } from './web-view-common';
import { Trace } from '../../trace';
import { knownFolders } from '../../file-system';
import { openUrl } from '../../utils';

export * from './web-view-common';

let WebViewClient: WebViewClient;

function initializeWebViewClient(): void {
	if (WebViewClient) {
		return;
	}

	@NativeClass
	class WebViewClientImpl extends android.webkit.WebViewClient {
		constructor(public owner: WebViewBase) {
			super();

			return global.__native(this);
		}

		public shouldOverrideUrlLoading(view: android.webkit.WebView, target: any) {
			const url: string = target instanceof android.webkit.WebResourceRequest ? target.getUrl().toString() : target;

			if (Trace.isEnabled()) {
				Trace.write('WebViewClientClass.shouldOverrideUrlLoading(' + url + ')', Trace.categories.Debug);
			}

			// Handle schemes like mailto, tel, etc