The weight of a space does not necessarily equal the weight of a dense subspace.
As an example, note that $\mathbb N$ is clearly second-countable ($w(\mathbb{N}) = \aleph_0$), but its Stone–Čech compactification $\beta \mathbb{N}$ has weight $2^{\aleph_0}$. This can be generalised for the Stone–Čech compactification of any infinite discrete space (see, _e.g._ , Engelking, _General Topology_ , Theorem 3.6.11, pp.174-5).