Am an idiot

This commit is contained in:
Sharad Chand 2018-04-07 13:22:03 +05:45
parent b9192592a9
commit ee1e3abd45

View File

@ -695,7 +695,7 @@ impl<'a> Context<'a> {
self.globals.push_str(&format!("
const TextEncoder = require('util').TextEncoder;
"));
} else if !(self.config.browser && self.config.amd) {
} else if !(self.config.browser || self.config.amd) {
self.globals.push_str(&format!("
const TextEncoder = typeof window === 'object' && window.TextEncoder
? window.TextEncoder
@ -715,7 +715,7 @@ impl<'a> Context<'a> {
self.globals.push_str(&format!("
const TextDecoder = require('util').TextDecoder;
"));
} else if !(self.config.browser && self.config.amd) {
} else if !(self.config.browser || self.config.amd) {
self.globals.push_str(&format!("
const TextDecoder = typeof window === 'object' && window.TextDecoder
? window.TextDecoder